BarOffset for per-bar oversampling

Posted By: Zheka

BarOffset for per-bar oversampling - 06/04/21 16:39

How does Zorro change BarOffset when doing per-bar oversampling?

For,say, BarPeriod=60, what would BarOffsets be for NumSampleCycles=2, 3,4,6?

Also, is PRELOAD(and/or TESTNOW) flag needed?
Posted By: Petra

Re: BarOffset for per-bar oversampling - 06/05/21 06:46

I dont know the exact formula but the bar period is divided in equal parts and the offset starts with the highest so that the last cycle has offset zero. Preload and testnow have nothing to do with that.
Posted By: Zheka

Re: BarOffset for per-bar oversampling - 06/05/21 13:55

Sorry, I am not completely clear. Can you pls give an example?

Say, for the following default set up:

BarZone=ET;
EndWeek = 51705;

BarOffset = 17*24; // so that the day ends at 17:00 ET.
BarPeriod= 1440;

what BarOffsets will be used by Zorro with NumSampleCycles = 4?

Since 'oversampling' makes bar resampling, then both PRELOAD and TESTNOW should have some influence on that - based on the description of these in the manual (and jcl's answer to my question: https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=483395#Post483395)..
Posted By: Petra

Re: BarOffset for per-bar oversampling - 06/06/21 06:38

17*24. 4 times.

Computers do what you tell them to do.
Posted By: Sempervirens

Re: BarOffset for per-bar oversampling - 06/24/21 02:39

Hello Zheka, did you had any success oversampling? I'm currently using zorro version 2.35.9 and adding NumSampleCycles = 4 seems to have no effect at all on my script, the backtest shows same exact results with or without oversampling and the time for testing seems to be exactly the same as well, I tried just adding the line into the Workshop 4 script and it didn't change the result or the time it took to test the script either, thinking I must be doing something wrong or maybe the function is broken? If you have managed to do per-bar oversampling in 2.35.9 please let me know, thanks!

Edit: also when clicking results and going thru the file Workshop4.txt I noticed that under "Cycle performance" It shows 0.00 0.00 0.00 0.00.

Edit: for anyone wondering the solution is to set up NumSampleCycles before the asset() call. Thanks Zheka.
© 2024 lite-C Forums