157 lines
12 KiB
MQL5
157 lines
12 KiB
MQL5
//+------------------------------------------------------------------+
|
|
//| TMModule.mqh |
|
|
//| Thorsten Fischer Copyright 2019-2020 |
|
|
//| https://mql5.tfsystem.de |
|
|
//+------------------------------------------------------------------+
|
|
#property copyright "Thorsten Fischer Copyright 2019-2020"
|
|
#property link "https://mql5.tfsystem.de"
|
|
#property version "1.00"
|
|
#include "TMGUI.mqh"
|
|
#include "..\..\TF-Dateien\TF-Class\TFModule.mqh"
|
|
//---
|
|
input string i_SymbolName="DE30.c";
|
|
input double i_Price=12000.0;
|
|
input double i_Volume=0.1;
|
|
input double i_SL=20.0;
|
|
input double i_TP=26.0;
|
|
input bool i_Long=false;
|
|
input bool i_Short=false;
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
class CTMModule : public CTFObject
|
|
{
|
|
private:
|
|
|
|
|
|
//CTFModule m_MoneyManagement;
|
|
//CTFModule m_AuswahlStrategie;
|
|
//CTFModule m_NicoStrategie;
|
|
public:
|
|
CTMModule();
|
|
~CTMModule();
|
|
bool init(void);
|
|
virtual void DeInitEvent(const int aReason=0);
|
|
virtual void ChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam);
|
|
string GetComment(void);
|
|
string GetSymbolName(void);
|
|
double GetPrice(void);
|
|
double GetVolume(void);
|
|
double GetSL(void);
|
|
double GetTP(void);
|
|
bool GetLong(void);
|
|
bool GetShort(void);
|
|
};
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
CTMModule::CTMModule() : m_comment(""),
|
|
m_symbol_name(""),
|
|
m_price(0.0),
|
|
m_volume(0.0),
|
|
m_sl(0.0),
|
|
m_tp(0.0),
|
|
m_long(false),
|
|
m_short(false)
|
|
{
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
CTMModule::~CTMModule()
|
|
{
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
bool CTMModule::init(void)
|
|
{
|
|
if(!m_tmgui.init()) return(false);
|
|
//Print(__FUNCTION__+" Status = "+(string)m_MoneyManagement.Status());
|
|
//if(!m_MoneyManagement.init("I-Modul-MM\\I-MM-V0")) return(false);
|
|
//if(!m_AuswahlStrategie.init("I-Modul-Auswahl-Strategie\\I-Auswahl-Strategie-V0")) return(false);
|
|
//if(!m_NicoStrategie.init("I-Modul-Strategien\\I-S-Nico-V0")) return(false);
|
|
//Print(__FUNCTION__+" Status = "+(string)m_MoneyManagement.Status());
|
|
m_symbol_name=i_SymbolName;
|
|
m_price=i_Price;
|
|
m_volume=i_Volume;
|
|
m_sl=i_SL;
|
|
m_tp=i_TP;
|
|
m_long=i_Long;
|
|
m_short=i_Short;
|
|
return(true);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
void CTMModule::DeInitEvent(const int aReason=0)
|
|
{
|
|
m_tmgui.DeInitEvent(aReason);
|
|
//m_MoneyManagement.Delete(aReason);
|
|
//m_AuswahlStrategie.Destroy(aReason);
|
|
//m_NicoStrategie.Destroy(aReason);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
void CTMModule::ChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
|
|
{
|
|
m_tmgui.ChartEvent(id,lparam,dparam,sparam);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
string CTMModule::GetComment(void)
|
|
{
|
|
return(m_comment);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
string CTMModule::GetSymbolName(void)
|
|
{
|
|
return(m_symbol_name);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
double CTMModule::GetPrice(void)
|
|
{
|
|
return(m_price);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
double CTMModule::GetVolume(void)
|
|
{
|
|
return(m_volume);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
double CTMModule::GetSL(void)
|
|
{
|
|
return(m_sl);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
double CTMModule::GetTP(void)
|
|
{
|
|
return(m_tp);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
bool CTMModule::GetLong(void)
|
|
{
|
|
return(m_long);
|
|
}
|
|
//+------------------------------------------------------------------+
|
|
//| |
|
|
//+------------------------------------------------------------------+
|
|
bool CTMModule::GetShort(void)
|
|
{
|
|
return(m_short);
|
|
}
|
|
//+------------------------------------------------------------------+
|