Murrey_Math_Lv

Author: VDV Soft
2 Views
0 Downloads
0 Favorites
Murrey_Math_Lv
ÿþ//+------------------------------------------------------------------+

//|                                               Murrey_Math_Lv.mq5 |

//|                                               Copyright VDV Soft |

//|                                                 vdv_2001@mail.ru |

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

/*

   --------------------------------------------------------------------------------------------

  * 8=88 8/8 8 0/8 (:>=G0B5;L=>5 A>?@>B82;5=85).

  * -B8 ;8=88 A0<K5 A8;L=K5 8 >:07K20NB A8;L=59H85 A>?@>B82;5=8O 8 ?>445@6:C.

   --------------------------------------------------------------------------------------------

  * 8=8O 7/8  (!;010O, <5AB> 4;O >AB0=>2:8 8 @072>@>B0). Weak, Stall and Reverse

  * -B0 ;8=8O A;010. A;8 F5=0 70H;0 A;8H:>< 40;5:> 8 A;8H:>< 1KAB@> 8 5A;8 >=0 >AB0=>28;0AL >:>;> MB>9 ;8=88, 

  * 7=0G8B >=0 @0725@=5BAO 1KAB@> 2=87. A;8 F5=0 =5 >AB0=>28;0AL >:>;> MB>9 ;8=88, >=0 ?@>4>;68B 42865=85 225@E : 8/8.

   --------------------------------------------------------------------------------------------

  * 8=8O 1/8  (!;010O, <5AB> 4;O >AB0=>2:8 8 @072>@>B0). Weak, Stall and Reverse

  * -B0 ;8=8O A;010. A;8 F5=0 70H;0 A;8H:>< 40;5:> 8 A;8H:>< 1KAB@> 8 5A;8 >=0 >AB0=>28;0AL >:>;> MB>9 ;8=88, 

  * 7=0G8B >=0 @0725@=5BAO 1KAB@> 225@E. A;8 F5=0 =5 >AB0=>28;0AL >:>;> MB>9 ;8=88, >=0 ?@>4>;68B 42865=85 2=87 : 0/8.

   --------------------------------------------------------------------------------------------

  * 8=88 6/8 8 2/8 (@0I5=85, @072>@>B). Pivot, Reverse

  * -B8 425 ;8=88 CABC?0NB 2 A2>59 A8;5 B>;L:> 4/8 2 A2>59 A?>A>1=>AB8 ?>;=>ABLN @0725@=CBL F5=>2>5 42865=85.

   --------------------------------------------------------------------------------------------

  * 8=8O 5/8 (5@E B>@3>2>3> 480?07>=0). Top of Trading Range

  * &5=K 2A5E @K=:>2 B@0BOB 40% 2@5<5=8, =0 42865=85 <564C 5/8 8 3/8 ;8=8O<8. 

  * A;8 F5=0 428305BAO >:>;> ;8=88 5/8 8 >AB05BAO >:>;> =55 2 B5G5=88 10-12 4=59, @K=>: A:070; GB> A;54C5B 

  * ?@>4020BL 2 MB>9 «?@5<80;L=>9 7>=5», GB> 8 45;0NB =5:>B>@K5 ;N48, => 5A;8 F5=0 A>E@0=O5B B5=45=F8N >AB020BLAO 

  * 2KH5 5/8, B> >=0 8 >AB0=5BAO 2KH5 =55. A;8, >4=0:>, F5=0 ?0405B =865 5/8, B> >=0 A:>@55 2A53> ?@>4>;68B 

  * ?040BL 40;55 4> A;54CNI53> C@>2=O A>?@>B82;5=8O.

   --------------------------------------------------------------------------------------------

  * 8=8O 3/8 (=> B>@3>2>3> 480?07>=0). Bottom of Trading Range

  * A;8 F5=K =865 MB>9 ;8=8 8 42830NBAO 225@E, B> F5=5 1C45B A;>6=> ?@>18BL MB>B C@>25=L. 

  * A;8 ?@>1820NB 225@E MBC ;8=8N 8 >AB0NBAO 2KH5 =55 2 B5G5=88 10-12 4=59, 7=0G8B F5=K >AB0=CBAO 2KH5 MB>9 ;8=88 

  * 8 ?>B@0BOB 40% 2@5<5=8 42830OAL <564C MB>9 ;8=859 8 5/8 ;8=859.

   --------------------------------------------------------------------------------------------

  * 8=8O 4/8 (;02=0O ;8=8O A>?@>B82;5=8O/?>445@6:8). Major Support/Resistance

  * -B0 ;8=8O >15A?5G8205B =081>;LH55 A>?@>B82;5=85/?>445@6:C. -B>B C@>25=L O2;O5BAO ;CGH8< 4;O =>2>9 ?>:C?:8 8;8 ?@>4068. 

  * A;8 F5=0 =0E>48BAO 2KH5 4/8, B> MB> A8;L=K9 C@>25=L ?>445@6:8. A;8 F5=0 =0E>48BAO =865 4/8, B> MB> ?@5:@0A=K9 C@>25=L 

  * A>?@>B82;5=8O.

   --------------------------------------------------------------------------------------------

  */

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

