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

How to change the isGlobal bool parameter of a line after it has been drwan manually.

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

    How to change the isGlobal bool parameter of a line after it has been drwan manually.

    Hello!

    I can set this parameter to true in a script using Draw.Line() with the following signatures:
    Code:
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, bool isGlobal, string templateName)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, bool isGlobal, string templateName)​
    But how can I set it for a manually drawn line?

    #2
    Hello Gianpiero,

    Thanks for your post.

    A manually drawn drawing tool will not be interacted with by your script. To programmatically draw a line globally, you would need to use the Draw.Line() method overload that allows you to specify the IsGlobal drawing property.

    The Draw.Line() syntax below could be used to draw a line globally in a NinjaScript.

    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, bool isGlobal, string templateName)
    Draw.Line(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, bool isGlobal, string templateName)


    See this help guide page for more information about Draw.Line(): https://ninjatrader.com/support/help.../draw_line.htm

    To change a manually drawn object to be globally drawn, you could right-click on the chart, select 'Drawing Tools' > 'Drawing Objects', choose the line drawing you want to make global, and modify the 'Attach to' drop-down menu to <Instrument> (All charts).

    See this help guide page: https://ninjatrader.com/support/help...jectProperties

    Please let me know if I may assist further.​
    Last edited by NinjaTrader_BrandonH; 01-15-2023, 04:36 PM.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Brevo, Today, 01:45 AM
    0 responses
    2 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    238 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X