MultiInstrument_NULL day

Author: Copyright © 2020 Vladimir Hlystov
Price Data Components
Series array that contains open time of each barSeries array that contains close prices for each bar
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
MultiInstrument_NULL day
ÿþ//+------------------------------------------------------------------+

//|                                            MultiInstrument_2.mq4 |

//|                                     Copyright © 2012, V. Hlystov |

//|                                                                  |

//+------------------------------------------------------------------+

#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 8

#property indicator_color1 clrRed

#property indicator_color2 clrBlue

#property indicator_color3 clrGreen

#property indicator_color4 clrGray

#property indicator_color5 clrDeepSkyBlue

#property indicator_color6 clrMediumSpringGreen

#property indicator_color7 clrGreenYellow

#property indicator_color8 clrDeepPink

#property indicator_level1 0.0

extern string simbol_1 = "AUDUSD";

extern string simbol_2 = "EURUSD";

extern string simbol_3 = "GBPUSD";

extern string simbol_4 = "EURGBP";

extern string simbol_5 = "USDCAD";

extern string simbol_6 = "EURAUD";

extern string simbol_7 = "USDCHF";

extern string simbol_8 = "USDJPY";

extern int ControlBars = 3800;      //:>;;8G5AB2> :>=B@>;;8@C5<KE A25G59

double Buffer1[];

double Buffer2[];

double Buffer3[];

double Buffer4[];

double Buffer5[];

double Buffer6[];

double Buffer7[];

double Buffer8[];

double Point1,Point2,Point3,Point4,Point5,Point6,Point7,Point8;

double P1=0,P2=0,P3=0,P4=0,P5=0,P6=0,P7=0,P8=0;

int DAY=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(3,simbol_4);

   

   SetIndexBuffer(4,Buffer5);

   SetIndexStyle(4,DRAW_LINE);

   SetIndexLabel(4,simbol_5);

   

   SetIndexBuffer(5,Buffer6);

   SetIndexStyle(5,DRAW_LINE);

   SetIndexLabel(5,simbol_6);

   

   SetIndexBuffer(6,Buffer7);

   SetIndexStyle(6,DRAW_LINE);

   SetIndexLabel(6,simbol_7);

   

   SetIndexBuffer(7,Buffer8);

   SetIndexStyle(7,DRAW_LINE);

   SetIndexLabel(7,simbol_8);

   

   //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);

   Point5= MarketInfo(simbol_5,MODE_POINT);

   Point6= MarketInfo(simbol_6,MODE_POINT);

   Point7= MarketInfo(simbol_7,MODE_POINT);

   Point8= MarketInfo(simbol_8,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--)

  {

      if (TimeDay(iTime(simbol_1,0,i))!=DAY)

      {

         DAY=TimeDay(iTime(simbol_1,0,i));

         P1=0;P2=0;P3=0;P4=0;P5=0;P6=0;P7=0;P8=0;

      }

      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;

      Buffer3[i] = P3;

      

      P4=P4+(iClose(simbol_4,0,i)-iClose(simbol_4,0,i+1))/Point4;

      Buffer4[i] = P4;

      

      P5=P5+(iClose(simbol_5,0,i)-iClose(simbol_5,0,i+1))/Point5;

      Buffer5[i] = P5;

      

      P6=P6+(iClose(simbol_6,0,i)-iClose(simbol_6,0,i+1))/Point6;

      Buffer6[i] = P6;

      

      P7=P7+(iClose(simbol_7,0,i)-iClose(simbol_7,0,i+1))/Point7;

      Buffer7[i] = P7;

      

      P8=P8+(iClose(simbol_8,0,i)-iClose(simbol_8,0,i+1))/Point8;

      Buffer8[i] = P8;

  }  

  return(rates_total);

}

//+------------------------------------------------------------------+



Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---