//|                                               Murrey_Math_Lv.mq5 |

//|                                               Copyright VDV Soft |

//|                                                 vdv_2001@mail.ru |

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

#property copyright "VDV Soft"

#property link      "vdv_2001@mail.ru"

#property version   "1.11"

#property description "0==K9 8=48:0B>@ A>740= =0 >A=>25 8 A 8A?>;L7>20=85< 0;3>@8B<0"

#property description "Vladislav Goshkov (VG) 4vg@mail.ru"

#property description "The given indicator is created on a basis and with algorithm use"

#property description "Vladislav Goshkov (VG) 4vg@mail.ru"

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

#property indicator_chart_window

//---- 4;O @0AGQB0 8 >B@8A>2:8 8=48:0B>@0 8A?>;L7>20=> 13 1CD5@>2

#property indicator_buffers 13

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

#property indicator_plots   13

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

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

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

#define  width_line          2

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

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

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

//--- plot buffer 1

#property indicator_label1  "@0I5=85, @072>@>B [-2/8]" //"extremely overshoot [-2/8]"

#property indicator_type1   DRAW_LINE

#property indicator_color1  DarkBlue

#property indicator_style1  STYLE_SOLID

#property indicator_width1  width_line

//--- plot buffer 2

#property indicator_label2  "!;010O >AB0=>2:0 8 @072>@>B [-1/8]" // "overshoot [-1/8]"

#property indicator_type2   DRAW_LINE

#property indicator_color2  DarkViolet

#property indicator_style2  STYLE_SOLID

#property indicator_width2  width_line

//--- plot buffer 3

#property indicator_label3  ":>=G0B5;L=>5 A>?@>B82;5=85 [0/8]" // "Ultimate Support - extremely oversold [0/8]"

#property indicator_type3   DRAW_LINE

#property indicator_color3  DeepSkyBlue

#property indicator_style3  STYLE_SOLID

#property indicator_width3  width_line

//--- plot buffer 4

#property indicator_label4  "!;010O >AB0=>2:0 8 @072>@>B [1/8]" // "Weak, Stall and Reverse - [1/8]"

#property indicator_type4   DRAW_LINE

#property indicator_color4  Peru

#property indicator_style4  STYLE_SOLID

#property indicator_width4  width_line

//--- plot buffer 5

#property indicator_label5  "@0I5=85, @072>@>B [2/8]" // "Pivot, Reverse - major [2/8]"

#property indicator_type5   DRAW_LINE

#property indicator_color5  Red

#property indicator_style5  STYLE_SOLID

#property indicator_width5  width_line

//--- plot buffer 6

#property indicator_label6  "=> B>@3>2>3> 480?07>=0 [3/8]" // "Bottom of Trading Range - [3/8], if 10-12 bars then 40% Time. BUY Premium Zone"

#property indicator_type6   DRAW_LINE

