I have this formula used in backtesting for break-even trades.
activation_floor_array = 1.02*EMA(Close, 50);
ApplyStop( stopTypeLoss, stopModePercent, 0, True, False, 0, 0, -1, ActivationFloor=activation_floor_array );
When I run it, I get an error saying that Activation Floor argument requires a number, not an array. I tried SelectedValue(activation_floor_array)
but realized it returns the wrong number. The right number is the number in activation_floor_array that coincides with the trade entry bar. SelectedValue()
returns the last bar of the range.
Can someone help or provide some hint on how to move forward?
Thank you.