
//+------------------------------------------------------------------+
//| Impuls.mq4 |
//| Copyright 2019, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_width1 4
#property indicator_color2 Red
#property indicator_width2 4
double up[];
double dn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(0,up);
SetIndexBuffer(1,dn);
Comment("");
//---
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[])
{
//---
for(int i=0;i<1111;i++)
{
if(close[i]>close[i+1]) up[i]=high[i];
if(close[i]<close[i+1]) dn[i]=low[i];
}
//---
return(rates_total);
}
//+------------------------------------------------------------------+
ну хоть что то, а то под МТ5 нет ничего, все под МТ4
//+------------------------------------------------------------------+
//| MultiChart.mq5 |
//| Copyright 2019, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property indicator_chart_window
#property indicator_plots 1
#property indicator_buffers 1
#property indicator_type1 DRAW_LINE
#property indicator_color1 Blue
#property indicator_width1 2
input string s="USDCHF";
input int MAPeriod=22;
input int Barov=1111;
double MA[];
int ma;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,MA,INDICATOR_DATA);
ma=iMA(s,0,MAPeriod,0,0,0);
//---
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[])
{
//---
double k=1.122/0.991;
ArraySetAsSeries(MA,true);
CopyBuffer(ma,0,0,Barov,MA);
Comment("\n",MA[1]);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
AM2