I am seeing a weird problem where my Strategy seems to work fine on past data but when the live ticks come in it suddenly doesn't work. I know I must be doing something fundmentally wrong here...
protected override void OnBarUpdate()
{
if (FirstTickOfBar && Position.MarketPosition == MarketPosition.Flat)
{
if (CrossBelow(RSI(rSIBarLen, rSIMALen), RSI(rSIBarLen, rSIMALen).Avg, 1))
{
Print(Instrument.FullName + " Sell Short!");
DrawArrowDown(Guid.NewGuid().ToString(), true, 0, High[0] + 2*TickSize, Color.Red );
}
}
}
When I first enable this on a live 5 minute chart, all the crossvers "happen". But as the real time ticks come in, the visual chart updates but the crossover never seems to happen as I never see the print or the DrawArrow. However if I disable and re-enable, then the crossovers that didn't occur when live, do get generated once they are history.
Any idea what simple concept I am missin here? I have included Prints as well and the values are fine preceding the CrossBelow() call.
Thanks in advance for any help!


Comment