cm spresd 2 symbol

Author: Copyright © 2019, mqlgold@narod.ru
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
cm spresd 2 symbol
ÿþ#property copyright "Copyright © 2019, mqlgold@narod.ru"

#property link      "mqlgold@narod.ru"

#property strict

//----

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 clrRed

#property indicator_style1 0

#property indicator_level1 0

#property indicator_color2 clrRed

#property indicator_style2 0

#property indicator_level2 0

#property  indicator_width1  2

#property  indicator_width2  2



double B1[];

double B2[];

extern string Symbol2="GBPCHF";

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

int OnInit(void)

{

   IndicatorBuffers(2);

   SetIndexBuffer(0, B1);

   SetIndexBuffer(1, B2);

   SetIndexStyle(0,DRAW_HISTOGRAM);

   SetIndexStyle(1,DRAW_HISTOGRAM);

   SetIndexLabel(0,Symbol());

   SetIndexLabel(1,Symbol2);

   return(INIT_SUCCEEDED);

}

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

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[])

  {

   B1[0] = (MarketInfo(NULL,MODE_ASK)-MarketInfo(NULL,MODE_BID))/MarketInfo(NULL,MODE_POINT);

   B2[0] = (MarketInfo(Symbol2,MODE_BID)-MarketInfo(Symbol2,MODE_ASK))/MarketInfo(Symbol2,MODE_POINT);

   return(rates_total);

  }

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

Comments