Download MetaTrader 5

how can i know one position touched stoplose & takeprofit

To add comments, please log in or register
xuzhe
100
xuzhe  

i want to deal something when position touched stoplose and takeprofit?

 

I want a function occurs only when stoplose and takeprofit was trigged,Do i need OnTrade() event or OnTradeTransaction() Event()?

 

Thx a lot 

Ubzen
5394
Ubzen  
xuzhe: I want a function occurs only when stoplose and takeprofit was trigged,Do i need OnTrade() event or OnTradeTransaction() Event()?

You can use any of the above Event.

https://www.mql5.com/en/docs/basis/function/events#ontrade.

Documentation on MQL5: Language Basics / Functions / Event Handling Functions
Documentation on MQL5: Language Basics / Functions / Event Handling Functions
  • www.mql5.com
Language Basics / Functions / Event Handling Functions - Documentation on MQL5
Alain Verleyen
Moderator
31204
Alain Verleyen  
xuzhe:

i want to deal something when position touched stoplose and takeprofit?

 

I want a function occurs only when stoplose and takeprofit was trigged,Do i need OnTrade() event or OnTradeTransaction() Event()?

 

Thx a lot 

As an example, see this topic Detect stop trigger in OnTradeTransaction backtest

To add comments, please log in or register