#property indicator_color6  MediumSeaGreen

#property indicator_style6  STYLE_SOLID

#property indicator_width6  width_line

//--- plot buffer 7

#property indicator_label7  ";02=K5 A>?@>B82;5=85/?>445@6:0 [4/8]" // "Major Support/Resistance Pivotal Point [4/8]- Best New BUY or SELL level"

#property indicator_type7   DRAW_LINE

#property indicator_color7  DarkGray

#property indicator_style7  STYLE_SOLID

#property indicator_width7  width_line

//--- plot buffer 8

#property indicator_label8  "5@E B>@3>2>3> 480?07>=0 [5/8]" // "Top of Trading Range - [5/8], if 10-12 bars then 40% Time. SELL Premium Zone"

#property indicator_type8   DRAW_LINE

#property indicator_color8  MediumSeaGreen

#property indicator_style8  STYLE_SOLID

#property indicator_width8  width_line

//--- plot buffer 9

#property indicator_label9  "@0I5=85, @072>@>B [6/8]" // "Pivot, Reverse - major [6/8]"

#property indicator_type9   DRAW_LINE

#property indicator_color9  Red

#property indicator_style9  STYLE_SOLID

#property indicator_width9  width_line

//--- plot buffer 10

#property indicator_label10  "!;010O >AB0=>2:0 8 @072>@>B [7/8]" // "Weak, Stall and Reverse - [7/8]"

#property indicator_type10   DRAW_LINE

#property indicator_color10  Peru

#property indicator_style10  STYLE_SOLID

#property indicator_width10  width_line

//--- plot buffer 11

#property indicator_label11  ":>=G0B5;L=>5 A>?@>B82;5=85 [8/8]" // "Ultimate Resistance - extremely overbought [8/8]"

#property indicator_type11   DRAW_LINE

#property indicator_color11  DeepSkyBlue

#property indicator_style11  STYLE_SOLID

#property indicator_width11  width_line

//--- plot buffer 12

#property indicator_label12  "!;010O >AB0=>2:0 8 @072>@>B [+1/8]" // "overshoot [+1/8]"

#property indicator_type12   DRAW_LINE

#property indicator_color12  DarkViolet

#property indicator_style12  STYLE_SOLID

#property indicator_width12  width_line

//--- plot buffer 13

#property indicator_label13  "@0I5=85, @072>@>B [+2/8]" // "extremely overshoot [+2/8]"

#property indicator_type13   DRAW_LINE

#property indicator_color13  DarkBlue

#property indicator_style13  STYLE_SOLID

#property indicator_width13  width_line

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

// ?8A0=85 ?5@5G8A;5=8O type_font               |

// ?8A0=85 :;0AA0 CFontName                     | 

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

#include <GetFontName.mqh>

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

//|  %+  " + "                 |

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

input int CalculationPeriod=64;              //5@8>4 @0AG5B0 P

input int StepBack=0;

input bool ViewFlag=false;

input int    FontSize=8;                     //@07<5@ H@8DB0

input type_font FontType=Font7;              //B8? H@8DB0

input string  LableSirname="Murrey_Math_Lv"; //5@20O G0ABL 8<5=8 3@0D8G5A:8E >1J5:B>2

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

//--- indicator buffers

double Buffer1[];

double Buffer2[];

double Buffer3[];

double Buffer4[];

double Buffer5[];

double Buffer6[];

double Buffer7[];

double Buffer8[];

double Buffer9[];

double Buffer10[];

double Buffer11[];

double Buffer12[];

double Buffer13[];

int ShiftBarsForward=100;

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

int min_rates_total;

string sFontType;

