– MZpackStrategyBase.OnEntryPatternValidated() is virtual. Always call base method in overrider.
See how to implement one pattern validation per bar. This might be useful for OnEachTick signals tree.
public class MyStrategy : MZpack.NT8.Algo.Strategy
{
int validatedBarIdx = -1;
public MyStrategy(string name, MyNinjaStrategy ninjaStrategy) : base(name, ninjaStrategy)
{
}
public override void OnEntryPatternValidated(Pattern sender, DateTime time)
{
validatedBarIdx = MZpackStrategy.CurrentBar;
base.OnEntryPatternValidated(sender, time);
}
public override bool OnValidateEntryPatternFilter(object e, MarketDataSource source)
{
if (MZpackStrategy.CurrentBar == validatedBarIdx) // One pattern validation per bar
return false;
return true;
}
}