Moving forward this will be maintained in the Desktop SDK reference samples and no longer maintained on the forum.
Desktop SDK: Creating Chart WPF (UI) Modifications from an Indicator
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 'ChartOrderButtonsExamples_NT8' strategy and indicator is a great example of adding buttons to the UserControlCollection.
NinjaScript Developer Example: https://support.ninjatrader.com/s/ar...-Order-Buttons
(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.)
(Update Oct 25th, 2020 - See a new version of these indicators. This post will remain to see history of changes.
https://ninjatrader.com/support/foru...07#post1124507)
Moving forward this will be maintained in the Desktop SDK reference samples and no longer maintained on the forum.
Desktop SDK: Creating Chart WPF (UI) Modifications from an Indicator
Comment