51 lines
4.0 KiB
Plaintext
51 lines
4.0 KiB
Plaintext
|
|
//+------------------------------------------------------------------+
|
||
|
|
//| Expert.mq5 |
|
||
|
|
//| Copyright 2015, Vasiliy Sokolov. |
|
||
|
|
//| http://www.mql5.com |
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
#property copyright "Copyright 2015, Vasiliy Sokolov."
|
||
|
|
#property link "http://www.mql5.com"
|
||
|
|
#property version "1.00"
|
||
|
|
#include "Strategy.mqh"
|
||
|
|
|
||
|
|
CStrategy Agent;
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
//| Expert initialization function |
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
int OnInit()
|
||
|
|
{
|
||
|
|
EventSetTimer(5);
|
||
|
|
MarketBookAdd(Symbol());
|
||
|
|
MarketBookAdd("Si-12.15");
|
||
|
|
return(INIT_SUCCEEDED);
|
||
|
|
}
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
//| Expert deinitialization function |
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
void OnDeinit(const int reason)
|
||
|
|
{
|
||
|
|
EventKillTimer();
|
||
|
|
}
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
//| Expert tick function |
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
void OnTick()
|
||
|
|
{
|
||
|
|
Agent.OnTick();
|
||
|
|
}
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
//| Timer function |
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
void OnTimer()
|
||
|
|
{
|
||
|
|
Agent.OnTimer();
|
||
|
|
}
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
//| BookEvent function |
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
void OnBookEvent(const string &symbol)
|
||
|
|
{
|
||
|
|
Agent.OnBookEvent(symbol);
|
||
|
|
}
|
||
|
|
//+------------------------------------------------------------------+
|
||
|
|
�
|