Multiple ATR trailing stops
9件の返信
I’m trying to create an EA that uses multiple ATR stop losses.
1: Stop trails up to breakeven, using “fast ATR” stop loss, and holds.
2: Stop trails up farther when “slow ATR” is greater than breakeven.
3: Stop moves back and trails up using “trend ATR” once “trend ATR” is greater than breakeven.
I’ve tried to follow the Trailing Stop Simulation the best possible, the problem is it will only move the stop loss using whole numbers, 102, 103, 104… ect. Any help would be appreciated.
0
Change variable type for stop prices from “int” to “double”. It should help
0
Thank you tomas, that solved the whole number problem.
Now there’s a new problem, the simplest way to explain it is with an example:
GBP/USD stoploss should be at 1.9206, my EA is trying to place it at .00019206. With the JPY pairs it is placing it at 1.0232 instead of 102.32.
I have double checked my settings and conditions and I just don’t see anything wrong. It seems to be following all the conditions correctly because 1.9206 is the correct stoploss, it just has the decimal places for the pips wrong (see the picture). Thank you for your help!
0
I have noticed that you also define stop-loss incorrectly. The stop range is supposed to be in pips but when you multiply ATR x factor it is like 0.002 x 2. The result is not in pips. You would have to use ConvertToPips(ATR x factor) to get SL pips range value
0
I will make the changes and check it.
0
I made the changes but it doesn’t seem to work right, the only way it works correctly is (ATR x factor).
0
Ok, will try to do changes to make it work
0
こんにちは,
the problem is when you set price for “Move SL To” as “Fixed Price”. There is a bug that causes the calculated price to be multiplied. Hence the incorrect final price.
To solve this you need to define price using formula as shown in edited example of yours. Look at the attachment.
0
9件の返信を表示中 - 1 - 9件目 (全9件中)