DislikedHi RR -- nice work... I was backtesting and found that no long positions were being opened, with an error 130 (invalid stop level) in the journal. Upon further inspection I found that the problem was with the %range stop loss, specifically dividing the %range by 100 (an int) instead of 100.0 (a float).
The attached version fixes this bug, it didn't seem to affect the TP levels or Short orders, but I fixed it in all 4 locations anyway.
There was another bug on line 353, was...Ignored
Line 353: Should be greater than. (>) Remember, if the EA is given multiple stoploss options, it takes the tightest one. On the buy side, if the new stoploss is greater than the current stoploss, then that stoploss is tighter.
The 100 vs. 100.0, what's the difference? It wasn't a variable.
Lines 352, 356, 393, 397: The levels need to be compared with the existing stoploss or takeprofit, you are right that for each of those lines, that value is 0. I put them in there so I can add in more stoploss/takeprofit features in the future should there be more feature requests. You are right in that that specific snippet of code is not necessary for this current iteration.