Author: Copyright © 2020, Amba404
Price Data Components
Series array that contains open prices of each barSeries array that contains close prices for each barSeries array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains tick volumes of each bar
2 Views
0 Downloads
0 Favorites
AnyTF-mp
ÿþ//+------------------------------------------------------------------+

//|                                                        AnyTF.mq4 |

//|                                        Copyright © 2020, Amba404 |

//|                                         amba-na-fronte@yandex.ru |

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

#property strict

#property copyright "Copyright © 2020, Amba404"

#property link      "amba-na-fronte@yandex.ru"



#property version "1.05"

#property indicator_separate_window

#property indicator_buffers 1

#property indicator_plots   1

#property indicator_label1  "VOL"

#property indicator_type1   DRAW_HISTOGRAM

#property indicator_color1  clrLightSlateGray

#property indicator_style1  STYLE_SOLID

#property indicator_width1  2

//#include <amba_func.mqh>



//---- input parameters

extern string sParSets = "240/120/50 60/120/150"; //Period/Shift/Num Period/Shift/Num...

//extern int          iPeriod = 240;              // TF period, minutes

//extern int           tShift = 120;              // Candles' offset, minutes

//extern int      iNumCandles = 50;               // Number of Candles

int iPeriod, tShift, iNumCandles;

extern bool    bShowVolumes = true;            //Show volumes

//---- colors

extern color     BullCandle = clrLightBlue;

extern color     BearCandle = clrLightSalmon;

extern color     BullShadow = clrLightBlue;

extern color     BearShadow = clrLightSalmon;

//---- mark fractals

extern bool        bMarkFr1 = true;

extern color           cFr1 = clrDarkGray;

extern bool        bMarkFr2 = false;

extern color           cFr2 = clrBrown;

//---- restrictins

extern int FridayHoursClose = 25;               //Closed from Friday, N hour

extern int  MondayHoursOpen = 0;                //Opened from Monday, N hour

double         VOLBuffer[];



string pref="AnyTF";







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

//| candle structure                                                 |

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

struct Candle

  {

   datetime          time_0;     // time to start from

   datetime          time_F;     // time to end

   double            dO;         // Open

   double            dL;         // Low

   double            dH;         // High

   double            dC;         // Close

   datetime          time_H;     // time of Highest

   datetime          time_L;     // time of Lowest

   long              V;          // volume

  };



struct Fr

  {

   datetime          dt;

   double            price;

  };



Fr UF[];

Fr DF[];



Candle data[];



ENUM_TIMEFRAMES BaseTF=0;

ENUM_TIMEFRAMES TF[]= {PERIOD_CURRENT, PERIOD_M1,PERIOD_M5,PERIOD_M15,PERIOD_M30,PERIOD_H1,PERIOD_H4,PERIOD_D1};



bool ValidParams=false;

string ParamSet[];

int ParamInd=0;

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

//|                                                                  |

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

bool ReadParamsFromString(string s)

  {

   bool ret=false;

   string pars[];

   int x=StringSplit(s,StringGetCharacter("/",0),pars);

   if(x==3)

     {

      ret=true;

      iPeriod=(int)pars[0];

      tShift=(int)pars[1];

      iNumCandles=(int)pars[2];



      if(iPeriod<=Period())

         ret=false;

      if(MathMod(iPeriod,Period())!=0)

         ret=false;

      if(MathMod(tShift,Period())!=0)

         ret=false;

      if(MathMod(1440,iPeriod)!=0)

         ret=false;



      if(ret)

        {

         //Print("Param set: ",s);

         ArrayResize(data,iNumCandles);

         if(!IsTesting())

           {

            int x;

            if(tShift==0)

               x=iPeriod;

            else

               x=fmin(fabs(iPeriod),fabs(tShift));



            for(int i=1; i<ArraySize(TF); i++)

               if(fmod(x,TF[i])==0)

                  BaseTF=TF[i];

           }

        }

     }



   return(ret);

  }

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

//|                                                                  |

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

void DelArrElem(string &a[],int i, int step=10)

  {



   int ars=ArraySize(a);

   if(i<ars)

     {

      if(i<ars-1)

         ArrayCopy(a,a,i,i+1);

      ArrayResize(a,ars-1,step);

     }

  }



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

//|                                                                  |

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

