OK, so 'var LowerThreshold = -optimize(-90,-135,-45,9);' isn't working, then why not use:

Code
var LowerThreshold = optimize(90,135,45,9);
var LowerThresholdFinal = -LowerThreshold;


So you're only using 'LowerThresholdFinal' within your trading rule(s).

This is what I meant with the 2nd & 3rd code example.



Last edited by Grant; 05/06/23 00:54.