Standard way to detect stop loss transaction executed on a position. - page 2

 
Vladimir Karputov #:

You are performing this function with an error. You are requesting trade history incorrectly. And most importantly - you do not need an action. You need to request ONE deal.

Thanks Vladimir!

I try to change my code maybe use other solution. In fact I create offline database to manage my position and money managment cause i need to know when real stoploss occurred to update database. I think detect Syncron Real Stoplosses in MQL5 is a big Challenge.

 
MRM_Programmer # :

Thanks Vladimir!

I try to change my code maybe use other solution. In fact I create offline database to manage my position and money managment cause i need to know when real stoploss occurred to update database. I think detect Syncron Real Stoplosses in MQL5 is a big Challenge.

You can create any base - but in OnTradeTransaction you have to copy ONLY ONE TRANSACTION!

And one more thing: there is no problem to catch transactions if Stop Loss or Take Profit is triggered.

Example: tracking the triggering of Stop Loss or Take Profit

How to start with MQL5
How to start with MQL5
  • 2020.09.17
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...