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
-
Addon button for boolean variable
Is there a way to add a button to the chart window that is tied to a boolean variable that can then be used in a strategy? Basically I want to be able to enable/disable a strategy with a single click directly from the chart window. Doing so thru the strategy button requires 3 clicks and mouse movement, which at times takes too long.Tags: None
-
Hello slimcactus,
Thanks for your post and welcome to the NinjaTrader forums!
Yes, you can do that!
Below I have provided a link to an example called long and short toolbar buttons (They are actually chart buttons).
This strategy is publicly available on our NinjaTrader Ecosystem website:Here is a basic guideline of how to import NinjaScript add-ons in NinjaTrader 8:
Note — To import NinjaScripts you will need the original .zip file.
To Import:- Download the NinjaScripts to your desktop, keep them in the compressed .zip file.
- From the Control Center window select the menu Tools > Import > NinjaScript Add-on...
- Select the downloaded .zip file
- NinjaTrader will then confirm if the import has been successful.
Here is a short video demonstration of the import process: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.
Paul H.NinjaTrader Customer Service
-
Worked live a charm. Thank you. This is so much faster than toggling the "Enabled" button inside the strategy window, especially since NT sometimes takes 8-10s to start or stop the script. I was also able to make the button change color based on the state.
Comment
-
Hello,
Can you clarify what you mean by 'seeing the buttons in the Strategy Builder'?
Indicators will only be accessible in the Strategy Builder if the indicator contains a plot and a value is assigned to that plot. The Strategy Builder would then be able access that plot's value in the Conditions and Actions screen.
This indicator does not add any plots via AddPlot(), it's just demonstrating adding WPF modifications to a chart.Gaby V.NinjaTrader Customer Service
Comment
-
Hello,
Please see this forum post which explains exposing indicator plot values to the Strategy Builder:
I'm trying to expose my variables to the strategy builder so everyone can have better use of the WaveTrend indicator (it has a lot of code). Explain this to me like I am 5 because this isnt the first time I've tried to figure it out and hit a wall. What is Series? I know its like an array that stores bars. Why not just call it
You can set a plot value when a value is clicked, and then read that as signal in a Strategy Builder strategy. This would require using TriggerCustomEvent():
Please see this script as an example, specifically '#region Use case 2, submitting a limit order with limit price updated to indicator plot values'.
I need some guidance. I need to create a script that has 3 plots that are public and they plot either a 1 or 0. But I need to create another indicator that has 3 chart buttons that sets these variables. The first indicator needs to get those values from the second indicator depending on the button clicks. Because of using
Instead of submitting an order in the TriggerCustomEvent() call, you could instead set a plot value that could then be accessed via the Strategy Builder.
Please let us know if you have any further questions.Gaby V.NinjaTrader Customer Service
- Likes 1
Comment
-
Hello,
Each indicator will have a separate button since this is triggered by button press.
If you wanted to click a single button and have that button affect multiple strategies, yes you would have to use a static class variable.
Please note that that is not officially supported, so you would implement this at your own risk. Additionally, to implement this you would need to unlock the strategy and code it by hand, so it would not be accessible via the Strategy Builder.
Here is an example script demonstrating using a static class:
If you have any further questions please let us know.
Gaby V.NinjaTrader Customer Service
Comment
-
Hello,
Every strategy that uses an instance of the indicator only has access to that specific instance of the indicator. Each instance of the indicator has its own button, so the button press will only affect the strategy that is using that indicator instance.
Please let me know if I can clarify further.
Gaby V.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by slightly, Today, 12:49 AM
|
0 responses
2 views
0 likes
|
Last Post
by slightly
Today, 12:49 AM
|
||
Started by sdauteuil, 09-23-2021, 10:16 AM
|
4 responses
1,208 views
0 likes
|
Last Post Yesterday, 11:41 PM | ||
Started by agclub, 04-21-2024, 08:57 PM
|
5 responses
34 views
0 likes
|
Last Post
by agclub
Yesterday, 09:47 PM
|
||
Started by ESHunter, Yesterday, 08:06 PM
|
2 responses
18 views
0 likes
|
Last Post
by ESHunter
Yesterday, 09:27 PM
|
||
Started by ETFVoyageur, 05-07-2024, 07:05 PM
|
19 responses
150 views
0 likes
|
Last Post
by ETFVoyageur
Yesterday, 09:14 PM
|
Comment