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,619 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
LookBack and StartBar #476241
02/07/19 07:44
02/07/19 07:44
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
I am a bit puzzled about how Lookback and simulation Periods work.
Im using the following testscript:

function run()
{

StartDate = 20180104;
EndDate = 20180104;
BarPeriod = 60;
LookBack = 0;

if(!is(INITRUN) && !is(LOOKBACK)) printf("n%02i-%02i-%02i %04i",year(),month(),day(),tod());

}

What is strange about it, is that first timestamp printed is 2am, not 1am as expected.
However, when I change Lookback to any non zero value it prints at 1am as it is supposed to.

What is going on here?
Its not really a big issue, I would just like to understand Zorros idiosyncrasies.

Re: LookBack and StartBar [Re: gamadeus] #476242
02/07/19 07:57
02/07/19 07:57
Joined: Nov 2018
Posts: 55
G
gamadeus Offline OP
Junior Member
gamadeus  Offline OP
Junior Member
G

Joined: Nov 2018
Posts: 55
Printing the Bar number somwhat explains my question but leads to another question.
Without Lookback the bar that ends at 2am is 1, which is the first period that can be printed.

However any Lookback up to 7 shifts Bar by 46, i.e. the 2am Bar is 47 now. Incremental increases thereafter seem to shift Bar in non linear fashion (didnt try to figure out the pattern).

So my question now is, what the heck is Lookback doing here? I thought that integer is the number of bars prior to StartBar, which clearly is not the case here.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1