73 lines
2.8 KiB
MQL5
73 lines
2.8 KiB
MQL5
|
//+------------------------------------------------------------------+
|
||
|
//| I-S-Nico-V0.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 2
|
||
|
#property indicator_plots 2
|
||
|
//---
|
||
|
//int i_Handle_HA;
|
||
|
//---
|
||
|
double i_Buffer0[];
|
||
|
double i_Buffer1[];
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Custom indicator initialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
int OnInit()
|
||
|
{
|
||
|
//---
|
||
|
//i_Handle_HA=iCustom(NULL,0,"Shared Projects\\Indicatoren\\I-Heikin Ashi Kerzen\\I-Heikin Ashi Kerzen-V0");
|
||
|
//--- indicator buffers mapping
|
||
|
//ArraySetAsSeries(i_Buffer0,true);
|
||
|
SetIndexBuffer(0,i_Buffer0,INDICATOR_DATA);
|
||
|
SetIndexBuffer(1,i_Buffer1,INDICATOR_DATA);
|
||
|
PlotIndexSetString(0,PLOT_LABEL,"Tradesignal1"); // Tradesignal -1=short Signal / 0=kein Signal / 1= long Signal
|
||
|
PlotIndexSetString(1,PLOT_LABEL,"Tradesignal2");
|
||
|
//ChartIndicatorAdd(0,0,i_Handle_HA);
|
||
|
//---
|
||
|
return(INIT_SUCCEEDED);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|
||
|
//| Custom indicator deinitialization function |
|
||
|
//+------------------------------------------------------------------+
|
||
|
void OnDeinit(const int 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[])
|
||
|
{
|
||
|
//---
|
||
|
double HA_O[];
|
||
|
double HA_H[];
|
||
|
double HA_L[];
|
||
|
double HA_C[];
|
||
|
double MA_H[];
|
||
|
double MA_L[];
|
||
|
Print("i_Buffer0 = "+(string)ArrayGetAsSeries(i_Buffer0));
|
||
|
Print("open = "+(string)ArrayGetAsSeries(open));
|
||
|
for(int i=prev_calculated; i<rates_total; i++)
|
||
|
{
|
||
|
i_Buffer0[i]=rates_total;
|
||
|
i_Buffer1[i]=prev_calculated;
|
||
|
}
|
||
|
//--- return value of prev_calculated for next call
|
||
|
return(rates_total);
|
||
|
}
|
||
|
//+------------------------------------------------------------------+
|