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

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.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    603 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    22 views
    0 likes
    Last Post xiinteractive  
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    21 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    230 views
    0 likes
    Last Post TradingLoss  
    Working...
    X