//+------------------------------------------------------------------+
//|                                                 ZeroVertical.mq4 |
//+------------------------------------------------------------------+
#property copyright "2023,ZVL"
#property version   "1.00"

//
//
//

#property indicator_chart_window

input color           upColor    = clrLime;
input color           dnColor    = clrRed;
input color           nuColor    = clrGold;
input ENUM_LINE_STYLE line_style = STYLE_DOT;
int i;

struct sGloStruct
{
   color  bClr;
};
sGloStruct glo;

int init()
  {
   IndicatorShortName("ZeroVertical");
   return(0);
  }
//----
int deinit()
  {
   if(ObjectFind("ZeroVertical") != -1) ObjectDelete("ZeroVertical");
   return(0);
  }
//----
int start()
  {
   glo.bClr = nuColor;
   if (Close[0]<Open[0]) glo.bClr = dnColor;
   if (Close[0]>Open[0]) glo.bClr = upColor;
   if(ObjectFind("ZeroVertical") != -1) ObjectDelete("ZeroVertical");
   ObjectCreate("ZeroVertical",OBJ_VLINE,0,Time[0],0);
   ObjectSet("ZeroVertical",OBJPROP_COLOR,glo.bClr);
   ObjectSet("ZeroVertical",OBJPROP_STYLE,line_style);
   ObjectSet("ZeroVertical",OBJPROP_WIDTH,1);
   return(0);
  }