Fib_SR_8_Full

Author: Copyright © 2018, Nikolay Kositsin
0 Views
0 Downloads
0 Favorites
Fib_SR_8_Full
ÿþ//+------------------------------------------------------------------+ 

//|                                                Fib_SR_8_Full.mq5 | 

//|                               Copyright © 2018, Nikolay Kositsin | 

//|                              Khabarovsk,   farria@mail.redcom.ru | 

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

#property copyright "Copyright © 2018, Nikolay Kositsin"

#property link "farria@mail.redcom.ru"

//--- =><5@ 25@A88 8=48:0B>@0

#property version   "1.60"

//--- >B@8A>2:0 8=48:0B>@0 2 >A=>2=>< >:=5

#property indicator_chart_window

//--- :>;8G5AB2> 8=48:0B>@=KE 1CD5@>2 32

#property indicator_buffers 32 

//--- 8A?>;L7>20=> 425=04F0BL 3@0D8G5A:8E ?>AB@>5=89

#property indicator_plots   16

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

//|  >1JO2;5=85 :>=AB0=B                         |

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

#define RESET 0                                        // >=AB0=B0 4;O 2>72@0B0 B5@<8=0;C :><0=4K =0 ?5@5AG5B 8=48:0B>@0

#define EMPTYVALUE 0                                   // >=AB0=B0 4;O =5>B>1@0605<KE 7=0G5=89 8=48:0B>@0

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 1            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type1   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color1  clrGreen

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label1  "Upper Fibo 1"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 2            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type2   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color2  clrRed

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label2  "Lower Fibo 1"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 3            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type3   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color3  clrGreen

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label3  "Upper Fibo 1"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 4            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type4   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color4  clrRed

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label4  "Lower Fibo 1"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 5            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type5   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color5  clrLime

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label5  "Upper Fibo 2"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 6            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type6   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color6  clrMagenta

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label6  "Lower Fibo 2"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 7            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type7   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color7  clrLime

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label7  "Upper Fibo 2"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 8            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type8   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color8  clrMagenta

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label8  "Lower Fibo 2"



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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 9            |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type9   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color9  clrDodgerBlue

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label9  "Upper Fibo 3"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 10           |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type10   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color10  clrOrange;

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label10  "Lower Fibo 3"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 11           |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type11   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color11  clrDodgerBlue

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label11  "Upper Fibo 3"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 12           |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type12   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color12  clrOrange;

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label12  "Lower Fibo 3"



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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 13           |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type13   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color13  clrAqua

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label13  "Upper Fibo 4"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 14           |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type14   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color14  clrYellow

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label14  "Lower Fibo 4"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 15           |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type15   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color15  clrAqua;

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label15  "Upper Fibo 4"

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

//|  0@0<5B@K >B@8A>2:8 8=48:0B>@0 16           |

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

//--- >B@8A>2:0 8=48:0B>@0 2 2845 F25B=>3> >1;0:0

#property indicator_type16   DRAW_FILLING

//--- 2 :0G5AB25 F25B0 8=48:0B>@0 8A?>;L7>20=

#property indicator_color16  clrYellow;

//--- >B>1@065=85 <5B:8 8=48:0B>@0

#property indicator_label16  "Lower Fibo 4"

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

//| E>4=K5 ?0@0<5B@K 8=48:0B>@0                 |

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

input ENUM_TIMEFRAMES Timeframe=PERIOD_D1;  //"09<D@59< 8=48:0B>@0 4;O @0AG5B0 8=48:0B>@0

input double Ratio1 = 0.618;                //?5@2>5 A>>B=>H5=85

input double Ratio2 = 1.382;                //2B>@>5 A>>B=>H5=85

input double Ratio3 = 2.764;                //B@5BL5 A>>B=>H5=85

input double Ratio4 = 5.528;                //G5B2Q@B>5 A>>B=>H5=85

input double Step = 0.50;                   //H03 @0AH8@5=8O

