808 lines
30 KiB
MQL5
808 lines
30 KiB
MQL5
|
//+------------------------------------------------------------------+
|
||
|
//| TMDialog.mqh |
|
||
|
//| 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
|
||
|
//---
|
||
|
#include <Controls\Dialog.mqh>
|
||
|
#include <Controls\CheckBox.mqh>
|
||
|
#include "..\..\TF-Dateien\TF-Class\TFTrade.mqh"
|
||
|
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| defines |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//--- indents and gaps
|
||
|
#define INDENT_LEFT (5) // indent from left (with allowance for border width)
|
||
|
#define INDENT_TOP (5) // indent from top (with allowance for border width)
|
||
|
#define INDENT_RIGHT (5) // indent from right (with allowance for border width)
|
||
|
#define INDENT_BOTTOM (5) // indent from bottom (with allowance for border width)
|
||
|
#define CONTROLS_GAP_X (5) // gap by X coordinate
|
||
|
#define CONTROLS_GAP_Y (5) // gap by Y coordinate
|
||
|
//--- for buttons
|
||
|
#define BUTTON_WIDTH (100) // size by X coordinate
|
||
|
#define BUTTON_HEIGHT (20) // size by Y coordinate
|
||
|
//--- for the indication area
|
||
|
#define EDIT_HEIGHT (20) // size by Y coordinate
|
||
|
//--- for checkbox
|
||
|
#define CHECK_WIDTH (180) // size by x coordinate
|
||
|
#define CHECK_HEIGHT (20) // size by Y coordinate
|
||
|
//--- for group controls
|
||
|
#define GROUP_CONTROLS_GAP_Y (0) // gap by Y coordinate
|
||
|
#define GROUP_WIDTH (150) // size by X coordinate
|
||
|
#define LIST_HEIGHT (179) // size by Y coordinate
|
||
|
#define RADIO_HEIGHT (56) // size by Y coordinate
|
||
|
#define GROUP_CHECK_HEIGHT (93) // size by Y coordinate
|
||
|
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
class CTMDialog : public CAppDialog
|
||
|
{
|
||
|
private:
|
||
|
//CEdit m_edit;
|
||
|
//CButton m_button1;
|
||
|
//CButton m_button2;
|
||
|
//CButton m_button3;
|
||
|
//CEdit m_lots;
|
||
|
CCheckBox m_check_autotrading;
|
||
|
CCheckBox m_check_standort;
|
||
|
CCheckBox m_check_system;
|
||
|
CCheckBox m_check_terminal;
|
||
|
CCheckBox m_check_account;
|
||
|
CCheckBox m_check_symbol;
|
||
|
CCheckBox m_check_strategie_open;
|
||
|
CCheckBox m_check_strategie_close;
|
||
|
CCheckBox m_check_mm;
|
||
|
CCheckBox m_check_chart;
|
||
|
CCheckBox m_check_history;
|
||
|
CCheckBox m_check_order;
|
||
|
CCheckBox m_check_position;
|
||
|
CCheckBox m_check_deal;
|
||
|
CTFTrade *m_trade;
|
||
|
|
||
|
public:
|
||
|
CTMDialog();
|
||
|
~CTMDialog();
|
||
|
//---
|
||
|
virtual bool Init(CTFTrade *aTrade=NULL);
|
||
|
virtual void DeInit(const int aReason=0);
|
||
|
virtual bool Create(const long chart,const string name,const int subwin,const int x1,const int y1,const int x2,const int y2);
|
||
|
//virtual void Destroy(const int aReason=0);
|
||
|
virtual bool OnEvent(const int id,const long &lparam,const double &dparam,const string &sparam);
|
||
|
|
||
|
protected:
|
||
|
bool IsAutoTrading(void)
|
||
|
{
|
||
|
return(m_trade.IsAutoTrading());
|
||
|
}
|
||
|
//bool CreateEdit(void);
|
||
|
//bool CreateButton1(void);
|
||
|
//bool CreateButton2(void);
|
||
|
//bool CreateButton3(void);
|
||
|
//bool CreateLots(void);
|
||
|
bool CreateCheckAutoTrading(void);
|
||
|
bool CreateCheckStandort(void);
|
||
|
bool CreateCheckSystem(void);
|
||
|
bool CreateCheckTerminal(void);
|
||
|
bool CreateCheckAccount(void);
|
||
|
bool CreateCheckSymbol(void);
|
||
|
bool CreateCheckStrategieOpen(void);
|
||
|
bool CreateCheckStrategieClose(void);
|
||
|
bool CreateCheckMM(void);
|
||
|
bool CreateCheckChart(void);
|
||
|
bool CreateCheckHistory(void);
|
||
|
bool CreateCheckOrder(void);
|
||
|
bool CreateCheckPosition(void);
|
||
|
bool CreateCheckDeal(void);
|
||
|
|
||
|
//--- handlers of the dependent controls events
|
||
|
//void OnClickButton1(void);
|
||
|
//void OnClickButton2(void);
|
||
|
//void OnClickButton3(void);
|
||
|
void OnChangeAutoTrading(void);
|
||
|
void OnChangeStandort(void);
|
||
|
void OnChangeSystem(void);
|
||
|
void OnChangeTerminal(void);
|
||
|
void OnChangeAccount(void);
|
||
|
void OnChangeSymbol(void);
|
||
|
void OnChangeStrategieOpen(void);
|
||
|
void OnChangeStrategieClose(void);
|
||
|
void OnChangeMM(void);
|
||
|
void OnChangeChart(void);
|
||
|
void OnChangeHistory(void);
|
||
|
void OnChangeOrder(void);
|
||
|
void OnChangePosition(void);
|
||
|
void OnChangeDeal(void);
|
||
|
|
||
|
};
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event Handling |
|
||
|
//+------------------------------------------------------------------+
|
||
|
EVENT_MAP_BEGIN(CTMDialog)
|
||
|
//ON_EVENT(ON_CLICK,m_button1,OnClickButton1)
|
||
|
//ON_EVENT(ON_CLICK,m_button2,OnClickButton2)
|
||
|
//ON_EVENT(ON_CLICK,m_button3,OnClickButton3)
|
||
|
ON_EVENT(ON_CHANGE,m_check_autotrading,OnChangeAutoTrading)
|
||
|
ON_EVENT(ON_CHANGE,m_check_standort,OnChangeStandort)
|
||
|
ON_EVENT(ON_CHANGE,m_check_system,OnChangeSystem)
|
||
|
ON_EVENT(ON_CHANGE,m_check_terminal,OnChangeTerminal)
|
||
|
ON_EVENT(ON_CHANGE,m_check_account,OnChangeAccount)
|
||
|
ON_EVENT(ON_CHANGE,m_check_symbol,OnChangeSymbol)
|
||
|
ON_EVENT(ON_CHANGE,m_check_strategie_open,OnChangeStrategieOpen)
|
||
|
ON_EVENT(ON_CHANGE,m_check_strategie_close,OnChangeStrategieClose)
|
||
|
ON_EVENT(ON_CHANGE,m_check_mm,OnChangeMM)
|
||
|
ON_EVENT(ON_CHANGE,m_check_chart,OnChangeChart)
|
||
|
ON_EVENT(ON_CHANGE,m_check_history,OnChangeHistory)
|
||
|
ON_EVENT(ON_CHANGE,m_check_order,OnChangeOrder)
|
||
|
ON_EVENT(ON_CHANGE,m_check_position,OnChangePosition)
|
||
|
ON_EVENT(ON_CHANGE,m_check_deal,OnChangeDeal)
|
||
|
EVENT_MAP_END(CAppDialog)
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
CTMDialog::CTMDialog() //: m_trade_dialog(NULL)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
CTMDialog::~CTMDialog()
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::Init(CTFTrade *aTrade=NULL)
|
||
|
{
|
||
|
//---
|
||
|
// if(m_trade_dialog!=NULL)
|
||
|
// {
|
||
|
// delete m_trade_dialog;
|
||
|
// m_trade_dialog=NULL;
|
||
|
// }
|
||
|
////---
|
||
|
if(aTrade!=NULL)
|
||
|
m_trade=aTrade;
|
||
|
//---
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::DeInit(const int aReason=0)
|
||
|
{
|
||
|
//if(m_trade_dialog!=NULL)
|
||
|
// m_trade_dialog=NULL;
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::Create(const long chart,const string name,const int subwin,const int x1,const int y1,const int x2,const int y2)
|
||
|
{
|
||
|
if(!CAppDialog::Create(chart,name,subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
//--- create dependent controls
|
||
|
//if(!CreateEdit())
|
||
|
// return(false);
|
||
|
//if(!CreateButton1())
|
||
|
// return(false);
|
||
|
//if(!CreateButton2())
|
||
|
// return(false);
|
||
|
//if(!CreateButton3())
|
||
|
// return(false);
|
||
|
//if(!CreateLots())
|
||
|
// return(false);
|
||
|
if(!CreateCheckAutoTrading())
|
||
|
return(false);
|
||
|
if(!CreateCheckStandort())
|
||
|
return(false);
|
||
|
if(!CreateCheckSystem())
|
||
|
return(false);
|
||
|
if(!CreateCheckTerminal())
|
||
|
return(false);
|
||
|
if(!CreateCheckAccount())
|
||
|
return(false);
|
||
|
if(!CreateCheckSymbol())
|
||
|
return(false);
|
||
|
if(!CreateCheckStrategieOpen())
|
||
|
return(false);
|
||
|
if(!CreateCheckStrategieClose())
|
||
|
return(false);
|
||
|
if(!CreateCheckMM())
|
||
|
return(false);
|
||
|
if(!CreateCheckChart())
|
||
|
return(false);
|
||
|
if(!CreateCheckHistory())
|
||
|
return(false);
|
||
|
if(!CreateCheckOrder())
|
||
|
return(false);
|
||
|
if(!CreateCheckPosition())
|
||
|
return(false);
|
||
|
if(!CreateCheckDeal())
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//void CTMDialog::Destroy(const int aReason=0)
|
||
|
//{
|
||
|
////---
|
||
|
// CAppDialog::Destroy(aReason);
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Create the display field |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//bool CTMDialog::CreateEdit(void)
|
||
|
//{
|
||
|
////--- coordinates
|
||
|
// int x1=INDENT_LEFT;
|
||
|
// int y1=INDENT_TOP;
|
||
|
// int x2=ClientAreaWidth()-INDENT_RIGHT;
|
||
|
// int y2=y1+EDIT_HEIGHT;
|
||
|
////--- create
|
||
|
// if(!m_edit.Create(m_chart_id,m_name+"Edit",m_subwin,x1,y1,x2,y2))
|
||
|
// return(false);
|
||
|
// if(!m_edit.ReadOnly(true))
|
||
|
// return(false);
|
||
|
// if(!Add(m_edit))
|
||
|
// return(false);
|
||
|
////--- succeed
|
||
|
// return(true);
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Create the "Button1" button |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//bool CTMDialog::CreateButton1(void)
|
||
|
//{
|
||
|
////--- coordinates
|
||
|
// int x1=INDENT_LEFT;
|
||
|
// int y1=INDENT_TOP+(EDIT_HEIGHT+CONTROLS_GAP_Y)*2;
|
||
|
// int x2=x1+BUTTON_WIDTH;
|
||
|
// int y2=y1+BUTTON_HEIGHT;
|
||
|
////--- create
|
||
|
// if(!m_button1.Create(m_chart_id,m_name+"Button1",m_subwin,x1,y1,x2,y2))
|
||
|
// return(false);
|
||
|
// if(!m_button1.Text("Long"))
|
||
|
// return(false);
|
||
|
// if(!Add(m_button1))
|
||
|
// return(false);
|
||
|
////--- succeed
|
||
|
// return(true);
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Create the "Button2" button |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//bool CTMDialog::CreateButton2(void)
|
||
|
//{
|
||
|
////--- coordinates
|
||
|
// int x1=INDENT_LEFT+(BUTTON_WIDTH+CONTROLS_GAP_X);
|
||
|
// int y1=INDENT_TOP+(EDIT_HEIGHT+CONTROLS_GAP_Y)*2;
|
||
|
// int x2=x1+BUTTON_WIDTH;
|
||
|
// int y2=y1+BUTTON_HEIGHT;
|
||
|
////--- create
|
||
|
// if(!m_button2.Create(m_chart_id,m_name+"Button2",m_subwin,x1,y1,x2,y2))
|
||
|
// return(false);
|
||
|
// if(!m_button2.Text("Short"))
|
||
|
// return(false);
|
||
|
// if(!Add(m_button2))
|
||
|
// return(false);
|
||
|
////--- succeed
|
||
|
// return(true);
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Create the "Button3" fixed button |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//bool CTMDialog::CreateButton3(void)
|
||
|
//{
|
||
|
////--- coordinates
|
||
|
// int x1=INDENT_LEFT+2*(BUTTON_WIDTH+CONTROLS_GAP_X);
|
||
|
// int y1=INDENT_TOP+(EDIT_HEIGHT+CONTROLS_GAP_Y)*2;
|
||
|
// int x2=x1+BUTTON_WIDTH;
|
||
|
// int y2=y1+BUTTON_HEIGHT;
|
||
|
////--- create
|
||
|
// if(!m_button3.Create(m_chart_id,m_name+"Button3",m_subwin,x1,y1,x2,y2))
|
||
|
// return(false);
|
||
|
// if(!m_button3.Text("Sell"))
|
||
|
// return(false);
|
||
|
// if(!Add(m_button3))
|
||
|
// return(false);
|
||
|
// m_button3.Locking(true);
|
||
|
////--- succeed
|
||
|
// return(true);
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Create the display field |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//bool CTMDialog::CreateLots(void)
|
||
|
//{
|
||
|
////--- coordinates
|
||
|
// int x1=INDENT_LEFT;
|
||
|
// int y1=INDENT_TOP+(EDIT_HEIGHT+CONTROLS_GAP_Y);
|
||
|
// int x2=ClientAreaWidth()-INDENT_RIGHT;
|
||
|
// int y2=y1+EDIT_HEIGHT;
|
||
|
////--- create
|
||
|
// if(!m_lots.Create(m_chart_id,m_name+"Lots",m_subwin,x1,y1,x2,y2))
|
||
|
// return(false);
|
||
|
// if(!m_lots.ReadOnly(false))
|
||
|
// return(false);
|
||
|
// if(!Add(m_lots))
|
||
|
// return(false);
|
||
|
// if(!m_lots.Text("0,1"))
|
||
|
// return(false);
|
||
|
////--- succeed
|
||
|
// return(true);
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckAutoTrading(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_autotrading.Create(m_chart_id,m_name+"CheckBox1",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_autotrading.Text("Auto Trading Trade Open"))
|
||
|
return(false);
|
||
|
if(!m_check_autotrading.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_autotrading))
|
||
|
return(false);
|
||
|
if(!m_check_autotrading.Checked(IsAutoTrading()))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckStandort(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP+CHECK_HEIGHT+CONTROLS_GAP_Y;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_standort.Create(m_chart_id,m_name+"CheckBox2",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_standort.Text("Indi Standort"))
|
||
|
return(false);
|
||
|
if(!m_check_standort.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_standort))
|
||
|
return(false);
|
||
|
if(!m_check_standort.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckSystem(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*1;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_system.Create(m_chart_id,m_name+"CheckBox3",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_system.Text("Indi Rechner"))
|
||
|
return(false);
|
||
|
if(!m_check_system.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_system))
|
||
|
return(false);
|
||
|
if(!m_check_system.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckTerminal(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*2;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_terminal.Create(m_chart_id,m_name+"CheckBox4",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_terminal.Text("Indi Terminal"))
|
||
|
return(false);
|
||
|
if(!m_check_terminal.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_terminal))
|
||
|
return(false);
|
||
|
if(!m_check_terminal.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckAccount(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*3;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_account.Create(m_chart_id,m_name+"CheckBox10",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_account.Text("Indi Account"))
|
||
|
return(false);
|
||
|
if(!m_check_account.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_account))
|
||
|
return(false);
|
||
|
if(!m_check_account.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckSymbol(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*4;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_symbol.Create(m_chart_id,m_name+"CheckBox5",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_symbol.Text("Indi Symbol"))
|
||
|
return(false);
|
||
|
if(!m_check_symbol.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_symbol))
|
||
|
return(false);
|
||
|
if(!m_check_symbol.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckStrategieOpen(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*5;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_strategie_open.Create(m_chart_id,m_name+"CheckBox6",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_strategie_open.Text("Indi Strategie Open"))
|
||
|
return(false);
|
||
|
if(!m_check_strategie_open.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_strategie_open))
|
||
|
return(false);
|
||
|
if(!m_check_strategie_open.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckStrategieClose(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*6;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_strategie_close.Create(m_chart_id,m_name+"CheckBox7",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_strategie_close.Text("Indi Strategie Close"))
|
||
|
return(false);
|
||
|
if(!m_check_strategie_close.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_strategie_close))
|
||
|
return(false);
|
||
|
if(!m_check_strategie_close.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckMM(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*7;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_mm.Create(m_chart_id,m_name+"CheckBox8",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_mm.Text("Indi Money Managment"))
|
||
|
return(false);
|
||
|
if(!m_check_mm.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_mm))
|
||
|
return(false);
|
||
|
if(!m_check_mm.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckChart(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*8;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_chart.Create(m_chart_id,m_name+"CheckBox9",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_chart.Text("Indi Chart"))
|
||
|
return(false);
|
||
|
if(!m_check_chart.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_chart))
|
||
|
return(false);
|
||
|
if(!m_check_chart.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckHistory(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*9;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_history.Create(m_chart_id,m_name+"CheckBox11",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_history.Text("Indi History"))
|
||
|
return(false);
|
||
|
if(!m_check_history.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_history))
|
||
|
return(false);
|
||
|
if(!m_check_history.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckOrder(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*10;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_order.Create(m_chart_id,m_name+"CheckBox12",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_order.Text("Indi Order"))
|
||
|
return(false);
|
||
|
if(!m_check_order.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_order))
|
||
|
return(false);
|
||
|
if(!m_check_order.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckPosition(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*11;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_position.Create(m_chart_id,m_name+"CheckBox13",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_position.Text("Indi Position"))
|
||
|
return(false);
|
||
|
if(!m_check_position.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_position))
|
||
|
return(false);
|
||
|
if(!m_check_position.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| |
|
||
|
//+------------------------------------------------------------------+
|
||
|
bool CTMDialog::CreateCheckDeal(void)
|
||
|
{
|
||
|
//--- coordinates
|
||
|
int x1=INDENT_LEFT;
|
||
|
int y1=INDENT_TOP +CHECK_HEIGHT+CONTROLS_GAP_Y
|
||
|
+(CHECK_HEIGHT+GROUP_CONTROLS_GAP_Y)*12;
|
||
|
int x2=CHECK_WIDTH;
|
||
|
int y2=y1+CHECK_HEIGHT;
|
||
|
//--- create
|
||
|
if(!m_check_deal.Create(m_chart_id,m_name+"CheckBox14",m_subwin,x1,y1,x2,y2))
|
||
|
return(false);
|
||
|
if(!m_check_deal.Text("Indi Deal"))
|
||
|
return(false);
|
||
|
if(!m_check_deal.Color(clrBlue))
|
||
|
return(false);
|
||
|
if(!Add(m_check_deal))
|
||
|
return(false);
|
||
|
if(!m_check_deal.Checked(false))
|
||
|
return(false);
|
||
|
//--- succeed
|
||
|
return(true);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//void CTMDialog::OnClickButton1(void)
|
||
|
//{
|
||
|
// //m_
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//void CTMDialog::OnClickButton2(void)
|
||
|
//{
|
||
|
// m_edit.Text(__FUNCTION__);
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
//void CTMDialog::OnClickButton3(void)
|
||
|
//{
|
||
|
// //if(m_button3.Pressed())
|
||
|
// // m_edit.Text(__FUNCTION__+"On");
|
||
|
// //else
|
||
|
// m_edit.Text(__FUNCTION__+"Off");
|
||
|
//}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeAutoTrading(void)
|
||
|
{
|
||
|
m_trade.SetAutoTrading(m_check_autotrading.Checked());
|
||
|
if(IsAutoTrading())
|
||
|
PrintLog("Auto Trading aktiviert");
|
||
|
else
|
||
|
PrintLog("Auto Trading deaktiviert");
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeStandort(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeSystem(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeTerminal(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeAccount(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeSymbol(void)
|
||
|
{
|
||
|
if(m_trade.)
|
||
|
{
|
||
|
}
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeStrategieOpen(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeStrategieClose(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeMM(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeChart(void)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeHistory(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeOrder(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangePosition(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Event handler |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void CTMDialog::OnChangeDeal(void)
|
||
|
{
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|