Tick data and OHLC in the same script

Posted By: pablomfz

Tick data and OHLC in the same script - 01/07/20 16:47

Hi,

I wondering if it is possible to work with OHLC data in a script that it needs tick data:

I set:
Code
set(PLOTNOW, TICKS);
History = ".t1";
BarPeriod = 1./60;

and in the tick function:
Code
function tick()
{
  // do whatever you want
  printf("\nLast Tick: %f", priceClose(0)); //This prints the quote price successfully

  printf("\n Price Low Time Frame 5 min: %f , Price Low Time Frame 60: %f", priceLow(0),PriceLow(0)); //Here I see OHLC data for 1 second but I need priceLow for 5min and 60 min
}

How can I access OHLC from different timeframes while the script is using .t1 files with a BarPeriod = 1./60?
Thank you!

Pablo.
Posted By: ozgur

Re: Tick data and OHLC in the same script - 01/07/20 21:37

Declare global series() and fill them in run() using TimeFrame then access them in tick() [Assuming you are after for closed bar values].
© 2024 lite-C Forums