Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
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,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
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 | chip programmers | 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