[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Multitime frame OHLC that update every bar of the lower time frame



PureBytes Links

Trading Reference Links

I'm trying to get the OHLC to update every bar of the lower time frame
the same way a indicator does. So for example I'm using 15 min as the
higher time frame while viewing a 5 min time frame. When using
indicators like the StochD. I see the StochD change as the 15 min bar
is forming, but in 5 min increments. The code below works like that:

TimeFrameSet( T2 );
tstoch10 = StochD( 15 , 5, 5); 
TimeFrameRestore();
tstoch10x = TimeFrameExpand( tstoch10, T2 );

When plotted on the 5 min chart I see the StochD change as the 15 min
bar is being updated. 

What I want to see is the same for the High/Low and Close as the 15
min bar is being updated. So for example the 1st 15 min bar would look
like the 1st 5 min bar. On the 2nd 5 min bar, the 15 min bar would be
the combination of the first and second 5 min bar. On the 3rd 5 min
bar the 15 min bar would like the combined three 5 min bars. Hope this
makes sense

I've tried many things, including the TimeFrameGetPrice with the
differnt options of expandLast etc. and thought that expandFrist would
be the answer but it only gives me the completd high/low/close for the
full 15 min bar on each 5 min bar as shown with the code below:

Open10x = TimeFrameGetPrice( "O", T2, 0, expandFirst);
Close10x = TimeFrameGetPrice( "C", T2, 0, expandFirst );
High10x = TimeFrameGetPrice( "H", T2, 0, expandFirst );
Low10x = TimeFrameGetPrice( "L", T2, 0, expandFirst );
PlotOHLC( Open10x, High10x, Low10x, Close10x, "15 Min bars",
colorWhite, styleCandle );

I've done this same thing using esignal and had to use a 1 period
moving average of each OHLC to get the data in 5 min increments. I
tried that with AB but it didn't work.

Thanks for help on this,
Mark










Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.11/542 - Release Date: 11/20/2006