Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
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
0 registered members (), 18,161 guests, and 5 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
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,806
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

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

Joined: Feb 2017
Posts: 1,806
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