I'm doing an EMA Cross Exit Strategy via Strategy Builder where the trade exits when, price/bar crosses above the Swing High. Often, I see it close 1 bar after entry.
Is there a way in the building strategy to ignore the last swing high on the next bar? I tried to use the Bars ago parameter and still happens
Below is my code and screenshots of the exits.
if (
// When Price is Greater than Swing High
((Close[0] >= Swing1.SwingHigh[0])
&& (CurrentBars[0] != SavedBar))
// SMA 50 Below SMA200
|| ((CrossBelow(SMA1, SMA2, 1))
&& (CurrentBars[0] != SavedBar)))
{
ExitLong(Convert.ToInt32(DefaultQuantity), "", "");
SavedBar = Convert.ToInt32(CurrentBars[0]);
}
Thank you in advance.
Comment