Hello again,
I need your help (always...)
I am trying to draw VLINEs one bar (what ever the time frame is switched) before a date time (in my case, begining of each week).
Code: Select all
datetime t = iTime(NULL,PERIOD_W1,i);
int Bars_Ahead =1;
if (t>0)
{
ObjectCreate("Line "+DoubleToStr(i,0),OBJ_VLINE,0,t,0);
//ObjectSet("Line "+DoubleToStr(i,0),OBJPROP_TIME,t);
ObjectSet("Line "+DoubleToStr(i,0),OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("Line "+DoubleToStr(i,0),OBJPROP_COLOR,colir);
ObjectSet("Line "+DoubleToStr(i,0),OBJPROP_WIDTH,1);
ObjectSet("Line "+DoubleToStr(i,0),OBJPROP_BACK,true);
ObjectCreate("Line2 "+DoubleToStr(i,0),OBJ_VLINE,0, t - (Bars_Ahead * Period()*60),0);
thought i have found the answer by
But it didn't work.
I want the 2nd VLINE place ONE BAR before the datetime "t".
If I am on D1 PERIOD, I want the 2nd VLINE one bar (one day) before,
If I am on H4 PERIOD, I want the 2nd VLINE one bar (4 hours) before,
If I am on H1 PERIOD, I want the 2nd VLINE one bar (1 hour) before ... etc
Can you help me please?
Regards.