How to check the last closed trade is closed by Stop loss?
-
I want to check the last closed trade is closed by stoploss or not. But even though there is a trade closed by Stop loss, its not getting triggered. What I am doing wrong here?
Note: Please help me, I am not able to use any of the pink looping section. It doesn't do what it intended to do. Is there something am I missing while using or is it a bug?

-
Hi san,
Can you try "Trade Closed" blok "ON TRADE EVENT" section. You can find what you are looking for.
Nice Day.
-
@casper Thanx. But that is not what I want. I want to check the last closed trade was it closed by Stop loss... Also I don't think these pink blocks are working and I am trying to use things like For each pending order, normal for each and other things nothing seems to be working. This is the first time I am using these blocks. Am I missing something here?
-
https://fxdreema.com/forum/topic/4246/example-for-each-trade
This link is very useful and provided by great coder miro. I hope so I helped to you.
-
Hello San,
I have the same problem. Is it working for you now?
Iam using:
"for each closed trade" and "how it was closed" but I dont get back a result.
Best regards,
Martin -
@casper Thanks for sharing
@miro1360 Could you please help me to understand this?@martin-1 Nope
I have put this simple flow.
for each close trade newest to oldest and all options are empty and connected to the modify variable which does +1 and added an Alert to this variable.
I have many closed trades. But it always shows 2 alerts with value 2. I am expecting it to hit the alert with values incrementing each time for each closed trade.
Eg: My expectation is If 10 closed trades - then 10 hits with value 1,2...10 for each alert.
Not able to understand why these pink blocks are so difficult to understand or use.
-
I tried this https://fxdreema.com/shared/EarAHn7E
And it works for me. I can choose to Buy or Sell in "on Init", so this way I can change the way the trade is closed. For me if it's a Buy trade, it is closed by SL and I see the comment meessage. Or if it is a Sell trade, it is closed by TP and I don't see the comment.
Can you give me similar example (I prefer simple example) that shows the problem?
-
@fxdreema Sorry to dig this topic up but this is the one I used for reference.
I open 3 positions, EA is supposed to check if they are closed by SL, TP or Break Even for each (divided by groups).
1st group doesn't work properly, 2 & 3 seems to work fine.
I tried changing the group number and I noticed that it seems to be always the first opened position to cause this issue.
Please enlight me, it's been 4 days that I try to achieve "just" this.
-
@jerkha do you have a project to share, so we can have a look at it?
-
@jerkha You already created a thread to ask exactly that. Please focus on that thread only.