Re: Coding help ...

I have tried to get this indicator support and resistance horizontal rays to 'stop' when it is crossed by the price but retaining the 'ray' horizontal.
Can this be fixed?
I have spent almost a year trying to avoid using this indicator as the 'ray' part can be disabled but visually the chart needs the 'ray' to more easily pick up trades.
Geo IndicatorCrossCCI 17 v2 RAY.mq4
(16.94 KiB) Downloaded 89 times

One *physical* bar before date time.

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

Code: Select all

t - (Bars_Ahead * Period()*60)
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?


Who is online

Users browsing this forum: No registered users and 3 guests