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 TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    541 views
    0 likes
    Last Post PaulMohn  
    Started by GLFX005, Today, 03:23 AM
    0 responses
    2 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    7 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    14 views
    0 likes
    Last Post TradeForge  
    Working...
    X