input int    Shift=0;                       //!4283 8=48:0B>@0 ?> 3>@87>=B0;8 2 10@0E

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

//--- >1JO2;5=85 48=0<8G5A:8E <0AA82>2, :>B>@K5 2 40;L=59H5< 1C4CB 8A?>;L7>20=K 2 :0G5AB25 8=48:0B>@=KE 1CD5@>2

double UpUpBuffer1[],UpDnBuffer1[],DnUpBuffer1[],DnDnBuffer1[];

double UpUpBuffer2[],UpDnBuffer2[],DnUpBuffer2[],DnDnBuffer2[];

double UpUpBuffer3[],UpDnBuffer3[],DnUpBuffer3[],DnDnBuffer3[];

double UpUpBuffer4[],UpDnBuffer4[],DnUpBuffer4[],DnDnBuffer4[];

double UpUpBuffer5[],UpDnBuffer5[],DnUpBuffer5[],DnDnBuffer5[];

double UpUpBuffer6[],UpDnBuffer6[],DnUpBuffer6[],DnDnBuffer6[];

double UpUpBuffer7[],UpDnBuffer7[],DnUpBuffer7[],DnDnBuffer7[];

double UpUpBuffer8[],UpDnBuffer8[],DnUpBuffer8[],DnDnBuffer8[];



//--- >1JO2;5=85 F5;>G8A;5==KE ?5@5<5==KE =0G0;0 >BAG5B0 40==KE

int min_rates_total;

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

//| Custom indicator initialization function                         | 

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

int OnInit()

  {

//--- 8=8F80;870F8O ?5@5<5==KE 

   min_rates_total=2;

//--- ?@52@0I5=85 48=0<8G5A:8E <0AA82>2 2 8=48:0B>@=K5 1CD5@K

   ArrayInit(0,UpUpBuffer1);

   ArrayInit(1,UpDnBuffer1);

   ArrayInit(2,DnUpBuffer1);

   ArrayInit(3,DnDnBuffer1);

   ArrayInit(4,UpUpBuffer2);

   ArrayInit(5,UpDnBuffer2);

   ArrayInit(6,DnUpBuffer2);

   ArrayInit(7,DnDnBuffer2);

   ArrayInit(8,UpUpBuffer3);

   ArrayInit(9,UpDnBuffer3);

   ArrayInit(10,DnUpBuffer3);

   ArrayInit(11,DnDnBuffer3);

   ArrayInit(12,UpUpBuffer4);

   ArrayInit(13,UpDnBuffer4);

   ArrayInit(14,DnUpBuffer4);

   ArrayInit(15,DnDnBuffer4);

   ArrayInit(16,UpUpBuffer5);

   ArrayInit(17,UpDnBuffer5);

   ArrayInit(18,DnUpBuffer5);

   ArrayInit(19,DnDnBuffer5);

   ArrayInit(20,UpUpBuffer6);

   ArrayInit(21,UpDnBuffer6);

   ArrayInit(22,DnUpBuffer6);

   ArrayInit(23,DnDnBuffer6);

   ArrayInit(24,UpUpBuffer7);

   ArrayInit(25,UpDnBuffer7);

   ArrayInit(26,DnUpBuffer7);

   ArrayInit(27,DnDnBuffer7);

   ArrayInit(28,UpUpBuffer8);

   ArrayInit(29,UpDnBuffer8);

   ArrayInit(30,DnUpBuffer8);

   ArrayInit(31,DnDnBuffer8);

//--- 8=8F80;870F8O 8=48:0B>@>2

   PlotInit(0,EMPTYVALUE,2,Shift);

   PlotInit(1,EMPTYVALUE,2,Shift);

   PlotInit(2,EMPTYVALUE,2,Shift);

   PlotInit(3,EMPTYVALUE,2,Shift);

   PlotInit(4,EMPTYVALUE,2,Shift);

   PlotInit(5,EMPTYVALUE,2,Shift);

   PlotInit(6,EMPTYVALUE,2,Shift);

   PlotInit(7,EMPTYVALUE,2,Shift);

   PlotInit(8,EMPTYVALUE,2,Shift);

   PlotInit(9,EMPTYVALUE,2,Shift);

   PlotInit(10,EMPTYVALUE,2,Shift);

   PlotInit(11,EMPTYVALUE,2,Shift);

   PlotInit(12,EMPTYVALUE,2,Shift);

   PlotInit(13,EMPTYVALUE,2,Shift);

   PlotInit(14,EMPTYVALUE,2,Shift);

   PlotInit(15,EMPTYVALUE,2,Shift);

//--- A>740=85 8<5=8 4;O >B>1@065=8O 2 >B45;L=>< ?>4>:=5 8 2> 2A?;K20NI59 ?>4A:07:5

   string shortname="Fib_SR_8_Full";

//StringConcatenate(shortname,INDICATOR_NAME,"(",EnumToString(TimeFrame),")");

   IndicatorSetString(INDICATOR_SHORTNAME,shortname);

//--- >?@545;5=85 B>G=>AB8 >B>1@065=8O 7=0G5=89 8=48:0B>@0

   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);

