Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

activate native Ninjatrader drawing tool mode

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

    activate native Ninjatrader drawing tool mode

    Is there a way from a ninjascript indicator to activate a drawing tool mode on a chart in exactly the manner that occurs now when you click on the drawing tool to begin a drawing or when you press the hot keys assigned to the drawing tool?

    What I'm trying to do is to not have a hot key assigned to the drawing tool but instead activate a drawing tool from my indicator by using a hot key decoded by my indicator.

    I'm NOT trying to use the Draw.Line method from my indicator but instead activate the Ninjatrader chart drawing tool mode that gives the drawing tool cursor etc.

    Is there a way to do this?

    If so, can you provide a sample code of what the method call would look like to activate the "line" drawing tool for example.

    Thanks

    #2
    Hello dtl-saw,

    Thank you for your post.

    The DrawingToolTile indicator activates a clicked Drawing Tool using the following code.

    DrawingTools.DrawingTool dt = Core.Globals.AssemblyRegistry[element.Attribute("Assembly").Value].CreateInstance(element.Name.ToString()) as DrawingTools.DrawingTool;

    bb.Click += (sender, args) =>{
    if (ChartControl != null)
    ChartControl.TryStartDrawing(dt.GetType().FullName );
    };

    Please study the DrawingToolTile indicator to see how this works. To view the code for the DrawingToolTile indicator, you would open a New > NinjaScript Editor window, double-click the Indicators folder, then select the DrawingToolTile indicator.

    Let us know if we may assist further.
    <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
    624 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    567 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X