I tried to make a very simple EA. The theory would be like this:
– open 2 x long trades with the same lot size, if CCI crosses above -100
– both positions have the same SL in pips
– 1 position have TP distance same like the SL, so 1 position will be closed and I let run the 2nd position and here the stop loss is already in BE
– if the 2nd position goes in my favour and:
-if the price moves up 2 x the SL range, I set the SL in 1 x SL range
-if the price moves up 3 x the SL range, I set the SL in 2 x SL range
– and so on
But my updated SL is bouncing up and down, because all the EA uses “TICK”. But I wanted to have the moved SL to “be sticked” to the new upper level and not going down again… How could I solve it?
Attachments:You must be logged in to view attached files.
you need to save the new SL price into a variable. Then you need to use the Maximum function as the parameter for the Set stop loss function to compare so the maximum price (either stored value or newly calculated price) is used to set SL. This way the stop-loss will only move to higher prices not lower. Let me know if any help needed
You must be logged in to reply to this topic.