//--- 7025@H5=85 8=8F80;870F88

   return(INIT_SUCCEEDED);

  }

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

//| Custom iteration function                                        | 

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

int OnCalculate(const int rates_total,    // :>;8G5AB2> 8AB>@88 2 10@0E =0 B5:CI5< B8:5

                const int prev_calculated,// :>;8G5AB2> 8AB>@88 2 10@0E =0 ?@54K4CI5< B8:5

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

  {

//--- ?@>25@:0 :>;8G5AB20 10@>2 =0 4>AB0B>G=>ABL 4;O @0AG5B0

   if(rates_total<min_rates_total) return(RESET);



   static int Sign;

   static datetime LastTime;

   double dLow[2],dHigh[2],dClose[2];

   datetime nTime[1];

   int limit;

//--- AB0@B>2>3> =><5@0 limit 4;O F8:;0 ?5@5AG5B0 10@>2

   if(prev_calculated>rates_total || prev_calculated<=0)// ?@>25@:0 =0 ?5@2K9 AB0@B @0AG5B0 8=48:0B>@0

     {

      limit=rates_total-min_rates_total-1; // AB0@B>2K9 =><5@ 4;O @0AG5B0 2A5E 10@>2

      LastTime=0;

      Sign=1;

     }

   else limit=rates_total-prev_calculated; // AB0@B>2K9 =><5@ 4;O @0AG5B0 =>2KE 10@>2 



//--- 8=45:A0F8O M;5<5=B>2 2 <0AA820E :0: 2 B09<A5@8OE  

   ArraySetAsSeries(time,true);



//--- >A=>2=>9 F8:; @0AG5B0 8=48:0B>@0

   for(int bar=limit; bar>=0 && !IsStopped(); bar--)

     {

      //--- :>?8@C5< 2=>2L ?>O282H85AO 40==K5 2 <0AA82 nTime

      if(CopyTime(Symbol(),Timeframe,time[bar],1,nTime)<=0) return(RESET);



      if(time[bar]>=nTime[0] && time[bar+1]<nTime[0])

        {

         if(nTime[0]!=LastTime)

           {

            LastTime=nTime[0];

            Sign*=(-1);

           }

         //----

         int to_copy=2;

         //----

         if(CopyClose(NULL,Timeframe,time[bar],to_copy,dClose)<to_copy)return(RESET);

         if(CopyHigh(NULL,Timeframe,time[bar],to_copy,dHigh)<to_copy)return(RESET);

         if(CopyLow(NULL,Timeframe,time[bar],to_copy,dLow)<to_copy)return(RESET);

         //----   

         double C=dClose[0];

         double H=dHigh[0];

         double L=dLow[0];

         double R=(H-L);

         //----

         double R1=R*Ratio1;

         double D=C+R*Step;

         double B=C-R*Step;

         double D1=C+R1;

         double B1=C-R1;

         //----

         double R2=R*Ratio2;

         double E=C+R*2*Step;

         double A=C-R*2*Step;

         double E1=C+R2;

         double A1=C-R2;



         //----      

         double R3=R*Ratio3;

         double F=C+R*4*Step;

         double G=C-R*4*Step;

         double F1=C+R3;

         double G1=C-R3;

         //----      

         double R4=R*Ratio4;

         double I=C+R*7*Step;

         double J=C-R*7*Step;

         double I1=C+R4;

         double J1=C-R4;



         if(Sign>0)

           {

            UpUpBuffer1[bar]=D1;

            UpDnBuffer1[bar]=D;

            DnUpBuffer1[bar]=B;

            DnDnBuffer1[bar]=B1;

            UpUpBuffer3[bar]=E1;

            UpDnBuffer3[bar]=E;

            DnUpBuffer3[bar]=A;

            DnDnBuffer3[bar]=A1;

            UpUpBuffer5[bar]=F1;

            UpDnBuffer5[bar]=F;

            DnUpBuffer5[bar]=G;

            DnDnBuffer5[bar]=G1;

            UpUpBuffer7[bar]=I1;

            UpDnBuffer7[bar]=I;

            DnUpBuffer7[bar]=J;

            DnDnBuffer7[bar]=J1;

            //----

            UpUpBuffer2[bar]=EMPTYVALUE;

            UpDnBuffer2[bar]=EMPTYVALUE;

            DnUpBuffer2[bar]=EMPTYVALUE;

            DnDnBuffer2[bar]=EMPTYVALUE;

            UpUpBuffer4[bar]=EMPTYVALUE;

            UpDnBuffer4[bar]=EMPTYVALUE;

            DnUpBuffer4[bar]=EMPTYVALUE;

            DnDnBuffer4[bar]=EMPTYVALUE;

            UpUpBuffer6[bar]=EMPTYVALUE;

            UpDnBuffer6[bar]=EMPTYVALUE;

            DnUpBuffer6[bar]=EMPTYVALUE;

            DnDnBuffer6[bar]=EMPTYVALUE;

            UpUpBuffer8[bar]=EMPTYVALUE;

            UpDnBuffer8[bar]=EMPTYVALUE;

            DnUpBuffer8[bar]=EMPTYVALUE;

            DnDnBuffer8[bar]=EMPTYVALUE;

           }

         else

           {

            UpUpBuffer2[bar]=D1;

            UpDnBuffer2[bar]=D;

            DnUpBuffer2[bar]=B;

            DnDnBuffer2[bar]=B1;

            UpUpBuffer4[bar]=E1;

            UpDnBuffer4[bar]=E;

            DnUpBuffer4[bar]=A;

            DnDnBuffer4[bar]=A1;

            UpUpBuffer6[bar]=F1;

            UpDnBuffer6[bar]=F;

            DnUpBuffer6[bar]=G;

            DnDnBuffer6[bar]=G1;

            UpUpBuffer8[bar]=I1;

            UpDnBuffer8[bar]=I;

            DnUpBuffer8[bar]=J;

            DnDnBuffer8[bar]=J1;

            //----

            UpUpBuffer1[bar]=EMPTYVALUE;

            UpDnBuffer1[bar]=EMPTYVALUE;

            DnUpBuffer1[bar]=EMPTYVALUE;

            DnDnBuffer1[bar]=EMPTYVALUE;

            UpUpBuffer3[bar]=EMPTYVALUE;

            UpDnBuffer3[bar]=EMPTYVALUE;

            DnUpBuffer3[bar]=EMPTYVALUE;

            DnDnBuffer3[bar]=EMPTYVALUE;

            UpUpBuffer5[bar]=EMPTYVALUE;

            UpDnBuffer5[bar]=EMPTYVALUE;

            DnUpBuffer5[bar]=EMPTYVALUE;

            DnDnBuffer5[bar]=EMPTYVALUE;

            UpUpBuffer7[bar]=EMPTYVALUE;

            UpDnBuffer7[bar]=EMPTYVALUE;

            DnUpBuffer7[bar]=EMPTYVALUE;

            DnDnBuffer7[bar]=EMPTYVALUE;

           }

        }

      else

        {

         UpUpBuffer1[bar]=UpUpBuffer1[bar+1];

         UpDnBuffer1[bar]=UpDnBuffer1[bar+1];

         DnUpBuffer1[bar]=DnUpBuffer1[bar+1];

         DnDnBuffer1[bar]=DnDnBuffer1[bar+1];

         UpUpBuffer2[bar]=UpUpBuffer2[bar+1];

         UpDnBuffer2[bar]=UpDnBuffer2[bar+1];

         DnUpBuffer2[bar]=DnUpBuffer2[bar+1];

         DnDnBuffer2[bar]=DnDnBuffer2[bar+1];

         UpUpBuffer3[bar]=UpUpBuffer3[bar+1];

         UpDnBuffer3[bar]=UpDnBuffer3[bar+1];

         DnUpBuffer3[bar]=DnUpBuffer3[bar+1];

         DnDnBuffer3[bar]=DnDnBuffer3[bar+1];

         UpUpBuffer4[bar]=UpUpBuffer4[bar+1];

         UpDnBuffer4[bar]=UpDnBuffer4[bar+1];

         DnUpBuffer4[bar]=DnUpBuffer4[bar+1];

         DnDnBuffer4[bar]=DnDnBuffer4[bar+1];

         UpUpBuffer5[bar]=UpUpBuffer5[bar+1];

         UpDnBuffer5[bar]=UpDnBuffer5[bar+1];

         DnUpBuffer5[bar]=DnUpBuffer5[bar+1];

         DnDnBuffer5[bar]=DnDnBuffer5[bar+1];

         UpUpBuffer6[bar]=UpUpBuffer6[bar+1];

         UpDnBuffer6[bar]=UpDnBuffer6[bar+1];

         DnUpBuffer6[bar]=DnUpBuffer6[bar+1];

         DnDnBuffer6[bar]=DnDnBuffer6[bar+1];

         UpUpBuffer7[bar]=UpUpBuffer7[bar+1];

         UpDnBuffer7[bar]=UpDnBuffer7[bar+1];

         DnUpBuffer7[bar]=DnUpBuffer7[bar+1];

         DnDnBuffer7[bar]=DnDnBuffer7[bar+1];

         UpUpBuffer8[bar]=UpUpBuffer8[bar+1];

         UpDnBuffer8[bar]=UpDnBuffer8[bar+1];

         DnUpBuffer8[bar]=DnUpBuffer8[bar+1];

         DnDnBuffer8[bar]=DnDnBuffer8[bar+1];

        }

     }

//---     

   return(rates_total);

  }

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

//| PlotInit()                                                       |

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

void PlotInit(uint PlotNumber,

              double EmptyValue,

              int DrawBegin,

              int PlotShift)

  {

//--- >ACI5AB2;5=85 A42830 =0G0;0 >BAG5B0 >B@8A>2:8 8=48:0B>@0

   PlotIndexSetInteger(PlotNumber,PLOT_DRAW_BEGIN,DrawBegin);

//--- >ACI5AB2;5=85 A42830 8=48:0B>@0 1 ?> 3>@87>=B0;8 =0 Shift

   PlotIndexSetInteger(PlotNumber,PLOT_SHIFT,PlotShift);

//---

  }

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

//| ArrayInit()                                                      |

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

void ArrayInit(uint ArrNumber,

               double &Array[])

  {

//--- ?@52@0I5=85 48=0<8G5A:>3> <0AA820 2 8=48:0B>@=K9 1CD5@

   SetIndexBuffer(ArrNumber,Array,INDICATOR_DATA);

//--- 8=45:A0F8O M;5<5=B>2 2 1CD5@5 :0: 2 B09<A5@88

   ArraySetAsSeries(Array,true);

//---

  }

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

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