I didn't know that the indicator has a function that you could call from a strategy when conditions change. If I knew C#, I would try to reference the swing conditions. What I mean is when the condition for uptrend changes to the condition for a down trend (or vice versa). Do you see anything like that in the code?
I'm trying to read the C# of the indicator for buy and sell conditions and I think it would be something like this.
// Selling Short condition if (ShortTermSwings().Trend[0] == -1 && ShortTermSwings().Trend[1] == 1) { ExitShort(DefaultQuantity, "Vente"); SetProfitTarget("Vente", CalculationMode.Ticks, 42*TickSize); } // ********************************* // Buying To Cover condition if (ShortTermSwings().Trend[0] == 1 && ShortTermSwings().Trend[1] == -1) { EnterShort(DefaultQuantity, "Achat"); SetProfitTarget("Achat", CalculationMode.Ticks, 42*TickSize); }
NinjaTrader Clear Method indicator
Comment