Download MetaTrader 5

Communicating with MT5 with external app

To add comments, please log in or register
olddirtypipster
27
olddirtypipster  
Is there a way to communicate with MT5 with an external application? For example, I would like to command MT5 to close a trade via an external application. I was thinking of getting the chart window handle and then use this window handle to do a SendMessage(hWnd...) or PostMessage(hWnd...) to the chart window via the external app. But is there a better way? One would have thought the MT5 has built in event polling capabilities, but I haven't seen these. Any novel ideas? Thanks.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Chart Constants / Chart Properties - Documentation on MQL5
Ahmed Soliman
16586
Ahmed Soliman  

Your approach is not bad.

Another aporoach to write to registery from your appication and make an EA that reads the registry.

phi nuts
2181
phi nuts  
olddirtypipster:
Is there a way to communicate with MT5 with an external application? For example, I would like to command MT5 to close a trade via an external application. I was thinking of getting the chart window handle and then use this window handle to do a SendMessage(hWnd...) or PostMessage(hWnd...) to the chart window via the external app. But is there a better way? One would have thought the MT5 has built in event polling capabilities, but I haven't seen these. Any novel ideas? Thanks.

Better way ? using WinAPI like that (PostMessage... SendMessage) is better than other method.

OnTimer event calling .dll or some file in each second, could be an alternative.

To add comments, please log in or register