Gamestudio Links
Zorro Links
Newest Posts
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
ZorroGPT
by TipmyPip. 10/26/26 08:09
Chat Room for Zorro Programmers
by Haitao_Ren. 10/25/26 03:14
Trading Journey
by Haitao_Ren. 10/25/26 03:14
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (TipmyPip), 14,971 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Haitao_Ren, JimSimons, julienp, julienper, KelleyAbbey
19247 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: 604
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 604
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,145
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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