TF-altProjekte/Indukatoren/I-MA-HK-Kombi/I-MA-HK-v1.mq5

98 lines
3.7 KiB
MQL5
Raw Permalink Normal View History

2025-05-30 16:31:33 +02:00
//+------------------------------------------------------------------+
//| I-MA-HK-v1.mq5 |
//| 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"
#property indicator_chart_window
#property indicator_buffers 9
#property indicator_plots 5
//--- plot HK
#property indicator_label1 "HK_O;HK_H;HK_L;HK_C"
#property indicator_type1 DRAW_COLOR_CANDLES
#property indicator_color1 clrSlateBlue,clrRed
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
//--- plot MA_Oben
#property indicator_label2 "MA_Oben"
#property indicator_type2 DRAW_LINE
#property indicator_color2 clrTan
#property indicator_style2 STYLE_SOLID
#property indicator_width2 1
//--- plot MA_Unten
#property indicator_label3 "MA_Unten"
#property indicator_type3 DRAW_LINE
#property indicator_color3 clrTan
#property indicator_style3 STYLE_SOLID
#property indicator_width3 1
//--- plot SUN
#property indicator_label4 "SUN"
#property indicator_type4 DRAW_ARROW
#property indicator_color4 clrBlue,clrRed
//#property indicator_style4 STYLE_SOLID
#property indicator_width4 1
//--- plot TradeSignal
#property indicator_label5 "TradeSignal"
#property indicator_type5 DRAW_ARROW
#property indicator_color5 clrBlue,clrRed
//#property indicator_style5 STYLE_SOLID
#property indicator_width5 1
//--- input parameters
input int MA_Periode=5;
input int Input1;
//--- indicator buffers
double HKBuffer_O[];
double HKBuffer_H[];
double HKBuffer_L[];
double HKBuffer_C[];
double HKColors[];
double MA_ObenBuffer[];
double MA_UntenBuffer[];
double SUNBuffer[];
double TradeSignal[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,HKBuffer_O,INDICATOR_DATA);
SetIndexBuffer(1,HKBuffer_H,INDICATOR_DATA);
SetIndexBuffer(2,HKBuffer_L,INDICATOR_DATA);
SetIndexBuffer(3,HKBuffer_C,INDICATOR_DATA);
SetIndexBuffer(4,HKColors,INDICATOR_COLOR_INDEX);
SetIndexBuffer(5,MA_ObenBuffer,INDICATOR_DATA);
SetIndexBuffer(6,MA_UntenBuffer,INDICATOR_DATA);
SetIndexBuffer(7,SUNBuffer,INDICATOR_DATA);
SetIndexBuffer(8,TradeSignal,INDICATOR_DATA);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| 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[])
int OnCalculate(const int rates_total,
const int prev_calculated,
const int begin,
const double &price[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+