Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 reynoldsn, Today, 02:34 PM
          0 responses
          6 views
          0 likes
          Last Post reynoldsn  
          Started by nightstalker, Today, 02:05 PM
          0 responses
          9 views
          0 likes
          Last Post nightstalker  
          Started by llanqui, Yesterday, 09:59 AM
          8 responses
          28 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by quicksandatl, Today, 01:39 PM
          1 response
          6 views
          0 likes
          Last Post quicksandatl  
          Started by md4866, 05-01-2024, 08:15 PM
          2 responses
          18 views
          0 likes
          Last Post md4866
          by md4866
           
          Working...
          X