string LablesNames[13]=

  {

   "@0I5=85, @072>@>B [-2/8]","!;010O >AB0=>2:0 8 @072>@>B [-1/8]",":>=G0B5;L=>5 A>?@>B82;5=85 [0/8]","!;010O >AB0=>2:0 8 @072>@>B [1/8]",

   "@0I5=85, @072>@>B [2/8]","=> B>@3>2>3> 480?07>=0 [3/8]",";02=K5 A>?@>B82;5=85/?>445@6:0 [4/8]","5@E B>@3>2>3> 480?07>=0 [5/8]",

   "@0I5=85, @072>@>B [6/8]","!;010O >AB0=>2:0 8 @072>@>B [7/8]",":>=G0B5;L=>5 A>?@>B82;5=85 [8/8]",

   "!;010O >AB0=>2:0 8 @072>@>B [+1/8]","@0I5=85, @072>@>B [+2/8]"

  };

color LablesColors[13]; 

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

//| Custom indicator initialization function                         |

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

int OnInit()

  {

//--- =8F80;870F8O ?5@5<5==KE =0G0;0 >BAGQB0 40==KE

   min_rates_total=2*(CalculationPeriod+StepBack)+1;

//--- indicator buffers mapping

   SetIndexBuffer(0,Buffer1,INDICATOR_DATA);

   SetIndexBuffer(1,Buffer2,INDICATOR_DATA);

   SetIndexBuffer(2,Buffer3,INDICATOR_DATA);

   SetIndexBuffer(3,Buffer4,INDICATOR_DATA);

   SetIndexBuffer(4,Buffer5,INDICATOR_DATA);

   SetIndexBuffer(5,Buffer6,INDICATOR_DATA);

   SetIndexBuffer(6,Buffer7,INDICATOR_DATA);

   SetIndexBuffer(7,Buffer8,INDICATOR_DATA);

   SetIndexBuffer(8,Buffer9,INDICATOR_DATA);

   SetIndexBuffer(9,Buffer10,INDICATOR_DATA);

   SetIndexBuffer(10,Buffer11,INDICATOR_DATA);

   SetIndexBuffer(11,Buffer12,INDICATOR_DATA);

   SetIndexBuffer(12,Buffer13,INDICATOR_DATA);

//---   

   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);

   IndicatorSetString(INDICATOR_SHORTNAME,"Murrey_Math_Lv("+IntegerToString(CalculationPeriod)+")");

//---  

   ShiftBarsForward=CalculationPeriod-1;

//---  

   for(int rrr=0; rrr<13; rrr++)

     {

      PlotIndexSetInteger(rrr,PLOT_SHIFT,ShiftBarsForward);

      PlotIndexSetDouble(rrr,PLOT_EMPTY_VALUE,EMPTY_VALUE);

      LablesColors[rrr]=color(PlotIndexGetInteger(rrr,PLOT_LINE_COLOR));

     }

//---

   CFontName FONT;

   sFontType=FONT.GetFontName(FontType);

//---

   return(0);

  }

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

//| Custom indicator deinitialization function                       |

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

void OnDeinit(const int reason)

  {

//----

   ObjectsDeleteAll(0,LableSirname,0,-1);

//----

   ChartRedraw(0);

  }

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

