Simple EA Help
-
I need help making a simple EA.So my broker allows hedging and I do not like this feature.I would like an Ea that would disable this feature, like not allowing to open a buy or sell allow at the same time.For example, I have 2 pending orders (buy and sell) .it hits my buy stop order but my sell is still pending .Price reverses and it hits my sell stop.Once it hits my sell stop, my buy stop trade will exit.I would like this to work for all currency pairs/timeframe .If anyone can make this simple EA I would be thankful
P
-
Easy. You should use a 'No trade' block on top of your buy and sell block's trees. That way you avoid a new order once one of them is still active. Than you will need a variable to control when to erase a pending order when a buy or sell is immediately open.
-
@l-andorrà I do not want to erase my pending order.let me give an example...………..I placed a pending order a buy stop and a sell stop(I didn't set a stop loss on these orders) Minutes later my buy stop gets hit( I do not want the EA to cancel the sell stop pending order).3 hours later my sell stop gets hit, for the EA, once it hits the sell stop, I want it to cancel the buy order I am already in .EA should work with all pairs.It should should not allow me to have a buy and sell order open on the same pair.
-
@jgwap203 Maybe something like this?

If a Buy trade is created (eg. a Buy order is triggered) you close open sell orders? You do this on "on Trade" tab
-
@trader-philipps yes if a buy ordered is triggered it should close all open sell orders......BUT will this close all open sell orders I have open or only for that currency pair? For example, if a buy ordered for eur/usd , I want it to only close open sell orders for eur/usd and and not other sell open orders.Im trying to design a code that will work with all pairs I have open but not affect each other.Thank you so much for replying and willing to hear back from you
-
@jgwap203 It should only close the trades on the symbol the EA is attached to - unless you specify different in the blocks.
-
@trader-philipps is there a way instead of posting the EA on multiple symbols, I can post the EA on one symbol and it would reconize to do this for all symbols ? I trade the majors and minors currencies so that’s about 28-26 pairs
-
@trader-philipps If it cAnt be done then I have no choice to post the EA multiple times
-
@jgwap203 There are ways to have a sine instance managing a defined set of symbols in fxdreema. However it complicates things a bit as you have to cycle through the symbols.
I'd say first step is to make it work on current pair and after that think about the Multi-Symbol approach. -
@trader-philipps ok i will test it out in a few hours and let you know, again thank you for your time to help me.