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

    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).

        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.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            24 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            120 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            63 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            41 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            45 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X