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!
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
NinjaTrader
Modifications to chart WPF elements and tab considerations
Collapse
X
-
Thanks. I installed and compiled Custom Chart Trader Buttons yesterday and as I switch tabs I get extra buttons which won't go away when the indicator is removed from the chart.
-
...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.
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHi 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.
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.
Comment
-
-
Originally posted by NinjaTrader_Jim View PostHello 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.
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?
Comment
-
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.JimNinjaTrader Customer Service
Comment
-
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!
Comment
-
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
Chelsea B.NinjaTrader Customer Service
- Likes 1
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello 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.)
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
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by johnMoss, 03-04-2024, 01:53 PM
|
3 responses
46 views
0 likes
|
Last Post
by AndyM
Today, 06:13 PM
|
||
Started by algospoke, Today, 06:01 PM
|
0 responses
8 views
0 likes
|
Last Post
by algospoke
Today, 06:01 PM
|
||
Started by cre8able, Today, 05:53 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 05:53 PM
|
||
Started by Wessel, 03-23-2024, 02:37 PM
|
3 responses
24 views
0 likes
|
Last Post Today, 04:58 PM | ||
Started by martini, Yesterday, 04:45 PM
|
4 responses
32 views
0 likes
|
Last Post
by martini
Today, 04:48 PM
|
Comment