95 lines
3.4 KiB
MQL5
95 lines
3.4 KiB
MQL5
|
//+------------------------------------------------------------------+
|
||
|
//| I-StrategieO.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
|
||
|
|
||
|
//---
|
||
|
#include "..\..\TF-Dateien\TF-Class\TFLog.mqh"
|
||
|
#include "TFGUI.mqh"
|
||
|
|
||
|
//---
|
||
|
//#property indicator_separate_window
|
||
|
#property indicator_chart_window
|
||
|
#property indicator_buffers 1
|
||
|
#property indicator_plots 0
|
||
|
|
||
|
|
||
|
input string i_Strategie_Open="000"; // Strategie Open
|
||
|
//input string i_Strategie_CloseSL="000";
|
||
|
//input string i_Strategie_CloseTP="000";
|
||
|
//input int i_SL_pips=0;
|
||
|
//input int i_TP_pips=0;
|
||
|
|
||
|
//---
|
||
|
string g_Strategie_Open=i_Strategie_Open;
|
||
|
//string g_Strategie_CloseSL=i_Strategie_CloseSL;
|
||
|
//string g_Strategie_CloseTP=i_Strategie_CloseTP;
|
||
|
//int g_SL_pips=i_SL_pips;
|
||
|
//int g_TP_pips=i_TP_pips;
|
||
|
|
||
|
//---
|
||
|
double g_Buffer0[];
|
||
|
|
||
|
CTFGUI StrategieGui;
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Custom indicator initialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
int OnInit()
|
||
|
{
|
||
|
//---
|
||
|
StrategieGui.StrategieOpen(g_Strategie_Open);
|
||
|
//---
|
||
|
if(!StrategieGui.OnInitEvent())
|
||
|
return(INIT_FAILED);
|
||
|
//--- indicator buffers mapping
|
||
|
SetIndexBuffer(0, g_Buffer0, INDICATOR_CALCULATIONS);
|
||
|
ArraySetAsSeries(g_Buffer0, true);
|
||
|
//---
|
||
|
return(INIT_SUCCEEDED);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Custom indicator deinitialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnDeinit(const int reason)
|
||
|
{
|
||
|
//---
|
||
|
StrategieGui.OnDeInitEvent(reason);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Custom indicator iteration function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
int OnCalculate(const int rates_total,
|
||
|
const int prev_calculated,
|
||
|
const datetime &time[],
|
||
|
const double &open[],
|
||
|
const double &high[],
|
||
|
const double &low[],
|
||
|
const double &close[],
|
||
|
const long &tick_volume[],
|
||
|
const long &volume[],
|
||
|
const int &spread[])
|
||
|
{
|
||
|
//---
|
||
|
g_Buffer0[0]=(double)g_Strategie_Open;
|
||
|
//--- return value of prev_calculated for next call
|
||
|
return(rates_total);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| ChartEvent function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnChartEvent(const int id,
|
||
|
const long &lparam,
|
||
|
const double &dparam,
|
||
|
const string &sparam)
|
||
|
{
|
||
|
//---
|
||
|
StrategieGui.ChartEvent(id, lparam, dparam, sparam);
|
||
|
g_Strategie_Open=StrategieGui.StrategieOpen();
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|