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 rbeckmann05, Yesterday, 06:48 PM
            1 response
            12 views
            0 likes
            Last Post bltdavid  
            Started by llanqui, Today, 03:53 AM
            0 responses
            6 views
            0 likes
            Last Post llanqui
            by llanqui
             
            Started by burtoninlondon, Today, 12:38 AM
            0 responses
            10 views
            0 likes
            Last Post burtoninlondon  
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            15 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            11 views
            0 likes
            Last Post carnitron  
            Working...
            X