forked from Csiya/MQL5
//+------------------------------------------------------------------+
| |
//| 9.Event_Handling.mq5 |
| |
//| Author: Santiago Cruz |
| |
//| https://www.mql5.com/en/users/algo-trader/ |
| |
//+------------------------------------------------------------------+
| |
#property copyright "Santiago Cruz"
| |
#property link "https://www.mql5.com/en/users/algo-trader/"
| |
#property version "1.00"
| |
//+------------------------------------------------------------------+
| |
//| Expert initialization function |
| |
//+------------------------------------------------------------------+
| |
int OnInit()
| |
{
| |
//--- create timer
| |
EventSetTimer(60);
| |
| |
//---
| |
return(INIT_SUCCEEDED);
| |
}
| |
//+------------------------------------------------------------------+
| |
//| Expert deinitialization function |
| |
//+------------------------------------------------------------------+
| |
void OnDeinit(const int reason)
| |
{
| |
//--- destroy timer
| |
EventKillTimer();
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| Expert tick function |
| |
//+------------------------------------------------------------------+
| |
void OnTick()
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| Timer function |
| |
//+------------------------------------------------------------------+
| |
void OnTimer()
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| Trade function |
| |
//+------------------------------------------------------------------+
| |
void OnTrade()
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| TradeTransaction function |
| |
//+------------------------------------------------------------------+
| |
void OnTradeTransaction(const MqlTradeTransaction& trans,
| |
const MqlTradeRequest& request,
| |
const MqlTradeResult& result)
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| Tester function |
| |
//+------------------------------------------------------------------+
| |
double OnTester()
| |
{
| |
//---
| |
double ret=0.0;
| |
//---
| |
| |
//---
| |
return(ret);
| |
}
| |
//+------------------------------------------------------------------+
| |
//| TesterInit function |
| |
//+------------------------------------------------------------------+
| |
void OnTesterInit()
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| TesterPass function |
| |
//+------------------------------------------------------------------+
| |
void OnTesterPass()
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| TesterDeinit function |
| |
//+------------------------------------------------------------------+
| |
void OnTesterDeinit()
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| ChartEvent function |
| |
//+------------------------------------------------------------------+
| |
void OnChartEvent(const int id,
| |
const long &lparam,
| |
const double &dparam,
| |
const string &sparam)
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
| |
//| BookEvent function |
| |
//+------------------------------------------------------------------+
| |
void OnBookEvent(const string &symbol)
| |
{
| |
//---
| |
| |
}
| |
//+------------------------------------------------------------------+
|