The Expert Advisor analyzes the last 'N-seconds ago' seconds and compares with the current price.
The Expert Advisor monitors triggering of Stop Loss and Take Profit by using the excellent enumeration ENUM_DEAL_REASON:
|DEAL_REASON_SL||The deal was executed as a result of Stop Loss activation|
|DEAL_REASON_TP||The deal was executed as a result of Take Profit activation|
If Stop Loss has triggered, the lot of the next position will be increased in accordance with the 'Coefficient, if the stop-loss is triggered' parameter.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/19218
Works with pending stop orders (Buy Stop and Sell Stop). Monitors spread %.Locker
The EA lock positions.