Here's the code:
double positionQualCount = 0;
...
protected override void OnBarUpdate()
{
if (entrycondition)
{
EnterLong();
positionQualCount = positionQualCount + 1;
if (positionQualCount == 1)
{
Print(Instrument.MasterInstrument.Name + "Strategy1");
}
...
if (Position.MarketPosition = MarketPosition.Flat)
{
positionQualCount = 0;
}
Is there a better way to determine if the position has just been entered?

Comment