This is probably a simple thing but has me scratching my head. I have a simple MA cross strategy with an entry and trail stop running on five min bars, CalculateOnBarClose = false so that it enters and trails on every tick.
The thing is I want the indicators (the MAs) to be CalculateOnBarClose=true.
I've tried Add(PeriodType.Tick, 1) with the Strategy COBC set to true, then moved the SetStopLoss() logic from Initialize() to OnBarUpdate like this;
...OnBarUpdate()
if(BarsInProgress ==1)// 1 tick series
{
SetTrailStop(etc etc);
}
DoSomethingElse at close of bar;
But that still seems to only fire at close of bar.
Am I missing something simple?
Thanks!
Comment