Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

MQL4 OnTrade() Alternatives - MetaTrader 4 Expert - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

MQL4 OnTrade() Alternative - expert for MetaTrader 4

MQL4 OnTrade() Alternative - expert for MetaTrader 4

While discovering MQL4 I found very useful the new build (610) feature Online Trading () highlighted in MetaEditor.

I clicked F1 to see its implementation, but unfortunately MQL4 does not support it yet.

That's why I created my own emulator.

This code will raise events for the following situations:

On Open : When a new instant order is opened.

When modified : When the order is modified.

Stop Loss : When an order is closed due to Stop Loss.

Take Profit : When an order is closed due to profit.

On Close : When the order is closed (not Stop Loss or Take Profit).

Please test it out and tell me your opinion.


Attachment download

📎 Simulator.mq4 (27.29 KB)

Source: MQL5 #11127

MQL4 OnTrade() Alternatives - MetaTrader 4 Expert Usage and Filtering Advice

MQL4 OnTrade() Alternative - MetaTrader 4 Expert belongs to MT4 EA related resources. Before downloading or referencing, it is recommended to confirm the platform version, transaction type, time period, whether DLL is required, whether source code is included, parameter description and historical update records.

Both automated trading tools and foreign exchange indicators should first undergo backtesting, simulated account observation, and small capital verification. Pay special attention to spreads, slippages, maximum drawdowns, position opening frequency, stop loss methods, trading periods and broker rules, and avoid direct real-time execution based on titles or short-term profit descriptions.

Verification code Refresh