ÿþ
#property copyright "Copyright © 2020 Vladimir Hlystov"
#property link "cmillion@narod.ru"
#property description "?>:07K205B =0 A:>;L:> CH;8 8=AB@C<5=BK >B =C;52>9 B>G:8 7040==>9 2 ?0@0<5B@0E"
#property strict
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 clrRed
#property indicator_color2 clrBlue
#property indicator_color3 clrGreen
#property indicator_color4 clrGray
extern string simbol_1 = "AUDUSD";
extern string simbol_2 = "EURUSD";
extern string simbol_3 = "GBPUSD";
extern string simbol_4 = "";
extern int ControlBars = 800;
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double Point1,Point2,Point3,Point4;
double P1=0,P2=0,P3=0,P4=0;
void OnInit()
{
SetIndexBuffer(0,Buffer1);
SetIndexStyle(0,DRAW_LINE);
SetIndexLabel(0,simbol_1);
SetIndexBuffer(1,Buffer2);
SetIndexStyle(1,DRAW_LINE);
SetIndexLabel(1,simbol_2);
SetIndexBuffer(2,Buffer3);
SetIndexStyle(2,DRAW_LINE);
SetIndexLabel(2,simbol_3);
SetIndexBuffer(3,Buffer4);
SetIndexStyle(3,DRAW_LINE);
SetIndexLabel(4,simbol_4);
IndicatorShortName(StringConcatenate(simbol_1," ",simbol_2," ",simbol_3," ",simbol_4));
Point1= MarketInfo(simbol_1,MODE_POINT);
Point2= MarketInfo(simbol_2,MODE_POINT);
Point3= MarketInfo(simbol_3,MODE_POINT);
Point4= MarketInfo(simbol_4,MODE_POINT);
}
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=ControlBars; i>=0; i--)
{
P1=P1+(iClose(simbol_1,0,i)-iClose(simbol_1,0,i+1))/Point1;
Buffer1[i] = P1;
P2=P2+(iClose(simbol_2,0,i)-iClose(simbol_2,0,i+1))/Point2;
Buffer2[i] = P2;
P3=P3+(iClose(simbol_3,0,i)-iClose(simbol_3,0,i+1))/Point3;
Buffer2[i] = P3;
P4=P4+(iClose(simbol_4,0,i)-iClose(simbol_4,0,i+1))/Point4;
Buffer3[i] = P4;
}
return(rates_total);
}
Comments