I currently have a public int Stop and public int Target in the region Properties section as well as Target = 2 and Stop = 20 in OnStateChange()
When my entry conditions are met for longs I have:
SetStopLoss(@"", CalculationMode.Price, Lows[2][0] - Stop, false); // Set stop loss 20 points below candle low
SetProfitTarget("", CalculationMode.Price, Closes[2][0] + (Target * (Closes[2][0] - (Lows[2][0] - Stop))), false); // Set profit target 2 times the (entry price - stoploss)
The code works when I replace Stop and Target with an actual number but I want to test different stop and target variables in the strategy analyzer. Any suggestions?

Comment