//| Custom indicator iteration function                              |

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

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

  {

//--- check for data

   if(rates_total<min_rates_total) return(0);



   int first=prev_calculated-1;



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

     {

      first=min_rates_total;

      for(int i=0; i<=min_rates_total; i++)

        {

         Buffer1[i]=EMPTY_VALUE;

         Buffer2[i]=EMPTY_VALUE;

         Buffer3[i]=EMPTY_VALUE;

         Buffer4[i]=EMPTY_VALUE;

         Buffer5[i]=EMPTY_VALUE;

         Buffer6[i]=EMPTY_VALUE;

         Buffer7[i]=EMPTY_VALUE;

         Buffer8[i]=EMPTY_VALUE;

         Buffer9[i]=EMPTY_VALUE;

         Buffer10[i]=EMPTY_VALUE;

         Buffer11[i]=EMPTY_VALUE;

         Buffer12[i]=EMPTY_VALUE;

         Buffer13[i]=EMPTY_VALUE;

        }

     }

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

   ArraySetAsSeries(low,true);

   ArraySetAsSeries(high,true);



//--- calculate Murrey_Math

   for(int i=first; i<rates_total; i++) CalcMurreyMath(i,rates_total,high,low);



   for(int i=1; i<=ShiftBarsForward; i++)

     {

      Buffer1[rates_total-i]=Buffer1[rates_total-ShiftBarsForward-1];

      Buffer2[rates_total-i]=Buffer2[rates_total-ShiftBarsForward-1];

      Buffer3[rates_total-i]=Buffer3[rates_total-ShiftBarsForward-1];

      Buffer4[rates_total-i]=Buffer4[rates_total-ShiftBarsForward-1];

      Buffer5[rates_total-i]=Buffer5[rates_total-ShiftBarsForward-1];

      Buffer6[rates_total-i]=Buffer6[rates_total-ShiftBarsForward-1];

      Buffer7[rates_total-i]=Buffer7[rates_total-ShiftBarsForward-1];

      Buffer8[rates_total-i]=Buffer8[rates_total-ShiftBarsForward-1];

      Buffer9[rates_total-i]=Buffer9[rates_total-ShiftBarsForward-1];

      Buffer10[rates_total-i]=Buffer10[rates_total-ShiftBarsForward-1];

      Buffer11[rates_total-i]=Buffer11[rates_total-ShiftBarsForward-1];

      Buffer12[rates_total-i]=Buffer12[rates_total-ShiftBarsForward-1];

      Buffer13[rates_total-i]=Buffer13[rates_total-ShiftBarsForward-1];

     }

     

   SetTLabel(0,LablesNames[0],0,time[rates_total-1],Buffer1[rates_total-1],LablesNames[0],LablesColors[0],sFontType,FontSize);

   SetTLabel(0,LablesNames[1],0,time[rates_total-1],Buffer2[rates_total-1],LablesNames[1],LablesColors[1],sFontType,FontSize);

   SetTLabel(0,LablesNames[2],0,time[rates_total-1],Buffer3[rates_total-1],LablesNames[2],LablesColors[2],sFontType,FontSize);

   SetTLabel(0,LablesNames[3],0,time[rates_total-1],Buffer4[rates_total-1],LablesNames[3],LablesColors[3],sFontType,FontSize);

   SetTLabel(0,LablesNames[4],0,time[rates_total-1],Buffer5[rates_total-1],LablesNames[4],LablesColors[4],sFontType,FontSize);

   SetTLabel(0,LablesNames[5],0,time[rates_total-1],Buffer6[rates_total-1],LablesNames[5],LablesColors[5],sFontType,FontSize);

   SetTLabel(0,LablesNames[6],0,time[rates_total-1],Buffer7[rates_total-1],LablesNames[6],LablesColors[6],sFontType,FontSize);

   SetTLabel(0,LablesNames[7],0,time[rates_total-1],Buffer8[rates_total-1],LablesNames[7],LablesColors[7],sFontType,FontSize);

   SetTLabel(0,LablesNames[8],0,time[rates_total-1],Buffer9[rates_total-1],LablesNames[8],LablesColors[8],sFontType,FontSize);

   SetTLabel(0,LablesNames[9],0,time[rates_total-1],Buffer10[rates_total-1],LablesNames[9],LablesColors[9],sFontType,FontSize);

   SetTLabel(0,LablesNames[10],0,time[rates_total-1],Buffer11[rates_total-1],LablesNames[10],LablesColors[10],sFontType,FontSize);

   SetTLabel(0,LablesNames[11],0,time[rates_total-1],Buffer12[rates_total-1],LablesNames[11],LablesColors[11],sFontType,FontSize);

   SetTLabel(0,LablesNames[12],0,time[rates_total-1],Buffer13[rates_total-1],LablesNames[12],LablesColors[12],sFontType,FontSize);

//--- return value of prev_calculated for next call

   return(rates_total);

  }

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

//|                                                                  |

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

