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
Button in the Chart Trader - how to find out the indicator values.
Collapse
X
-
Hello webus,
If you used an indicator to add the buttons you could just use normal indicator series or call other indicators. For example Close[0] or Time[0].
From the button event you would also have to wrap the code with a TriggerCustomEvent action: https://ninjatrader.com/support/help...=triggercustom
Code:TriggerCustomEvent(o => { //your NS code }, null);
I look forward to being of further assistance.JesseNinjaTrader Customer Service
-
Hi NinjaTrader_Jesse,
Originally posted by NinjaTrader_Jesse View PostHello webus,
If you used an indicator to add the buttons you could just use normal indicator series or call other indicators. For example Close[0] or Time[0].
From the button event you would also have to wrap the code with a TriggerCustomEvent action: https://ninjatrader.com/support/help...=triggercustom
Code:TriggerCustomEvent(o => { //your NS code }, null);
I look forward to being of further assistance.
When I click on a button and try to get, for example, the close time of the last closed bar (Closes[0][0].ToString()) - I will get the close time of the oldest (very first) bar on the chart. The same is with the indicator value. I will get the value of the oldest bar (not the last closed).
It seems to me that pressing the buttons does not see the actual values. How do I get the values that I expect and that match the chart?
Comment
-
Hello webus,
Can you please clarify it in more detail?
If some part of that sample or the help guide is not clear can you specify what you are having trouble with or provide a sample of what you tried in relation to the TriggerCustomEvent?
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
Comment
-
Hi NinjaTrader_Jesse,
Originally posted by NinjaTrader_Jesse View PostHello webus,
What more would you like detailed here? This is a simplified sample and I had included a comment about where your code would go, did you have a question with the sample or the link I provided? The help guide describes what the TriggerCustomEvent is and why that would be used. In a button event that would be required for your code to work otherwise what you are seeing is expected because that is not a NinjaScript event that is a WPF button event.
If some part of that sample or the help guide is not clear can you specify what you are having trouble with or provide a sample of what you tried in relation to the TriggerCustomEvent?
I look forward to being of further assistance.
Is there any working example for buttons?
Could you please provide an example, how can I find out, for example, the closing price of the last closed bar in this way?
Comment
-
Hello webus,
We don't have any additional samples for this aside from the two in the help guide and the one I provided. This method makes use of a Lambda expression, if you are not familiar with that topic in C# I would suggest to research that so you have a good understanding of what this syntax is. A lot of the more advanced NinjaScript items will use standard C# concepts so it is good to get a firm understanding of C# concepts to aid in NinjaScript development. https://docs.microsoft.com/en-us/dot...da-expressions
I had provided a working example in post 2, I also cut out the unnecessary parts that the help guide shows to simplify it further. This is a working example:
Code:TriggerCustomEvent(o => { //your NS code }, null);
If this is not clear can you try adding this to your script and then post the code you tried so I can understand what difficulty you are having here?
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
Comment
-
Originally posted by webus View Post
Comment
-
Hello trevor14,
You can find some examples of adding content to the chart trader here:
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
Please let me know if I may be of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Kaledus, Today, 01:29 PM
|
0 responses
3 views
0 likes
|
Last Post
by Kaledus
Today, 01:29 PM
|
||
Started by PaulMohn, Today, 12:36 PM
|
1 response
16 views
0 likes
|
Last Post Today, 01:23 PM | ||
Started by yertle, Yesterday, 08:38 AM
|
8 responses
37 views
0 likes
|
Last Post
by ryjoga
Today, 01:22 PM
|
||
Started by rdtdale, Today, 01:02 PM
|
1 response
6 views
0 likes
|
Last Post Today, 01:13 PM | ||
Started by alifarahani, Today, 09:40 AM
|
3 responses
19 views
0 likes
|
Last Post Today, 12:47 PM |
Comment