mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-07-28 11:07:48 +00:00
Changed algorithm to execute commands in mql expert: used function OnTimer instead OnTick
This commit is contained in:
@@ -9,16 +9,18 @@ using namespace MTApiService;
|
||||
ref class MT4Handler: IMetaTraderHandler
|
||||
{
|
||||
public:
|
||||
MT4Handler()
|
||||
{
|
||||
msgId = RegisterWindowMessage("MetaTrader4_Internal_Message");
|
||||
}
|
||||
MT4Handler()
|
||||
{
|
||||
//msgId = RegisterWindowMessage("MetaTrader4_Internal_Message");
|
||||
msgId = WM_TIMER;
|
||||
}
|
||||
|
||||
virtual void SendTickToMetaTrader(int handle)
|
||||
{
|
||||
PostMessage((HWND)handle, msgId, 2, 1);
|
||||
}
|
||||
virtual void SendTickToMetaTrader(int handle)
|
||||
{
|
||||
//PostMessage((HWND)handle, msgId, 2, 1);
|
||||
PostMessage((HWND)handle, msgId, 0, 0);
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned int msgId;
|
||||
unsigned int msgId;
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace TestApiClientUI
|
||||
comboBox2.SelectedIndex = 0;
|
||||
|
||||
_timerTradeMonitor = new TimerTradeMonitor(_apiClient);
|
||||
_timerTradeMonitor.Interval = 1000; // 1 sec
|
||||
_timerTradeMonitor.Interval = 10000; // 10 sec
|
||||
_timerTradeMonitor.AvailabilityOrdersChanged += _tradeMonitor_AvailabilityOrdersChanged;
|
||||
|
||||
_timeframeTradeMonitor = new TimeframeTradeMonitor(_apiClient);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user