Announcement

Collapse
No announcement yet.

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.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    637 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    571 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X