Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Lines not showing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Lines not showing

    Hello

    I have a script that is supposed to draw some lines, the lines are visible in the drawing objects list, the prints are showing, but they do not appear on the chart.
    The code is below and I can't figure out why this is happening, as other parts of the script with identical syntax are drawing the lines correctly.

    Code:
    if (Slope(Highs[0], 5, 0) > 0 && Slope (DMI1, 5, 0) < 0)
                {
                    Print ("CB Consec Neg Div = " + CurrentBar + "\n ");
                    Draw.Line(this, "Consec Neg Div " + " / P S " + (CurrentBar - 5) + " / P E " + CurrentBar,                                
                        true, CurrentBar - 5, Highs[0][5], CurrentBar, Highs[0][0], Brushes.Yellow, divDashStyle, 1, true);
    
                    Draw.Line(this, "Consec DMI Neg Div " + " / Dmi S " + (CurrentBar - 5) + " / Dmi E " + CurrentBar, 
                        true, CurrentBar - 5, DMI1[5], CurrentBar, DMI1[0], Brushes.Yellow, divDashStyle, 1, false);                            
                }

    #2
    Hello itrader46,

    Thanks for your post.

    It looks like you are drawing a line (Consec Neg Div) that would be on the price panel based on Highs[0][5] while the other line would be drawn at a small value of DMI1[5]. Do you see one or the other of these lines on the chart? If you scroll all the way to zero do you see the "Consec DMI Neg Div" line?

    What is your indicator setting for IsOverlay and for DrawOnpricePanel? (these are in OnStateChange() under State.SetDefaults).



    Comment


      #3
      I can't see the lines on the chart, but in the list of drawing objects they appear with the right tags

      Comment


        #4
        Hello itrader46,

        Thanks for your reply.

        Can you confirm that " If you scroll all the way to zero do you see the "Consec DMI Neg Div" line?" you went to the zero line in the chart and do not see any line?. (To do this you would left click in the price column and drag down to shrink the price scale (you may need to do that several times) and/or you can hold down the CTRL key while you left click and drag down in the price column so that eventually you see the zero price level.

        Also, "What is your indicator setting for IsOverlay and for DrawOnpricePanel? (these are in OnStateChange() under State.SetDefaults)."

        Can you provide a screesnhot of the Draw object panel that shows these lines and please display the "Data" selection that shows their data values.

        Comment


          #5
          Got it now: mistook bar index (CurrentBar - 5 ) for BarsAgo parameter of the Draw method ... again...

          Your suggestion to check the line data helped me find my error

          Thanks for your help

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          650 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          577 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X