Топчем одни и теже дорожки
Тоже не так давно сваял, параметры разные.
Но можно изменить их
extern int p1 = 37;
extern double kf = 1.08;
extern int method = 1;
//+------------------------------------------------------------------+
//| Rainbow.mq4 |
//| Copyright © 2008, MetaQuotes Software Corp. |
//|
http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link "
http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_color3 Orange
#property indicator_color4 Yellow
#property indicator_color5 Lime
#property indicator_color6 DodgerBlue
#property indicator_color7 Blue
#property indicator_color8 DarkViolet
extern int p1 = 13;
extern double kf = 1.2;
extern int method = 2;
double ms[];
double m1[];
double m2[];
double m3[];
double m4[];
double m5[];
double m6[];
double m7[];
double price[];
int p2,p3,p4,p5,p6,p7;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,0,1);
SetIndexBuffer(0,ms);
SetIndexStyle(1,DRAW_LINE,0,1);
SetIndexBuffer(1,m1);
SetIndexStyle(2,DRAW_LINE,0,1);
SetIndexBuffer(2,m2);
SetIndexStyle(3,DRAW_LINE,0,1);
SetIndexBuffer(3,m3);
SetIndexStyle(4,DRAW_LINE,0,1);
SetIndexBuffer(4,m4);
SetIndexStyle(3,DRAW_LINE,0,1);
SetIndexBuffer(4,m4);
SetIndexStyle(4,DRAW_LINE,0,1);
SetIndexBuffer(5,m5);
SetIndexStyle(5,DRAW_LINE,0,1);
SetIndexBuffer(6,m6);
SetIndexStyle(6,DRAW_LINE,0,1);
SetIndexBuffer(7,m7);
SetIndexStyle(7,DRAW_LINE,0,2);
p2=p1*kf;
p3=p1*(kf*kf);
p4=p1*(kf*kf*kf);
p5=p1*(kf*kf*kf*kf);
p6=p1*(kf*kf*kf*kf*kf);
p7=p1*(kf*kf*kf*kf*kf*kf);
IndicatorShortName("MArainball period("+p1+","+p2+","+p3+","+p4+","+p5+","+p6+","+p7+"),"+ "method("+method+") ");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit=Bars-IndicatorCounted()-1;
//----
for(int i=limit-1; i>=0; i--)
{
ms
=iMA(NULL,0,2,0, method, 0, i);
m1=iMA(NULL,0,p1,0, method, 0, i);
m2=iMA(NULL,0,p2,0, method, 0, i);
m3=iMA(NULL,0,p3,0, method, 0, i);
m4=iMA(NULL,0,p4,0, method, 0, i);
m5=iMA(NULL,0,p5,0, method, 0, i);
m6=iMA(NULL,0,p6,0, method, 0, i);
m7=iMA(NULL,0,p7,0, method, 0, i);
}
//----
return(0);
}
//+------------------------------------------------------------------+