Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawLine "..., int startBarsAhead???, ..."

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

    DrawLine "..., int startBarsAhead???, ..."

    Hello:
    Is it permissable to start drawing a line forward of a bar using such as "int -2", for 2 bars ahead? If this is not the correct syntax, what do I need to use? I guess the correct question is can one chart beyond the end of the bar data when using leading indicators?

    According to the help section the following is the syntax for a DrawLine:

    DrawLine(string tag, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color)

    Thanks.

    #2
    Hi Tony,

    Welcome to the NinjaTrader support forum and thanks for your post!

    You can only draw lines in locations with a valid bar index connected to it, you can also try the 'DrawHorizontalLine', which will extend infinitely into the future.

    Please review this thread here, it includes a suggestion that may be of interest to you - http://www.ninjatrader-support2.com/...ead.php?t=8522
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Value at 4 bars ago drawn to current bar

      Hello Bertrand:

      Thanks for the help. However, it appears I didn't ask the correct question. All I want to do is, for example, draw a line at a value from 4 bars ago to the current bar[0]. Perhaps the DrawHorizontalLine() will work if it constantly updates as the barsAgo and currentBar moves forward. Am I thinking correctly on this.

      Thanks.

      Comment


        #4
        Hi tonyh,

        you are correct - please see this info here - http://www.ninjatrader-support.com/H.../DrawLine.html

        Then also check the example given, it draws the line to the most currentbar (endBarsAgo = 0).
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Use of Tabs in DrawText() and DrawTextFixed()

          Hello:

          I am trying to utilize the Horizontal Tab (\t) width and alignment features to correctly align price data on a chart using DrawText() and DrawTextFixed(). Should I use something like "public const char Tab" to define the tab, along with a "right justification" as far as alignment goes?
          Thanks.
          Tony

          Comment


            #6
            Hi tonyh,
            Since this is a standard C# command, you want to consult the MSDN site and library for more information on text alignment. Generally speaking, the text will be aligned fine, if you use the same amount of tabs on the same bar.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Philippe56140, Today, 02:35 PM
            0 responses
            1 view
            0 likes
            Last Post Philippe56140  
            Started by 00nevest, Today, 02:27 PM
            0 responses
            1 view
            0 likes
            Last Post 00nevest  
            Started by Jonafare, 12-06-2012, 03:48 PM
            5 responses
            3,986 views
            0 likes
            Last Post rene69851  
            Started by Fitspressorest, Today, 01:38 PM
            0 responses
            2 views
            0 likes
            Last Post Fitspressorest  
            Started by Jonker, Today, 01:19 PM
            0 responses
            2 views
            0 likes
            Last Post Jonker
            by Jonker
             
            Working...
            X