do you mean that I would have to select plot on chart ...for the button to work with the strategy ?
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
Addon button for boolean variable
Collapse
X
-
if I open 2 strategy on one chart (2 different accounts ) which one will be connected to the buttons of that instance and that chart ?and the truth is that a strategy usually has nothing to do with the indicators on that chart so how will the strategy know which buttons are associated to this strategy
do you mean that I would have to select plot on chart ...for the button to work with the strategy ?
Last edited by yBl123; 01-10-2024, 11:27 AM.
-
Hello,
Each strategy added to the chart is accessing a separate instance of the indicator, so two strategies mean two separate indicator instances. As mentioned, each indicator instance has its own button.
When you access an indicator in a strategy, it is not actually adding it to the chart for display. This is done via AddChartIndicator(). So if you have two strategies calling the indicator and adding it via AddChartIndicator() for display, the indicator is being added to the chart twice.
Please let me know if you have any further questions.Gaby V.NinjaTrader Customer Service
- Likes 1
Comment
-
Thanks for this clarification ,so to be able to press the button I would indeed need to select plot to chart(this is a option in strategy builder ) for the button to be on the chart , do you know what happens if I add this twice on the same chart will pressing that button which is really 2 buttons on top of each other work for both ?
ok I just tried with indicator you showed me and i see it does not stack the buttons on top of each other ,so i guess this wont workLast edited by yBl123; 01-10-2024, 12:10 PM.
Comment
-
Hello,
Please note you cannot add plots in the Strategy Builder.
It's possible that the indicator buttons would be layered on top of eachother if you have more than one instance added to the chart, if the indicator does not have code to identify if there is already a button within the User Control Collection or use something like a StackPanel. So if you add the indicator twice on the same chart, multiple buttons would be added layered on top of each other and clicking on a button would only affect the one instance of the indicator added by the specific strategy it is tied to.
Take a look at SampleWPFModifications which demonstrates implementing custom logic for adding buttons to new rows in the Chart Trader area without having them overlap.
Please let us know if you have any further questions.Gaby V.NinjaTrader Customer Service
- Likes 1
Comment
-
Originally posted by NinjaTrader_Gaby View PostHello,
Please note you cannot add plots in the Strategy Builder.
It's possible that the indicator buttons would be layered on top of eachother if you have more than one instance added to the chart, if the indicator does not have code to identify if there is already a button within the User Control Collection or use something like a StackPanel. So if you add the indicator twice on the same chart, multiple buttons would be added layered on top of each other and clicking on a button would only affect the one instance of the indicator added by the specific strategy it is tied to.
Take a look at SampleWPFModifications which demonstrates implementing custom logic for adding buttons to new rows in the Chart Trader area without having them overlap.
Please let us know if you have any further questions.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
4 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
52 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
5 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
||
Started by lightsun47, Today, 03:51 PM
|
0 responses
8 views
0 likes
|
Last Post
by lightsun47
Today, 03:51 PM
|
||
Started by 00nevest, Today, 02:27 PM
|
1 response
14 views
0 likes
|
Last Post
by 00nevest
Today, 03:48 PM
|
Comment