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

NT 6.5.9 DrawLine out of range error

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

    NT 6.5.9 DrawLine out of range error

    When using the following statement:
    DrawLine("tag1",10, ChannelPoints[2].Price, 1, ChannelPoints[0].Price, Color.DarkTurquoise);
    I get the following error when trying to use the DrawLine command in my NinjaScript Strategy:
    DrawLine: startBarsAgo out of valid range 0 through 6, was 10. source = NinjaTrader.Core

    The problem is that I have over 30 bars in my chart, so trying to go too far back is not the problem. The result of the CurrentBar statement just before the DrawLine command returns 32.
    Last edited by astrolobe; 02-19-2008, 04:32 AM.

    #2
    Your issue likely is related to here: http://www.ninjatrader-support.com/v...ead.php?t=3170

    Comment


      #3
      Thanks for the quick response.
      When I check the CurrentBar before the DrawLine statement, the value is 32. I am am only trying to start my line from 10 bars back...there has to be another explanation, besides too few bars on the chart.

      thanks.

      Comment


        #4
        I suggest debugging your NinjaScript as per here: http://www.ninjatrader-support.com/v...ead.php?t=3418

        Comment


          #5
          I have plenty of Print statements around the DrawLine statement. The issue is very simple...I have over 30 bars on my chart, as per the printout of the CurrentBar value at the time of trying the DrawLine. I am only trying to start the line from 10 bars back.
          The NT error is telling me the startBarsAgo value must be between 0 and 6. Implying that there are no more than seven bars on the chart. However, I can see 32 bars on my chart, and CurrentBar is confirming that.

          Comment


            #6
            I suggest starting from scratch by a simple as possible indicator to understand where your logic breaks. If you got a simple DrawLine statements working you could add your custom logic step by step to understand which step causes the failure.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by timmbbo, Today, 08:59 AM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by KennyK, 05-29-2017, 02:02 AM
            2 responses
            1,281 views
            0 likes
            Last Post marcus2300  
            Started by fernandobr, Today, 09:11 AM
            0 responses
            3 views
            0 likes
            Last Post fernandobr  
            Started by itrader46, Today, 09:04 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by bmartz, 03-12-2024, 06:12 AM
            5 responses
            33 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Working...
            X