int init()

  {



   int n=StringSplit(sParSets,StringGetCharacter(" ",0),ParamSet);



   if(n>0)

     {

      Print(ParamSet[0]);

      int i=ArraySize(ParamSet)-1;

      while(i>=0)

        {

         if(ReadParamsFromString(ParamSet[i]))

           {

            ValidParams=true;

            i--;

           }

         else

            DelArrElem(ParamSet,i);

        }

     }



   SetIndexBuffer(0,VOLBuffer);

   IndicatorSetDouble(INDICATOR_MINIMUM,0);



   EventSetTimer(1);

   CreateControls();

   ObjectSetInteger(0,"AnyTF.BTNVOL",OBJPROP_STATE,bShowVolumes);

   return(0);

  }

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

//| Custom indicator deinitialization function                       |

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

int deinit()

  {

   int obj_total=ObjectsTotal();

   for(int i=obj_total-1; i>=0; i--)

     {

      string name=ObjectName(i);

      if(StringFind(name,pref)>=0)

         ObjectDelete(name);

     }

//Comment("");

   return(0);

  }



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

//|                                                                  |

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

void CreateControls()

  {

   string name;



   name="AnyTF.BTNVOL";

   if(ObjectFind(name)<0)

      ButtonCreate(0,name,0,5,35,72,30,CORNER_LEFT_LOWER,"Volumes");

   ObjectSetInteger(0,"AnyTF.BTNVOL",OBJPROP_STATE,bShowVolumes);



   name="AnyTF.BTNSET-";

   if(ObjectFind(name)<0)

      ButtonCreate(0,name,0,5,60,35,24,CORNER_LEFT_LOWER,"<set");

   name="AnyTF.BTNSET+";

   if(ObjectFind(name)<0)

      ButtonCreate(0,name,0,40,60,35,24,CORNER_LEFT_LOWER,"set>");





  }



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

//|                                                                  |

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

void OnChartEvent(const int id,

                  const long &lparam,

                  const double &dparam,

                  const string &sparam)

  {



   if(id==1 && sparam=="AnyTF.BTNVOL")

     {

      BTNVOL_Click();

      return;

     }

   if(id==1 && sparam=="AnyTF.BTNSET-")

     {

      BTNSET_Click(-1);

      return;

     }

   if(id==1 && sparam=="AnyTF.BTNSET+")

     {

      BTNSET_Click(1);

      return;

     }

  }



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

//|                                                                  |

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

void       BTNSET_Click(int dir)

  {

   int x=ArraySize(ParamSet), newp=ParamInd+dir;

   if(x==0)

      return;

   else

      if(newp<0)

         newp=x-1;

      else

         if(newp>=x)

            newp=0;



   ParamInd=newp;

   ReadParamsFromString(ParamSet[ParamInd]);

   deinit();

   CreateControls();

   RecalcCandles(false);

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

      DrawCandle(i,(isNeed(data[i],data[fmin(i+1,iNumCandles-1)])));



  }



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

//|                                                                  |

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

void BTNVOL_Click()

  {

   bShowVolumes =ObjectGetInteger(0,"AnyTF.BTNVOL",OBJPROP_STATE);

   int subw=WindowFind("AnyTF-mp");

   if(bShowVolumes)

     {

      ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS,subw,100);

     }

   else

     {

      ChartSetInteger(0,CHART_HEIGHT_IN_PIXELS,subw,10);

     }

  }

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

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

  {

   if(ValidParams)

     {

      if(prev_calculated==0)

         BTNVOL_Click();



      // Do we need to recalc all candles or just first incoplete?

      bool bar0=(Time[0]<=data[0].time_F) && (prev_calculated==rates_total);





      if(RecalcCandles(bar0))

        {

         //deinit();

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

            DrawCandle(i,(isNeed(data[i],data[fmin(i+1,iNumCandles-1)])));

        }

      else

         DrawCandle(0,(isNeed(data[0],data[1])));



     }

   return(rates_total);

  }





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

//| Displays negative timers 1) to TF's end and 2) to chart bar end  |

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