void CalcMurreyMath(int index,const int Rates_total,const double &high[],const double &low[])

  {

//---

   int sht=CalculationPeriod+StepBack;

   int barx=Rates_total-1-index;

   double min=low[ArrayMinimum(low,barx,sht)];

   double max=high[ArrayMaximum(high,barx,sht)];

   double fractal=DetermineFractal(max);

   double range=MathMax(max-min,_Point);

   double sum=MathFloor(MathLog(fractal/range)/MathLog(2));

   double octave=fractal*(MathPow(0.5,sum));

   double mn=MathFloor(min/octave)*octave;

   double mx=mn+octave;

//---

   if(mx<max) mx+=octave;

//---

   double x1=0;

   double x2=0;

   double x3=0;

   double x4=0;

   double x5=0;

   double x6=0;

//---

   double y1=0;

   double y2=0;

   double y3=0;

   double y4=0;

   double y5=0;

   double y6=0;

//---

   double dm=mx-mn;

   double dm2=dm/2;

   double dm4=dm/4;

   double dm8=dm/8;

   double dm16=dm/16;

//---

   if(min>=3*dm/16+mn&&max<=9*dm16+mn) x2=mn+dm2;

   if(min>=mn-dm8 && max<=5*dm8+mn && x2==0) x1=mn+dm2;

   if(min>=mn+7*dm16&&max<=13*dm16+mn) x4=mn+3*dm4;

   if(min>=mn+3*dm8&&max<=9*dm8+mn&&x4==0) x5=mx;

   if(min>=mn+dm8&&max<=7*dm8+mn&&x1==0&&x2==0&&x4==0&&x5==0) x3=mn+3*dm4;

   if(x1+x2+x3+x4+x5==0) x6=mx;

//---

   double finalH=x1+x2+x3+x4+x5+x6;

//---

   if(x1>0) y1=mn;

   if(x2>0) y2=mn+dm4;

   if(x3>0) y3=mn+dm4;

   if(x4>0) y4=mn+dm2;

   if(x5>0) y5=mn+dm2;

//---

   double finalL=y1+y2+y3+y4+y5;

   if(finalH>0 && !finalL) y6=mn;

   finalL+=y6;

   double dmml=(finalH-finalL)/8;

   int bar=index-ShiftBarsForward;

//---

   Buffer1[bar]=(finalL-dmml*2);

   Buffer2[bar]=Buffer1[bar]+dmml;

   Buffer3[bar]=Buffer2[bar]+dmml;

   Buffer4[bar]=Buffer3[bar]+dmml;

   Buffer5[bar]=Buffer4[bar]+dmml;

   Buffer6[bar]=Buffer5[bar]+dmml;

   Buffer7[bar]=Buffer6[bar]+dmml;

   Buffer8[bar]=Buffer7[bar]+dmml;

   Buffer9[bar]=Buffer8[bar]+dmml;

   Buffer10[bar]=Buffer9[bar]+dmml;

   Buffer11[bar]=Buffer10[bar]+dmml;

   Buffer12[bar]=Buffer11[bar]+dmml;

   Buffer13[bar]=Buffer12[bar]+dmml;

//---

   if(!ViewFlag)

     {

      int bar1=bar-1;

      //---  

      if(Buffer1[bar]!=Buffer1[bar1]

         ||Buffer2[bar]!=Buffer2[bar1]

         ||Buffer3[bar]!=Buffer3[bar1]

         ||Buffer4[bar]!=Buffer4[bar1]

         ||Buffer5[bar]!=Buffer5[bar1]

         ||Buffer6[bar]!=Buffer6[bar1]

         ||Buffer7[bar]!=Buffer7[bar1]

         ||Buffer8[bar]!=Buffer8[bar1]

         ||Buffer9[bar]!=Buffer9[bar1]

         ||Buffer10[bar]!=Buffer10[bar1]

         ||Buffer11[bar]!=Buffer11[bar1]

         ||Buffer12[bar]!=Buffer12[bar1]

         ||Buffer13[bar]!=Buffer13[bar1])

        {

         Buffer1[bar1]=EMPTY_VALUE;

         Buffer2[bar1]=EMPTY_VALUE;

         Buffer3[bar1]=EMPTY_VALUE;

         Buffer4[bar1]=EMPTY_VALUE;

         Buffer5[bar1]=EMPTY_VALUE;

         Buffer6[bar1]=EMPTY_VALUE;

         Buffer7[bar1]=EMPTY_VALUE;

         Buffer8[bar1]=EMPTY_VALUE;

         Buffer9[bar1]=EMPTY_VALUE;

         Buffer10[bar1]=EMPTY_VALUE;

         Buffer11[bar1]=EMPTY_VALUE;

         Buffer12[bar1]=EMPTY_VALUE;

         Buffer13[bar1]=EMPTY_VALUE;

        }

     }

//---

  }

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

