Работа форекс робота по таймеру
Работа робота по таймеру снимает проблему лага синхронизации событий прихода новых тиков с серверов брокера при мультивалютной торговле(работе корзинами ордеров в моём случае)
MQL4++
//Example of using Timer processing logic
//Global vars
extern int OnTimerProcessing=0;
int OnInit(){ //Bot Initialization
if(OnTimerProcessing>0)EventSetMillisecondTimer(OnTimerProcessing);//activation timer func for basket trading
…
}
void OnDeinit(const int reason){ //Deinitialization all parameters and functions
EventKillTimer(); //deinit timer
…
}
void OnTimer(){ //Timer function calls OnTick main calculations
OnTick();
}
Всем добра!!