Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by MonsterX. 12/05/25 02:43
ZorroFix. ini /data and /log path
by Martin_HH. 12/02/25 11:42
Parameter selection
by jcl. 12/01/25 12:28
ZorroGPT
by TipmyPip. 11/29/25 09:38
webGL
by Ezzett. 11/27/25 23:22
Chart viewer
by clint000. 11/27/25 21:21
Black Friday discounts!
by jcl. 11/27/25 13:58
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (MonsterX), 1,278 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
MonsterX, KF_Investments, Luuk, decotb, clint000
19184 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
price() on different timeframes #479018
02/05/20 20:02
02/05/20 20:02
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
I was wondering why price() does not return precisely the same result when using different timeframes?

For example:

BarPeriod = 10;
TimeFrame = 6;
if(!minute())printf("\n%s %.7f",strdate("%d.%m %H:%M",0), price());

does sometimes, but not always, print out slightly different prices than on BarPeriod 60 TimeFrame 1.

Re: price() on different timeframes [Re: gamadeus] #479019
02/05/20 20:40
02/05/20 20:40
Joined: Feb 2017
Posts: 1,810
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,810
Chicago
Hint: replace !minute() with frame(0) and see what happens. Also, read the manual regarding TimeFrame and frame().

Last edited by AndrewAMD; 02/05/20 20:43. Reason: typo
Re: price() on different timeframes [Re: gamadeus] #479020
02/05/20 21:13
02/05/20 21:13
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
Thanks Im aware of these functions, in the script Im actually running this on I am using frameSync instead. Thats not the cause and I wanted to make this example script as simple as possible.

Last edited by gamadeus; 02/05/20 21:14.
Re: price() on different timeframes [Re: gamadeus] #479022
02/05/20 23:40
02/05/20 23:40
Joined: Feb 2017
Posts: 1,810
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,810
Chicago
With TimeFrame = 6 and 10 minute bars, there is no guarantee that the last 6 bars represent the last 60 minutes. There can be many reasons for this, such as data gaps.

Consider also that the price function generates an average of the immediately available samples. In one case, you have one degree of separation from your T6 data, and in another case, you have two degrees of separation from your T6 data.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1