how to open multiple orders in my EA?
-
I am creating a very simple EA. My EA will open a buy order when RSI crossover above level 30 with TP: 100 pip and SL: 100, but if it does not reach the TP, I would like it to open a new order if RSI returns to level 30. Same goes for Sell orders ( level 70).
how should i do?Thanks!

-
@joe_fx Make the no trade block separate so you have 1 for buys and one for sells, copy your buy & sell blocks, past in a new tree, above place a check trades block, and put your condition blocks above. You can put an if trade above all for buy & and sell if you want, no trade will prevent any trades if one is already running.
-
@joe_fx You need to be more specific when defining the meaning of 'returns to level...', because that can happen several times per minute ir RSi is hitting that level. It can move up and down many times within that same candle.
-
@jstap Thanks for the answer but I didn't understand how to do it. if you can make me understand better with an example.
-
-
@joe_fx Put a shared link here and I'll show you.
-
-
-
@jstap Yesterday I tested it in a period where there are 4 buy signals.The first is opened without problems, the second is opened twice, but the third and fourth RSI signals are not opened.
Today I can't load the expert. What happen? -
@joe_fx This is likely because of the 3rd buy/sell tree, probably opening when no need to? put the 2nd and 3rd tree together, this way logically thinking EA can only open trades when conditions are met. If you still struggle put the latest project shared link here and I'll have a look.
-
@jstap https://fxdreema.com/shared/dkw4gU3oe
Unfortunately it doesn't work. I don't understand how to continue. -
-
@jstap I'm sorry but being a beginner I don't understand what you mean, I don't know how to move. Still, I think it is a simple EA, but it is becoming something, for me at least, impossible. I'd like to read a guide, because the examples on the site don't help me.
-
@joe_fx I agree that information on what to di id hard to find, the link above will give you the EA I changed, if you press the MQ button then import back into FX you will get the project, you can then make changes, test on back test until you get enough condition counts to be happy, then you can add in the rest of the desired positions.
-
@jstap Hello. thank you for the help but i don't understand how to solve the problem starting from your ea. So, I decided to start from the beginning. EA opens a first buy order and I put a stop at level 40, to understand if closing the order could open a subsequent buy order. Indeed, the second order is opened but continuously. How can this situation be resolved? can you make me understand why the first order does not open the buy order continuously, while the following one does?
In your opinion, does it take a for loop? -
@l-andorrà said in how to open multiple orders in my EA?:
You need to be more specific when defining the meaning of 'returns to level...', because that can happen several times per minute ir RSi is hitting that level. It can move up and down many times within that same candle.
I mean at the close of the candle. If RSI crossover above level 25, for example, open buy, with TP: 100 and SL: 100. If it does not reach the TP or SL and RSI crossover above level 25 again, open another order with TP: 100 and SL: 100, keeping the previous one open, and so on. I hope I was helpful.
-
-
@jstap I made some changes and now EA works, but I have an initial problem. The first order is always opened twice, it also happens in the SELL phase. I tried to solve with a variable, like you did, but it doesn't work. Where am I wrong?
https://fxdreema.com/shared/mLySbtime -
@joe_fx Your second tree is true on the same candle, you need a condition to separate where trades are being placed, the ea works in fractions of a second, once 1st trade is placed it places the second because the conditions are true..
You do not need ==true because this is already in the block.
-
I still haven't been able to figure out how to fix my problem. Please, is there anyone who can fix it?