void OnTimer()

  {

   datetime time=(data[0].time_F)-TimeCurrent();

   LabelCreate(0,pref+"Lb",0,20,20,CORNER_RIGHT_LOWER,"-"+TimeToString(time,TIME_MINUTES|TIME_SECONDS),"Arial",14,ChartForeColorGet(),0,ANCHOR_RIGHT_LOWER,false,false,false);

   time=(Time[0]+PeriodSeconds())-TimeCurrent();

   LabelCreate(0,pref+"Lb1",0,20,70,CORNER_RIGHT_LOWER,"-"+TimeToString(time,TIME_MINUTES|TIME_SECONDS),"Arial",14,ChartForeColorGet(),0,ANCHOR_RIGHT_UPPER,false,false,false);

   static int cntr=3;

   if(cntr>0)

     {

      cntr--;

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

         DrawCandle(i,(isNeed(data[i],data[fmin(i+1,iNumCandles-1)])));

     }

  }



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

//| Simple func for visual accent. This looks for gap, for examle    |

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

bool isNeed(Candle &cn0,Candle &cn1)

  {

   bool ret=false;   // check result



   double            // some properties of

   h=cn0.dH,

   l=cn0.dL,

   o=cn0.dO,

   c=cn0.dC,

   D=h-l+Point,

   d=fabs(o-c),

   lsh=fmin(o,c)-l+Point,

   hsh=h-fmax(o,c)+Point,

   hshd=D-lsh+Point,

   lshd=D-hsh+Point,

   h1=cn1.dH,

   l1=cn1.dL,

   o1=cn1.dO,

   c1=cn1.dC,

   bH=fmax(c,o),

   bL=fmin(c,o),

   bH1=fmax(c1,o1),

   bL1=fmin(c1,o1),

   d1=fabs(o1-c1),

   D1=h1-l1+Point

      ;

   long

   v=cn0.V,

   v1=cn1.V;



// if this candle (cn0) opens with gap from previos candle's (cn1) close?

// And gap is greater then Spread? And if is really cn0!=cn1?

   ret=fabs(c1-o)>Ask-Bid && cn0.time_0!=cn1.time_0;



   return(ret);

  }

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

//| Recalc custom TF candles                                         |

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

bool RecalcCandles(bool bar0)

  {

   bool ret=false;

   int         PerSec=iPeriod*60;

   datetime    time_0,time_F;

   double      dO,dC,dH,dL;

   int         iSh=0,iBar=0,i=0;



   int limit=Bars;



   while(i<iNumCandles || (bar0 && i<1))

     {

      if(iBar>=limit)

         break;



      time_0=(datetime)MathFloor((1.0*iTime(NULL,BaseTF,iBar)-tShift*60)/PerSec);

      time_0*=PerSec;

      time_0+=tShift*60;

      while(DateRestricted(time_0))

         time_0-=PerSec;



      time_F=time_0+PerSec;

      while(DateRestricted(time_F))

         time_F+=PerSec;



      time_F-=Period()*30;





      iSh=iBarShift(NULL,BaseTF,time_0,true);

      if(iSh<0)

        {

         iSh=iBarShift(NULL,BaseTF,time_0)-1;

         time_0=iTime(NULL,BaseTF,iSh);

        }



      dO=iOpen(NULL,BaseTF,iSh);

      dC=iClose(NULL,BaseTF,iBar);

      int

      shh=iHighest(NULL,BaseTF,MODE_HIGH,iSh+1-iBar,iBar),

      shl=iLowest(NULL,BaseTF,MODE_LOW, iSh+1-iBar,iBar);

      dH=iHigh(NULL,BaseTF,shh);

      dL=iLow(NULL,BaseTF,shl);



      data[i].time_0=time_0;

      data[i].dO=dO;

      data[i].dL=dL;

      data[i].dH=dH;

      data[i].dC=dC;

      data[i].time_F=time_F;

      data[i].time_H=iTime(NULL,BaseTF,shh);

      data[i].time_L=iTime(NULL,BaseTF,shl);

      data[i].V=0;

      for(int x=iSh; x>=iBar; x--)

         data[i].V+=iVolume(NULL,BaseTF,x);



      iSh++;

      iBar=iSh;

      i++;



      ret=!bar0;

     }

   return(ret);

  }

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

//| For candle's drawing                                             |

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

