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 hazylizard, Today, 08:38 AM
          2 responses
          9 views
          0 likes
          Last Post hazylizard  
          Started by geddyisodin, Today, 05:20 AM
          2 responses
          18 views
          0 likes
          Last Post geddyisodin  
          Started by Max238, Today, 01:28 AM
          5 responses
          47 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by giulyko00, Yesterday, 12:03 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by habeebft, Today, 07:27 AM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_ChristopherS  
          Working...
          X