Buying/Selling at the highest/lowest price of the last 21 days
-
Hi, I have been trying for weeks to get this EA to work and tried absolutely everything I can, with no joy. Its a simple EA, I want to buy when the current price goes higher than the previous high price of the last 21 days and to sell when the opposite happens. No take profit and a stop loss of twice the 14 day ATR. The trade will close after the buy trade crosses the lowest price of the last 10 days and the opposite for selling. I feel like I am close, however it is just the condition blocks which are not working and I don't understand why, Thank you. (the trace is so I can see the trades are taken/closed at the right points)
-
-
Hi, thank you for that, so quick! It is certainly is getting closer. There seem to lots of trades opening on each candle (day).

I am trying to get a buy trade to open when it hits the blue line which is the highest price of the last 21 days, and only one to
open. I want the trade to stay open until it drops and crosses the lowest price of the last 10 days which is the opposite red line. The same for the sell trades but the reverse, i.e. one sell trade to open when it hits the lowest blue line and then to close when it rises past the 10 day price high, the opposite red line.It is meant to be a trend/breakout system on a daily chart.
Thank you
-
all you described can be easily done, behind this closing can be trailing (and ofc. missing block for filtering - once per bar - daily if you will one trade per daily candle - placed before block for opening trade), look here (trailing is off, you can turn on if you will) :
https://fxdreema.com/shared/f3F0AWBF
it is also example how to make closing on opposite situation with period 10 for highest/lowest ... -
I feel that every 5th person have the same trouble with multiple trades these days

Always remember this - when blocks are positioned under "on Tick", this means that they run on every tick! Well, those on the top.
Also remember this - blocks like "Buy now" create a new trade every time they run, every time! So the idea is to prevent these blocks from running on every tick. That's why we put those "No trade", "Once per bar" and similar stuff above them.
Exactly the same is true for "Close trades" block - this one would close trades when it runs, every time. So this one also needs some extra blocks on top... sometimes.
Here in this example the number of blocks is small, but still everything works fine: https://fxdreema.com/demo/mt4-buy-sell-buy-sell-opposite-conditions
-
Wow you are a genius! That is what I have been trying to do. With the trailing stop I have set it to what I thought was 2 x the 14 day ATR. However is seems to be a lot less than that. I adjusted it with *2 so not sure why?
Thank you
-
Trailing stop blocks should run on every tick, their place is not under Buy now or Sell now - https://fxdreema.com/demo/mt4-trailing-stop
