Files
xMQL5/MQLTestWorkspace/BKPS/Templates/x-saherelm.chart_drawing.template.mq5
T

165 lines
3.5 KiB
Plaintext

//////////////////////////////////////////////////////////
//
// SaherElm IT Center MQL5 X121_ICH Ichimoku Time Teory
// ------------------------------------------------------
// Name: X121_ICH_
// Description:
// Market Analysor ...
//
//
// Maintainer:
// ------------
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
//
//////////////////////////////////////////////////////
//
// Global Properties ...
#property copyright "Copyright 2023, SaherElm IT Center"
#property link "https://saherelm.ir"
#property version "1.00"
#property description "SaherElm X121_ICH Timing"
//
#property strict
#property indicator_chart_window
//
// START Constants ...
//
//
// Indicator Short Name ...
#define ShortName "X121_ICH_T"
//
// Ichimoku Golden Numbers ...
enum ENUM_X_ICHIMOKU_GOLDEN_NUMBERS
{
X_ICH_BASE = 9,
X_ICH_GOLDEN = 17,
X_ICH_CYCLE = 26,
X_ICH_PERIOD = 35,
X_ICH_STAR = 45,
X_ICH_MED = 52,
X_ICH_LONG = 63,
X_ICH_FULL = 72
};
//
// END Constants ...
//
//
// START Global Definitions: Variables, Properties and etc ...
//
//
// Indicator Chart ID ...
string mIndicatorId;
//
// END Global Definitions: Variables, Properties and etc ...
//
//
// START Event Handlers ...
//
//
// Initialization ...
int OnInit()
{
//
// Assign a hopefully-unique ID to the indicator so that it can later remove itself
mIndicatorId = ShortName + "." + IntegerToString(GetMicrosecondCount());
IndicatorSetString(INDICATOR_SHORTNAME, mIndicatorId);
//
// Init Succeed ...
return INIT_SUCCEEDED;
}
//
// DeInitialization ...
void OnDeinit(const int reason)
{
//
// REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function
// REASON_REMOVE 1 Program removed from a chart
// REASON_RECOMPILE 2 Program recompiled
// REASON_CHARTCHANGE 3 A symbol or a chart period is changed
// REASON_CHARTCLOSE 4 Chart closed
// REASON_PARAMETERS 5 Inputs changed by a user
// REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings
// REASON_TEMPLATE 7 Another chart template applied
// REASON_INITFAILED 8 The OnInit() handler returned a non-zero value
// REASON_CLOSE 9 Terminal closed
}
//
// Calculations ...
int OnCalculate(
//
// total Candles on chart ...
const int rates_total,
//
// total calculated Candles on charts ...
const int prev_calculated,
//
// history of Candles Open Time ...
const datetime &time[],
//
// history of Candles Open Price ...
const double &open[],
//
// history of Candles High Price ...
const double &high[],
//
// history of Candles Low Price ...
const double &low[],
//
// history of Candles Close Price ...
const double &close[],
//
// history of Tick Volumes on Candle ...
const long &tick_volume[],
//
// history of Trade Volumes ...
const long &volume[],
//
// history of Candles Spread Price ...
const int &spread[])
{
return rates_total;
}
//
// Handle Chart Events ...
void OnChartEvent(
const int id, // event ID
const long &lparam, // long type event parameter
const double &dparam, // double type event parameter
const string &sparam // string type event parameter
)
{
}
//
// END Event Handlers ...
//
//
// START Functions ...
//
//
// Remove Indicator From Chart ...
void RemoveIndicator()
{
ChartIndicatorDelete(0, 0, mIndicatorId);
}
//
// END Functions ...
//