My concern is I watched some sim trading in realtime, and it seems another signal was not taken. This makes me wonder if my flag will get reset for sure no matter how an exit is handled. Also, if I put the flag reset in the right location (i.e. after a trade is taken, it should also reset the flag, so that if or when this trade is finished, I can take another one later).
Here is the code, if you good folks have any suggestions let me know.
// Condition set 1
if (Close[0] < SMA(SMA200period)[0] && (Position.MarketPosition == MarketPosition.Flat)
&& CrossAbove(SMA(5), SMA(SMA20period), 1))
AFlag = true;
{
if (Close[0] < SMA(SMA200period)[0] && (CrossBelow(Stochastics(PeriodD, PeriodK, Smooth).K, TopLine, 1)
&& AFlag == true))
{
EnterShort(Entry2target, "Entry2TargetSIGNALNAME");
EnterShort(Entry8target, "Entry8TargetSIGNALNAME");
AFlag = false;
}
}
Is that "AFlag=false" in the right location and right syntax?

Comment