void DrawCandle(int bar, bool bold)

  {

   Candle d=data[bar];



   string name1 = pref+"Shadow"+(string)bar;

   string name2 = pref+(string)bar;

   color clrS=d.dO<d.dC?BullShadow:BearShadow;

   color clrC=d.dO<d.dC?BullCandle:BearCandle;

   int bld=(bold?3:0);



   TrendCreate(0,name1+"l",0,d.time_0,d.dL,d.time_F,d.dL,clrS,0,bld,true,false,false,true);

   TrendCreate(0,name1+"h",0,d.time_0,d.dH,d.time_F,d.dH,clrS,0,bld,true,false,false,true);

   TrendCreate(0,name1+"0",0,d.time_0,d.dL,d.time_0,d.dH,clrS,0,bld,true,false,false,true);

   TrendCreate(0,name1+"f",0,d.time_F,d.dL,d.time_F,d.dH,clrS,0,bld,true,false,false,true);



   if(bar>2 && bar<iNumCandles-2)

     {

      if(bMarkFr1)

        {

         if(data[bar].dH>=data[bar+1].dH && data[bar].dH>=data[bar+2].dH  && data[bar].dH>=data[bar-1].dH && data[bar].dH>=data[bar-2].dH)

            TrendCreate(0,name1+"Fh",0,d.time_0,d.dH,d.time_F,d.dH,cFr1,0,3,true,false,false,true);

         if(data[bar].dL<=data[bar+1].dL && data[bar].dL<=data[bar+2].dL  && data[bar].dL<=data[bar-1].dL && data[bar].dL<=data[bar-2].dL)

            TrendCreate(0,name1+"Fl",0,d.time_0,d.dL,d.time_F,d.dL,cFr1,0,3,true,false,false,true);

        }

      if(bMarkFr2)

        {

         if(data[bar].dL>=data[bar+1].dL && data[bar+1].dL>=data[bar+2].dL  && data[bar].dL>=data[bar-1].dL && data[bar-1].dL>=data[bar-2].dL)

            TrendCreate(0,name1+"FB",0,d.time_0,d.dL,d.time_F,d.dL,cFr2,0,3,true,false,false,true);

         if(data[bar].dH<=data[bar+1].dH && data[bar+1].dH<=data[bar+2].dH  && data[bar].dH<=data[bar-1].dH && data[bar-1].dH<=data[bar-2].dH)

            TrendCreate(0,name1+"FS",0,d.time_0,d.dH,d.time_F,d.dH,cFr2,0,3,true,false,false,true);

        }

     }



   if(!ObjectCreate(name2,OBJ_RECTANGLE,0,d.time_0,d.dO,d.time_F,d.dC))

     {

      ObjectSet(name2,OBJPROP_TIME1,d.time_0);

      ObjectSet(name2,OBJPROP_TIME2,d.time_F);

      ObjectSet(name2,OBJPROP_PRICE1,d.dO);

      ObjectSet(name2,OBJPROP_PRICE2,d.dC);

     }

   ObjectSet(name2,OBJPROP_BACK,true);

   ObjectSetInteger(0,name2,OBJPROP_SELECTABLE,false);

   ObjectSetInteger(0,name2,OBJPROP_SELECTED,false);

   ObjectSetInteger(0,name2,OBJPROP_HIDDEN,true);

   ObjectSet(name2,OBJPROP_COLOR,clrC);



   for(int i=iBarShift(NULL,0,d.time_0); i>=iBarShift(NULL,0,d.time_F); i--)

      VOLBuffer[i]=(double)d.V;



  }

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

//| if time is forbidden. Some simple rule. Useness for bars union   |

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

bool DateRestricted(datetime dt)

  {

   bool ret=false;

   int ct=FmtTime(dt);

   ret=(ct>=5*100+FridayHoursClose || ct<1*100+MondayHoursOpen);

   return ret;

  }

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

//|                                                                  |

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

int FmtTime(datetime dt)

  {

   int ret=0;

   MqlDateTime str1;

   TimeToStruct(dt,str1);

   ret=str1.day_of_week*100+str1.hour;

   return ret;

  }

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



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

//| Func from MQL.Help, with some changes                            |

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

