Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawline Does Not Work

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

    Drawline Does Not Work

    Is there some trick to get DrawLine to work? I've tried everyway I can think of and it never shows up on the indicator or price panels.
    Attached Files

    #2
    Hi doug_p, welcome to the NinjaTrader forums!

    It works well, but please make sure you incorporate this check at the start of your OnBarUpdate() -

    Code:
    [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] (CurrentBar < [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]10[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])
    [/SIZE][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2];[/SIZE][/SIZE]
    [SIZE=2][SIZE=2][/SIZE][/SIZE]


    See also this tip here for more info - http://www.ninjatrader-support2.com/...ead.php?t=3170

    The issue here is, you try to access 10 bars back on the first bar of the chart, when no bars are present - this throws an error to your Log tab in the Control Center - 'Error on Calling On Bar Update...'
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Can DrawLine Draw Within the Indicator Panel

      Thank You Bertrand for your response it helped.

      Question can DrawLine draw within the indicator panel or does it only draw within the Price Panel 1? Also if it cannot draw within the an indicator panel how does one draw an object like a line or text within a specific indicator panel?

      Thank you for your help.

      Doug

      Comment


        #4
        You are welcome Doug, you can also draw in the indicator panel by setting DrawOnPricePanel to false in your Initialize() - http://www.ninjatrader-support.com/H...ceOnPanel.html

        Unfortunately there's no option to specify to which indicator subpanel to draw the object.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pechtri, 06-22-2023, 02:31 AM
        9 responses
        122 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by frankthearm, 04-18-2024, 09:08 AM
        16 responses
        65 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by habeebft, Today, 01:18 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by benmarkal, Today, 12:52 PM
        2 responses
        13 views
        0 likes
        Last Post benmarkal  
        Started by f.saeidi, Today, 01:38 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X