Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawLine()

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

    DrawLine()

    Hi,

    I tried to draw a line on a chart using the DrawLine(), the code worked in a Strategy but not in an Indicator. Is this correct or do I miss something?

    A prompt reply is appreciated.

    #2
    DrawLine() works regardless of if it is from an indicator or a strategy. I suggest you check in your Control Center logs for any errors.

    I suspect you may be running into this: http://www.ninjatrader-support2.com/...ead.php?t=3170
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      DrawLine() works regardless of if it is from an indicator or a strategy. I suggest you check in your Control Center logs for any errors.

      I suspect you may be running into this: http://www.ninjatrader-support2.com/...ead.php?t=3170

      Thank you Josh.

      I ran it like this, but still did not work.
      How do I know my NT has errors, where is the log file located?
      All other NT functions are fine.

      Code:
       
      if (CurrentBar > 2)
      { 
       
        DrawLine("tag1", false, 10, 230, 0, 200,
        Color.LimeGreen, DashStyle.Dot, 2);
        DrawHorizontalLine("tag2", 200, Color.Black);
      }
      Last edited by dowhk; 02-10-2010, 10:26 AM.

      Comment


        #4
        Control Center has a Log tab. You can review them there.

        Your code will not work. Your code is saying to draw the line 10 bars ago. On bar #5, 10 bars do not exist yet so it cannot draw and will have errors. You need to use at least if (CurrentBar < 10) return;.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          Control Center has a Log tab. You can review them there.

          Your code will not work. Your code is saying to draw the line 10 bars ago. On bar #5, 10 bars do not exist yet so it cannot draw and will have errors. You need to use at least if (CurrentBar < 10) return;.

          Thank you again, Josh.

          I found the error message from the Log, and I fixed the problem by changing the CurrentBar numbers.

          Comment

          Latest Posts

          Collapse

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