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

dash line on chart for open orders

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

    dash line on chart for open orders

    Is there a way to have a moving dashline on the chart window(if your orders are pegged to some indicator) according to where cover and stoploss orders are? Is there an example of this for a code? I am familar with the AddLine method in indicators, would I just use that in onbarupdate method?

    #2
    Hello Boonfly8,

    Thanks for your post.

    We do not have a documented property to check if an Order is attached to an indicator, but with some use of Intellisense/Intelliprompt, we can see an Order.IsTrackingEnabled property that could potentially be used to identify if the order is attached to an indicator. (This property is undocumented and its use may change as it is not locked into documentation. Please keep this in mind if functionality changes.)

    I may suggest to monitor the strategy's orders in Order objects like seen in the SampleOnOrderUpdate strategy and then to check if the order is attached to an indicator. You will want to use Draw.Line() with your desired DashStyle in OnBarUpdate to draw the line.

    Draw.Line() - https://ninjatrader.com/support/help.../draw_line.htm

    SampleOnOrderUpdate - https://ninjatrader.com/support/help...and_onexec.htm

    Please let me know if I can be of further assistance.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Spank, Yesterday, 04:32 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by onlinebusiness, Today, 02:31 AM
    0 responses
    9 views
    0 likes
    Last Post onlinebusiness  
    Started by kainermy, Today, 02:08 AM
    0 responses
    8 views
    0 likes
    Last Post kainermy  
    Started by bomberone3, 10-16-2017, 12:16 PM
    11 responses
    2,096 views
    0 likes
    Last Post Spank
    by Spank
     
    Started by BQuinton, Yesterday, 11:06 PM
    0 responses
    36 views
    0 likes
    Last Post BQuinton  
    Working...
    X