75 lines
2.7 KiB
MQL5
75 lines
2.7 KiB
MQL5
|
//+------------------------------------------------------------------+
|
||
|
//| EA-TM.mq5 |
|
||
|
//| Thorsten Fischer Copyright 2020 |
|
||
|
//| https://mql5.tfsystem.de |
|
||
|
//+------------------------------------------------------------------+
|
||
|
#property copyright "Thorsten Fischer Copyright 2020"
|
||
|
#property link "https://mql5.tfsystem.de"
|
||
|
#property version "1.00"
|
||
|
#property strict
|
||
|
#property description "Trademanager V2"
|
||
|
|
||
|
//---
|
||
|
#include "TradingManager.mqh"
|
||
|
|
||
|
//---
|
||
|
CTradingManager g_tm;
|
||
|
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Expert initialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
int OnInit()
|
||
|
{
|
||
|
//---
|
||
|
if(!g_tm.OnInitEvent())
|
||
|
return(INIT_FAILED);
|
||
|
//---
|
||
|
return(INIT_SUCCEEDED);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Expert deinitialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnDeinit(const int reason)
|
||
|
{
|
||
|
//---
|
||
|
g_tm.OnDeInitEvent(reason);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Expert tick function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnTick()
|
||
|
{
|
||
|
//---
|
||
|
g_tm.OnTickEvent();
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Trade function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnTrade()
|
||
|
{
|
||
|
//---
|
||
|
g_tm.OnTradeEvent();
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| TradeTransaction function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnTradeTransaction(const MqlTradeTransaction& trans,
|
||
|
const MqlTradeRequest& request,
|
||
|
const MqlTradeResult& result)
|
||
|
{
|
||
|
//---
|
||
|
g_tm.OnTradeTransactionEvent(trans, request, result);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| ChartEvent function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnChartEvent(const int id,
|
||
|
const long &lparam,
|
||
|
const double &dparam,
|
||
|
const string &sparam)
|
||
|
{
|
||
|
//---
|
||
|
g_tm.ChartEvent(id, lparam, dparam, sparam);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|