murthysuresh wrote:
hello
i use the lastvalue(buy) to check if it got triggered before adding the ticker to the watchlist. this works only if i have Range=last n quotations =1 on my filters. if i use a date range, it does not work properly. any ideas on how to overcome this.


|You can also try this (set n last quotations = 1)*

Buy* = mtRandomA(1)> 0.8;

barsback = 10;
first = *BarCount*-1 - barsback;
Last = *BarCount*;
dt = DateTime();
*for* (i = first ; i < Last; i++)
{
*Filter* = 1;
AddColumn(*Buy*[i], DateTimeToStr(dt[i]), 1);
}

|

Reply via email to