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 Mikey_, 03-23-2024, 05:59 PM
            3 responses
            49 views
            0 likes
            Last Post Sam2515
            by Sam2515
             
            Started by f.saeidi, Today, 12:14 PM
            7 responses
            16 views
            0 likes
            Last Post f.saeidi  
            Started by Russ Moreland, Today, 12:54 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by philmg, Today, 12:55 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by TradeForge, 04-19-2024, 02:09 AM
            2 responses
            32 views
            0 likes
            Last Post TradeForge  
            Working...
            X