Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,038 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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