Minute-spaced script with 60 hourly series?

Posted By: Hredot

Minute-spaced script with 60 hourly series? - 09/20/17 04:10

I'd like to make Zorro record a tick every minute, but also generate hourly ticks in parallel, where each minute in an hour gets assigned its own version of hourly series.
I have an idea how to do this using a 60xLookBack matrix M[i,j] and writing my own function that moves the j elements back by one at each respective minute i. However, that is a little involved. Therefore, I'd like to ask if this functionality can be realized in zorro more conveniently?
Thanks for any suggestion!
Posted By: firecrest

Re: Minute-spaced script with 60 hourly series? - 09/20/17 05:50

Maybe can try Timeframe?
http://www.zorro-trader.com/manual/en/barperiod.htm
Posted By: Petra

Re: Minute-spaced script with 60 hourly series? - 09/20/17 06:42

With 60 FrameOffsets, one for each series
Posted By: Hredot

Re: Minute-spaced script with 60 hourly series? - 09/20/17 14:42

Do you mean something like:

Code:
BarPeriod=1;//one minute ticks
TimeFrame=1;//read at one minute intervals
vars minuteseries=series(price());//record minute series
int mininhour=60;
TimeFrame=mininhour;//now read at 60 minute intervals
vars hourlyseries[60];//define a series for each minute
static int minnow=-1;
minnow=(minnow+1)%mininhour;//determine which minute we are on
FrameOffset=minnow;//Make sure the current minute is updating
hourlyseries[minnow]=series(price());//record hour series



Do you think that will work? I'll give it a try!

EDIT:
Yeah, seems to work. Thanks!
But what I wonder is: does price() return the average of the whole hour when TimeFrame is set to 60, or just the last minute reading since BarPeriod is 1?
© 2024 lite-C Forums