//|                                                                  |

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

double DetermineFractal(double v)

  {

//---

   if(v<=250000 && v>25000) return(100000);

   if(v<=25000  &&  v>2500) return(10000);

   if(v<=2500 && v>250) return(1000);

   if(v<=250  &&  v>25) return(100);

   if(v<=25  &&  v>12.5) return(12.5);

   if(v<=12.5 && v>6.25) return(12.5);

   if(v<=6.25  &&  v>3.125) return(6.25);

   if(v<=3.125 && v>1.5625) return(3.125);

   if(v<=1.5625 && v>0.390625) return(1.5625);

   if(v<=0.390625 && v>0) return(0.1953125);

//---

   return(0);

  }

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

//|  !>740=85 B5:AB>2>9 ;591K                                        |

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

void CreateTLabel

(

 long   chart_id,         // 845=B8D8:0B>@ 3@0D8:0

 string name,             // 8<O >1J5:B0

 int    nwin,             // 8=45:A >:=0

 datetime X,              // 48AB0=F8O ?> >A8 X

 double   Y,                // 48AB0=F8O ?> >A8 Y

 string text,             // B5:AB

 color  Color,            // F25B B5:AB0

 string Font,             // H@8DB B5:AB0

 int    Size              // @07<5@ H@8DB0

 )

//---- 

  {

//----

   ObjectCreate(chart_id,name,OBJ_TEXT,0,0,0);

      ObjectSetInteger(chart_id,name,OBJPROP_TIME,X);

   ObjectSetDouble(chart_id,name,OBJPROP_PRICE,Y);

   ObjectSetString(chart_id,name,OBJPROP_TEXT,text);

   ObjectSetInteger(chart_id,name,OBJPROP_COLOR,Color);

   ObjectSetString(chart_id,name,OBJPROP_FONT,Font);

   ObjectSetInteger(chart_id,name,OBJPROP_FONTSIZE,Size);

   ObjectSetInteger(chart_id,name,OBJPROP_BACK,false);

//----

  }

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

//|  5@5CAB0=>2:0 B5:AB>2>9 ;591K                                   |

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

void SetTLabel

(

 long   chart_id,         // 845=B8D8:0B>@ 3@0D8:0

 string name,             // 8<O >1J5:B0

 int    nwin,             // 8=45:A >:=0

 datetime X,              // 48AB0=F8O ?> >A8 X

 double   Y,                // 48AB0=F8O ?> >A8 Y

 string text,             // B5:AB

 color  Color,            // F25B B5:AB0

 string Font,             // H@8DB B5:AB0

 int    Size              // @07<5@ H@8DB0

 )

//---- 

  {

//----

   if(ObjectFind(chart_id,name)==-1) CreateTLabel(chart_id,name,nwin,X,Y,text,Color,Font,Size);

   else

     {

      ObjectSetString(chart_id,name,OBJPROP_TEXT,text);

      ObjectSetInteger(chart_id,name,OBJPROP_TIME,X);

      ObjectSetDouble(chart_id,name,OBJPROP_PRICE,Y);

      ObjectSetInteger(chart_id,name,OBJPROP_COLOR,Color);

      ObjectSetString(chart_id,name,OBJPROP_FONT,Font);

      ObjectSetInteger(chart_id,name,OBJPROP_FONTSIZE,Size);

     }

//----

  }

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

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