Vertical line on candle 0

To add comments, please log in or register
Hadi Ein Jafari
693
Hadi Ein Jafari  

hi dears

i want to indicator for draw vertical line on candle 0  at all time frame 

properties : draw object as background

description with monthly time frame 

style 2 

color :blue 



any body can help me ?

Petr Nosek
1280
Petr Nosek  
Hadi Ein Jafari:

hi dears

i want to indicator for draw vertical line on candle 0  at all time frame 

properties : draw object as background

description with monthly time frame 

style 2 

color :blue

any body can help me ?

I don't know what you mean by "description with monthly time frame" but I'll post bellow a simple MQL4 code.

//+------------------------------------------------------------------+
//|                                   NTC_VerticalLineCurrentBar.mq4 |
//|                                              Copyright 2018, NTC |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, NTC"
#property version   "1.00"
#property strict
#property indicator_chart_window

#define OBJ_NAME  "NTC_VLCB"

int OnInit()
  {
   ObjectDelete(0,OBJ_NAME);
   ObjectCreate(0,OBJ_NAME,OBJ_VLINE,0,TimeCurrent(),0.0);
   ObjectSetInteger(0,OBJ_NAME,OBJPROP_BACK,true);
   ObjectSetInteger(0,OBJ_NAME,OBJPROP_STYLE,2);
   ObjectSetInteger(0,OBJ_NAME,OBJPROP_COLOR,clrBlue);
   ObjectSetInteger(0,OBJ_NAME,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(0,OBJ_NAME,OBJPROP_HIDDEN,true);
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   ObjectDelete(0,OBJ_NAME);
  }

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(rates_total>prev_calculated)
      ObjectSetInteger(0,OBJ_NAME,OBJPROP_TIME,0,time[0]);
   return(rates_total);
  }
To add comments, please log in or register