Close EA after trade
-
Basically I am trying to create an EA that buys/sells(depending on what i pick) at a specific time during the day. Once the time comes and the trade is initiated the EA should close or at the very least not take any trade till I activate it. The problem I am running into is that it will eventually open trades as time goes on. I left the AE on overnight and it opened more than 1000 trades. Need some help or advice.
-
Could you please share your current project to take a look on it?
-
@mannybear1 Should it open only at a specific time each day automatically or do you pick by yourself which trade to take and let it manage your trade (fully automated vs semi-automated).
If it should run fully automated, you can use time filters

and in addition maybe the turn ON/OFF blocks or a combination of both.

If you want a semi-automated you may prompt for useraction before opening a trade or have a button on the chart to open an order.
As @l-andorrà said, it may be helpful if you'd have a concrete project to share and to discuss about.
-

-
@trader-philipps I'm trying to make it automatic except fpr TP and SL. I've done the time filter and the block commends but doesn't seem to work fully.
-
@mannybear1 If you might share the project I may have a closer look. But from principle fxdreema works from lowest to highest ID. In your exapmle you switch off Some block (can't see) and switch some block on on the next tick.
-
@Mannybear1 , I'd start something like this ...

-
this is a complete setting for my project. And really appreciate the help and feedback
-
Your 'Modify variables' block is empty. You need a variable to be modified there. Now nothing happens and that stops the EA right there.
-
@mannybear1 What is not working?
@l-andorrà I think the empty variable block shouldn't stop the EA there. I'd rather guess not specifying a lot size (How much ... in Buy now) at least will make the buy orders not happen.
@Mannybear1 Do you see any errors when you let the EA run in the logs? -
@trader-philipps what doesnt seem to work is when i put the block orders. I thought that at the end as soon as the trade is executed the block is supposed to turn off. But even if the trade is active it would still open a couple more. I tested your EA and it works perfectly actually. What does PASS do
-
Could you please share the link instead of just a screenshot?
-
@mannybear1 PASS is like a sub-routine. I use it as a starting point. Depending on the block number it will be executed befor or after other starting or solo blocks. It helps to do certain calculations or condition checks that other blocks may use.
For instance I made 1 block for controling the trading time. This blocks activates the "order open block" If condition is met.