bool TrendCreate(const long            chart_ID=0,

                 const string          name="TrendLine",

                 const int             sub_window=0,

                 datetime              time1=0,

                 double                price1=0,

                 datetime              time2=0,

                 double                price2=0,

                 const color           clr=clrRed,

                 const ENUM_LINE_STYLE style=STYLE_SOLID,

                 const int             width=1,

                 const bool            back=false,

                 const bool            selection=true,

                 const bool            ray_right=false,

                 const bool            hidden=false,

                 const long            z_order=0)

  {

   ResetLastError();

   if(!ObjectCreate(chart_ID,name,OBJ_TREND,sub_window,time1,price1,time2,price2))

     {

      ObjectSet(name,OBJPROP_TIME1,time1);

      ObjectSet(name,OBJPROP_TIME2,time2);

      ObjectSet(name,OBJPROP_PRICE1,price1);

      ObjectSet(name,OBJPROP_PRICE2,price2);

     }

   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);

   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);

   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width);

   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);

   ObjectSetInteger(chart_ID,name,OBJPROP_RAY_RIGHT,ray_right);

   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);

   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);

   return(true);

  }



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

//| Func from MQL.Help, with some changes                            |

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

bool LabelCreate(const long              chart_ID=0,

                 const string            name="Label",

                 const int               sub_window=0,

                 const int               x=0,

                 const int               y=0,

                 const ENUM_BASE_CORNER  corner=CORNER_LEFT_UPPER,

                 const string            text="Label",

                 const string            font="Arial",

                 const int               font_size=10,

                 const color             clr=clrRed,

                 const double            angle=0.0,

                 const ENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_UPPER,

                 const bool              back=false,

                 const bool              selection=false,

                 const bool              hidden=true,

                 const long              z_order=0)

  {

   ResetLastError();

   if(ObjectFind(name)<0)

      if(!ObjectCreate(chart_ID,name,OBJ_LABEL,sub_window,0,0))

        {

         Print(__FUNCTION__," ",chart_ID," ",ObjectFind(name),

               ": =5 C40;>AL A>740BL B5:AB>2CN <5B:C! >4 >H81:8 = ",GetLastError());

         return(false);

        }

   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);

   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);

   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);

   ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);

   ObjectSetString(chart_ID,name,OBJPROP_FONT,font);

   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size);

   ObjectSetDouble(chart_ID,name,OBJPROP_ANGLE,angle);

   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor);

   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);

   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);

   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);

   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);

   return(true);

  }



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

//| Get foreground color                                             |

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

color ChartForeColorGet(const long chart_ID=0)

  {

   long result=clrNONE;

   ResetLastError();

   if(!ChartGetInteger(chart_ID,CHART_COLOR_FOREGROUND,0,result))

     {

      Print(__FUNCTION__+", Error Code = ",GetLastError());

     }

   return((color)result);

  }

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

bool ButtonCreate(const long              chart_ID=0,               // ID 3@0D8:0

                  const string            name="Button",            // 8<O :=>?:8

                  const int               sub_window=0,             // =><5@ ?>4>:=0

                  const int               x=0,                      // :>>@48=0B0 ?> >A8 X

                  const int               y=0,                      // :>>@48=0B0 ?> >A8 Y

                  const int               width=50,                 // H8@8=0 :=>?:8

                  const int               height=18,                // 2KA>B0 :=>?:8

                  const ENUM_BASE_CORNER  corner=CORNER_LEFT_UPPER, // C3>; 3@0D8:0 4;O ?@82O7:8

                  const string            text="Button",            // B5:AB

                  const string            font="Arial",             // H@8DB

                  const int               font_size=10,             // @07<5@ H@8DB0

                  const color             clr=clrBlack,             // F25B B5:AB0

                  const color             back_clr=C'236,233,216',  // F25B D>=0

                  const color             border_clr=clrNONE,       // F25B 3@0=8FK

                  const bool              state=false,              // =060B0/>B60B0

                  const bool              back=false,               // =0 704=5< ?;0=5

                  const bool              selection=false,          // 2K45;8BL 4;O ?5@5<5I5=89

                  const bool              hidden=true,              // A:@KB 2 A?8A:5 >1J5:B>2

                  const long              z_order=0)                // ?@8>@8B5B =0 =060B85 <KHLN

  {

   ResetLastError();

   if(!ObjectCreate(chart_ID,name,OBJ_BUTTON,sub_window,0,0))

     {

      Print(__FUNCTION__,

            ": =5 C40;>AL A>740BL :=>?:C! >4 >H81:8 = ",GetLastError());

      return(false);

     }

   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);

   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);

   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width);

   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height);

   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);

   ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);

   ObjectSetString(chart_ID,name,OBJPROP_FONT,font);

   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size);

   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);

   ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr);

   ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr);

   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);

   ObjectSetInteger(chart_ID,name,OBJPROP_STATE,state);

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);

   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);

   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);

   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);

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