Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifications to chart WPF elements and tab considerations

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

  • NinjaTrader_ChelseaB
    replied
    Hello calebsandfort,

    You can use the addon approach to send orders with Atm Strategies attached. The addon approach works with any script type.
    http://ninjatrader.com/support/forum...555#post515555

    You could make it a strategy and then use EnterLong()/EnterShort in the buttons Click event handler method. Or you could set a variable that when set triggers an order being placed in a data driven method like OnBarUpdate().




    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    Leave a comment:


  • calebsandfort
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hello All,

    I've made some updates to my examples that modify the WPF elements on a chart to be chart tab specific.

    When the tab is no longer visible the added controls are removed, when the tab is selected, the controls are added back.

    ChartCustomSidePanelExample demonstrates adding a custom column and child grid (what looks like a panel) to the chart grid with a few custom buttons similar to ChartTrader.

    ChartCustomToolbarExample demonstrates adding a custom row above the chart and to the left of the chart to add custom buttons (saving space on the existing chart toolbar).

    ChartTraderModifyExistingButtonsExample modifies the Buy and Sell Market buttons on ChartTrader. Changes the colors and adds an event handler. The original order actions still take place, however, it also triggers an action with the indicator.

    ChartTraderCustomButtonsExample adds custom buttons below the PnL display in ChartTrader and below the Bid and Ask display in ChartTrader.

    To play friendly with other indicators that are modifying the chart, each of these indicators adds rows using the existing chart's TabControl or ChartTrader area as a starting point.

    When terminating the script, the current column and/or row of the object object is found and removed in case another indicator has changed the row number.

    For a look at adding buttons to the rendered chart area, the 'LONG SHORT Toolbar Buttons - NT8' strategy is a great example of adding buttons to the UserControlCollection.
    https://ninjatrader.com/support/foru...php?linkid=697
    (This example is not well named. It doesn't actually add to the toolbar of the chart like my example does. Instead it adds to the actual rendered chart area)


    (Updated June 25th, 2018 - ChartTraderCustomButtonsExample and ChartTraderModifyExistingButtonsExample were missing the removal of the chartWindow.MainTabControl.SelectionChanged handler TabChangedHandler in State.OnTermination)

    (Update Nov 13th, 2018 - Due to new functionality added to resize the ChartTrader Control with a gridsplitter in 8.0.16.0, I've chosen to move the side panel in ChartCustomSidePanelExample to the right of ChartTrader. Small note, the gridsplitter and ChartTrader controls are both in column 1 and only the ChartTrader control spans into column 2 as well.)
    Hi Chelsea

    Thanks for the example. I am curious as to how to go about implementing a Chart Trader button whose click actually submits an order, rather than just prints out a text string. Say I want to place a buy limit order 2 ticks below the current price. Would I do this inside of a strategy instead of an indicator and use AtmStrategyCreate...?

    Thanks

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello saturntd,

    I'm not familiar with this indicator.

    The indicator is moving where a button is placed?

    Leave a comment:


  • saturntd
    replied
    Could I get the button move example in NT7? Since the forum was redone looks like the indicator & strategy libraries were wiped out.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello rafaelmarcos,

    Please see the Update Oct 18th, 2018 note added to this post.
    Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've


    Leave a comment:


  • rafaelmarcos
    replied
    Hello,

    I am afraid that in version 8.0.16.1 something has changed in the way Chart Trader is opened and "ChartCustomSidePanelExample_NT8.zip" has stopped showing correctly the sidebar close to the Chart Trader.

    Could you modify and update the example of the first post to work in the same way?

    Thanks!

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello PN720,

    I would recommend implementing the code in the strategy and then the strategy can handle the buttons directly. You could create your own events for the button presses in the indicator and subscribe to those events in the strategy, however, implementing in the strategy would be an easier solution.

    Here's an article that discusses raising and subscribing to events - https://docs.microsoft.com/en-us/dot...consume-events

    Those concepts fall into the general C# category and outside of the context of NinjaScript, but if you have any other NinjaTrader/NinjaScript related questions we'll be happy to help.

    Leave a comment:


  • PN720
    replied
    Originally posted by NinjaTrader_Jim View Post
    Hello dadarara,

    This correct, the code will have to be implemented in your strategy in order to have the strategy add buttons that can modify its behavior.

    If you have any additional questions, please don't hesitate to ask.
    Hi Jim,
    As a follow-up to this, if I used the indicator code as noted in ChartTraderCustomButtonsExample_NT8.zip, can that indicator return a value so my strategy can detect when Button 1 is clicked for example?

    Leave a comment:


  • NinjaTrader_Jim
    replied
    Hello dadarara,

    This correct, the code will have to be implemented in your strategy in order to have the strategy add buttons that can modify its behavior.

    If you have any additional questions, please don't hesitate to ask.

    Leave a comment:


  • dadarara
    replied
    inside strategy parameter change

    Hi
    I assume that if I want the button to change some parameter in my strategy, than I would need to actually move the code for the buttons to be inside of my strategy not as an indicator.
    am I right ?

    Leave a comment:


  • RandomTask
    replied
    Awesome. Thanks.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi RandomTask,

    Updated. Forgot to remove the chartWindow.MainTabControl.SelectionChanged event handler.

    Leave a comment:


  • aligator
    replied
    Originally posted by NinjaTrader_ChelseaB View Post
    Hi RandomTask,

    There is something goofy going on this script. I'm looking further into this.

    I appreciate you letting me know and I appreciate your patience.
    Hi ChelseaB,

    FWIW, in a similar case, if you duplicate a Tab in a new tab all the indicators will be duplicated in the new tab, including any custom buttons in the main menu. Now, if you change the new tab to a different instrument the buttons will be duplicated and only one of them can be removed by removing the button indicator and the others remain.

    The point is this behavior happens quite often in a duplicated tab and perhaps you can re-create it.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi RandomTask,

    There is something goofy going on this script. I'm looking further into this.

    I appreciate you letting me know and I appreciate your patience.

    Leave a comment:


  • RandomTask
    replied
    ...however. I am unable to duplicate the error from yesterday. I'm not sure what I did to cause it but the custom buttons work properly today.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
51 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
31 views
0 likes
Last Post PaulMohn  
Started by CarlTrading, 03-31-2026, 09:41 PM
1 response
165 views
1 like
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 04-01-2026, 02:41 AM
0 responses
100 views
1 like
Last Post CarlTrading  
Started by CaptainJack, 03-31-2026, 11:44 PM
0 responses
160 views
2 likes
Last Post CaptainJack  
Working...
X