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_Jesse
    replied
    Hello,

    Thank you for the reply.

    To change the position of where items are placed in the panel, you would need to utilize the Column and Row definitions to position your item in the layout grid.

    You can see this is done in the sample in the method InsertWPFControls

    a new column is added to the right of MainTabControl and all items to the right of the MainTabControl are shifted to the right to account for that item. To change this to the left would require that you change this logic to shift the MainTabControl and everything else to the right. You would also need to adjust the logic in RemoveWPFControls to account for the change.

    The width is controlled in the line below this comment:

    Code:
    // a new column is added to the right of MainTabControl
    chartGrid.ColumnDefinitions.Insert((tabControlStartColumn + 1), new System.Windows.Controls.ColumnDefinition() { Width = new GridLength([B]125[/B]) });
    You are controlling the width of the Column you define which is later inserted in the grid.
    In case these concepts are difficult to visualize, these are standard WPF concepts related to Grids which there are many tutorials for online.

    I look forward to being of further assistance.

    Leave a comment:


  • kkc2015
    replied
    Hello, ChelseaB
    Thank you for the useful examples. For the SidePanel example, while I can change the panel background and button colors, could you please advise how to:
    1. Place the side panel on the left side of the chart.
    2. Change the width of the side panel.

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello,

    Thank you for the reply.

    The same concepts can be used in a Strategy, you could reference the Indicator for a sample of the syntax required to append items to the GUI. The concepts in the indicator are able to be used wherever the ChartControl is present.

    To enter strategy orders, you could use the following page as a reference to the commands: http://ninjatrader.com/support/helpG...d_approach.htm

    I look forward to being of further assistance.

    Leave a comment:


  • ClauTrade
    replied
    Hello,

    many thanks for the sample code in first post.

    About "ChartCustomSidePanelExample_NT8.zip" please could you suggest the code to add the action to a strategy?

    For example the code to push Botton 1 >> enter buy market?

    I have not understand how to do it!

    Thanks

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello,

    you can find a short guide to using visual studio for debugging here: http://ninjatrader.com/support/helpG...isual%2Bstudio

    The debug mode is what would flag to compile with symbols so you can utilize breakpoints when attached to NinjaTrader.

    For the image, I am not certain I understand the comparison here. Are you saying that the buttons on the right side are different that the toolbar buttons? If so, yes that would be correct. The toolbar buttons are a specific style whereas the buttons on the right are just the general button style it appears. Could you provide more detail on this question if I am not seeing the correct part of the image?

    I look forward to being of further assistance.

    Leave a comment:


  • Subhash Badri
    replied
    Really helpful

    Chelsea, thanks for the support
    I have couple of questions:
    1. how to develop/debug these addons from the visual studio?, The cs file is placed in the indicators directory and no PDB, so not sure if there is a way to debug these addons
    2. The controls inside the chart are wierd, outside ones are correctly displayed. pasting the screenshot for the inside ones. even the toolbar ones are good.

    thanks,
    Subhash
    Attached Files

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Subhash,

    You have not added the indicator to the chart.

    No indicator will do anything if it is not added to a chart.

    Add the indicator to the chart from the Indicator window.

    Leave a comment:


  • Subhash Badri
    replied
    full process screenshot

    No errors seen in the log tab and no information seen in the "ninja script output" window.
    Attached Files

    Leave a comment:


  • Subhash Badri
    replied
    attaching the chart screenshot

    I do not see any error either in the log of cc or in the ninja output editor.
    Attached Files

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Subhash,

    Please include a screenshot of your chart so that I may see the indicator has been applied.

    Also, are there any errors in the Log tab of the Control Center?

    Leave a comment:


  • Subhash Badri
    replied
    Still not working

    I followed the exact steps like you suggested. I checked the custom\indicators folder and the file is present and I hope that confirms that import was successful.

    I launch the chart but do not see any button controls.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hello Subhash,

    Please remove the altered version from your computer and re-download the ChartCustomSidePanelExample_NT8.zip from post #1.

    I have retested this script and I can assure you it is in a working state.

    Do not export the contents of the .zip file.

    To import a NinjaScript into NinjaTrader 8 do the following:
    1. Download the script to your desktop, keep it in the compressed .zip file.
    2. From the Control Center window select Tools -> Import -> NinjaScript...
    3. Click the Desktop icon on the left to navigate to the desktop
    4. Select the downloaded .zip file -> then click Open
    5. NinjaTrader will then confirm if the import has been successful.


    Critical *Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.


    If you would like assistance importing the script please let me know.

    Leave a comment:


  • Subhash Badri
    replied
    Not able to get the sample working

    Hello Chelsea,
    I have tried your samples, but for some reason I am not able to get them working. I have built the code and put them in the <reg-entry>\nt8\bin\custom. I also verified that the addon gets loaded from the log. I have put the breakpoint in OnStateChange, it does not break into the code nor shows any buttons inside the chart.

    one change i made was "indicator.ChartCustomSidePanelExample(Input); throws a compiler error since indicator is not defined. I have defined it as
    Indicators.Indicator indicator = new Indicators.Indicator();

    any pointers will help a great deal.
    Thanks,
    Subhash

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    Hi alligator,

    I don't have an example already created, but all that is needed is an image object and then set the content of the button to the image.

    Below are publicly available links to a few examples.
    I have issue with set-up image programmatically on button. I have next WPF button: &lt;Button Name="MyBtn" x:FieldModifier="public" HorizontalAlignment="Center" VerticalAlignment="Center" Click="

    Leave a comment:


  • aligator
    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 any custom buttons to (saving space on the existing chart toolbar).

    ChartTraderModifyExistingButtonsExample modifies the Buy and Sell Market buttons on ChartTrader. Changes the colors and a 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.
    *
    ChelseaB,

    Hi, I am looking for a working example button added to the main toolbar using a BitmapImage icon with an image file instead of text or default icons.

    Many Thanks.

    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