Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 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: 594
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 594
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: 28,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,029
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