Simple question
-
Hi guys, i have a question. I am sure there is a simple answer, but i don't seem to find the solution.. I want to make my ea stop taking trades in a certain direction after that direction has taken a loss, then it can only look for oppurtunities in the other direction.
Example: EA takes a buy trade , trade results in TP. Nothing changes, EA look for trades in both directions. Next trade is buy trade again, this time it results in SL. Now i want my EA to not take buy trades anymore UNTILL there is a sell signal, then it can take it. If the signall sell is a loss, i want my ea to not take sell trades anymore untill it has taken a buy trade. And so on. Thanks alot in advance!
-
@yyaanniicckk That's not a simple question to answer.
You need a variable to store the information of what happened with the last closed trade. That variable should be then be combined with your launching structure in order to identify when a new buy or sell is ready. It clearly depends on your currenty structure. -
@l-andorrà thanks for the answer I thought it would be easier haha, will try to figure out something. I may have another solution to this that could make it easier to put in my ea: When the current trade is in a loss, don't open new trade from that group.
Maybe with check profit of current active trades of the groups i work with ? and then an if trade block ?
-
Hi @YYAANNIICCKK. I think you might want to try using trendline as a filter to open buy/sell.
-
@yyaanniicckk Yes, you can create a boolean variable (true/false) and do this for all trades belonging to group1, for example:

Then you need to use a condition block in your group 1 launching block tree so that:

Obviously, dependingon your current structure you will need to reinitiate the variable when required.
-
Yes Thanks, will try it out!