Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Akow), 1,371 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
"Negative price offset" #412648
11/30/12 13:33
11/30/12 13:33
Joined: Nov 2012
Posts: 6
N
NightWalker Offline OP
Newbie
NightWalker  Offline OP
Newbie
N

Joined: Nov 2012
Posts: 6
Hi, I'm trying to create series for differences between current DayOpenPrice and close of prices from other timeframe (ex. hour). Unfortunately my code generates mentioned error. Maybe I don't understand something?


var* PriceDiff = series(abs(priceClose(0)-dayOpen(UTC, 0)));

--
NightWalker


NightWalker
Re: "Negative price offset" [Re: NightWalker] #412680
12/01/12 08:26
12/01/12 08:26
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
The stock exchange normally opens at 9 so żou can not know the open of the day when you call that function in a morning bar. Only in a later bar you can know the open of the day. Hope I made sense?

Re: "Negative price offset" [Re: Petra] #412682
12/01/12 11:43
12/01/12 11:43
Joined: Nov 2012
Posts: 6
N
NightWalker Offline OP
Newbie
NightWalker  Offline OP
Newbie
N

Joined: Nov 2012
Posts: 6
Yes it's true, I've made few mistakes here. First of all - dayOpen refers to stock open (9 to 4) and it won't work properly in fx market, second - I shouldn't call priceClose with index, third priceClose can fill series, dayOpen obviously not.


NightWalker
Re: "Negative price offset" [Re: NightWalker] #412777
12/03/12 08:50
12/03/12 08:50
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
The first assumption is correct, so when you trade forex only, you need not use dayOpen.

Aside from that, your above code is ok - you only must take care not to request prices that lie in the future. So use the Open of the previous day only - dayOpen(UTC,1) - when the current bar has a local time before 9:30.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1