I want to screen stocks based on their last 2 daily bars, but to avoid adding their data series on configure and then receiving their bar updates throughout all the strategy.
But rather, I would like to have on State.Configure a check based on these bars, whether or not I want to add their data series.
Something like this:
string symbol = "AAPL";
if (State == State.Configure)
{
Bar currentDayBar = Instrument.GetDailyBar(symbol, 0);
Bar previousDayBar = Instrument.GetDailyBar(symbol, 1);
if (ScreenStock(currentDayBar, previousDayBar))
{
AddDataSeries(symbol, BarsPeriodType.Minute, 1);
}
}
Any ideas how to implement the part of:
Instrument.GetDailyBar(symbol, 0)
??
Thank you
Comment