I want to make an indicator that always draws a vertical line 10 hours ago.
It is displayed 10 hours before the candlestick changes.
Displayed 10 hours before any time bar.
Please teach.
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots 0
#property strict
extern int hour = 10; //
extern ENUM_LINE_STYLE LineStyle = STYLE_DOT; // Lines style
extern int LineWidth = 0; // Lines width
extern color LineColor = clrGray; // Lines color
//------------------------------------------------------------------
//
//------------------------------------------------------------------
int OnInit()
{
return(0);
}
int OnDeinit()
{
ObjectsDeleteAll();
return(0);
}
int start()
{
string name;
datetime time = TimeCurrent()-(3600*hour);
ObjectCreate(name,OBJ_VLINE,0,TimeCurrent()-(3600*hour),0);
ObjectSet(name,OBJPROP_STYLE,LineStyle);
ObjectSet(name,OBJPROP_WIDTH,LineWidth);
ObjectSet(name,OBJPROP_COLOR,LineColor);
ObjectSet(name,OBJPROP_BACK,1);
ObjectSet(name,OBJPROP_SELECTABLE,0);
return(0);
}
It is displayed 10 hours before the candlestick changes.
Displayed 10 hours before any time bar.
Please teach.
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots 0
#property strict
extern int hour = 10; //
extern ENUM_LINE_STYLE LineStyle = STYLE_DOT; // Lines style
extern int LineWidth = 0; // Lines width
extern color LineColor = clrGray; // Lines color
//------------------------------------------------------------------
//
//------------------------------------------------------------------
int OnInit()
{
return(0);
}
int OnDeinit()
{
ObjectsDeleteAll();
return(0);
}
int start()
{
string name;
datetime time = TimeCurrent()-(3600*hour);
ObjectCreate(name,OBJ_VLINE,0,TimeCurrent()-(3600*hour),0);
ObjectSet(name,OBJPROP_STYLE,LineStyle);
ObjectSet(name,OBJPROP_WIDTH,LineWidth);
ObjectSet(name,OBJPROP_COLOR,LineColor);
ObjectSet(name,OBJPROP_BACK,1);
ObjectSet(name,OBJPROP_SELECTABLE,0);
return(0);
}