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
StrategyPlot in NT8
Collapse
X
-
Lee,
You would add the additional plot to something like the SampleOverlayPlot example. After that they would be in the same panel, and then you could set the panel from the strategy.
-
Hi Josh,
I figured out the issue with the CS0029 error. I needed to change the name of the strategy (SampleStrategyPlot) in the SamplePanelPlot indicator to the name of my strategy.
But how do I add multiple plots to this same panel? Do I do it in the SamplePanelPlot indicator [by adding another AddPlot()] or can I do it in my strategy? What is the process for plotting multiple plots on the same panel?
Thanks,
Lee
Leave a comment:
-
Lee,
I am not sure why you would get that error with that snippet. I would expect it to compile fine if used in the same context as the sample strategy,
What is the specific error description that is displayed next to the error code?Last edited by NinjaTrader_JoshG; 01-25-2019, 12:56 PM.
Leave a comment:
-
Hi Josh,
I'm trying to follow along with the SampleStrategyPlot for NT8. I'm bringing the code line by line over to my strategy. But I keep getting a CS0029 error on the sampleOverlayPlot.Strategy = this; in my strategy when compiling. Any ideas?
Thanks,
Lee
Leave a comment:
-
lee612801,
You are correct. You would not be able to use AddChartIndicator() without that plot actually being its own indicator.
As far as why it's different specifically I am not sure. A lot of things that were created in Inititialize() in NT7 have been changed to work most efficiently with NT8's OnStateChange() method. You can most easily see the changes made for this concept by comparing the NT7 'Plot from a strategy' sample to the NT8 'Plot from a strategy sample'. I already provided the link for the NT8 sample above, but I will post both versions below as well.
NT7: https://ninjatrader.com/support/help..._a_ninjasc.htm
NT8; https://ninjatrader.com/support/help..._a_ninjasc.htm
Additionally, you can see the rest of the code breaking changes here: https://ninjatrader.com/support/help...ng_changes.htm
Leave a comment:
-
I'm probably wrong, but the reference example you provided above seems like it is creating a separate script that acts like an indicator just to use this feature. I guess I'm confused why NT7 had a relatively simple strategy plot function and NT8 does not?
Can you use AddChartIndicator() for parameters (such as my fixed value) other than actual indicators?
Thanks
Leave a comment:
-
If you decide to use AddChartIndicator(), the order of the plots can be controlled from the strategy calling the ChartIndicators collection with the index of the indicator and set the panel for that indicator.
ChartIndicators[0].Panel = 2;
I've attached two examples created by a colleague of mine to demonstrate this. One uses multiple indicator types, the other uses multiple instances of the same indicator type. Other than this I suggest you go with the concepts from the help guide reference sample I provided above.
Leave a comment:
-
Josh,
Thanks again for the help. I was able to get the separate panel to plot, but how do I get more than one panel on the chart? Using the IsOverlay=false put all my plots on the same panel. In NT7 I just used the StrategyPlot(0).PanelUI = ; to get the desired panel for each plot. How do you do this in NT8?
Regards,
Lee
Leave a comment:
-
lee612801,
You would use IsOverlay=false
Leave a comment:
-
Hi Josh,
Thanks for the info. I was able to get the AddPlot to work by adding the Values parameter. But it plots the value as an overlay on the chart. How do I get the added plot to plot on its own separate panel below and not on the main panel as an overlay?
Thanks,
Lee
Leave a comment:
-
lee612801,
I would suggest using the concepts from the reference sample if you ever plan on plotting to multiple panels with that strategy. The ways you would go about adding a single plot is a little different.
If you just need a single panel for now then you can use AddPlot() for a dynamic value, or AddLine() for a static value.
https://ninjatrader.com/support/help...s/?addplot.htm
https://ninjatrader.com/support/helpGuides/nt8/en-us/?addline.htmLast edited by NinjaTrader_JoshG; 01-14-2019, 02:50 PM.
Leave a comment:
-
Hi Josh,
The value is a parameter that does not change when the strategy is running. But it can be changed by the user in the strategy window.
Yes, a single panel. Eventually I will want multiple panels (probably 3) below the main panel.
Thanks,
Lee
Leave a comment:
-
lee612801,
I fixed my links. Not sure what happened there..
When you say a 'fixed parameter' do you mean that the value is never going to change?
You only need to plot to single panel, correct?
Leave a comment:
-
Hi Josh,
thanks for the response. Some of the links did not work. Also, the example pulls from an indicator which didn’t really help me. Lets start simple. How do I plot a fixed parameter value from within my strategy in my strategy on a separate panel right below the main panel? Let’s say my fixed parameter is called PanelPlot.
Thanks,
Lee
Leave a comment:
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by futtrader, 04-21-2024, 01:50 AM
|
6 responses
57 views
0 likes
|
Last Post
by futtrader
Today, 11:54 AM
|
||
Started by sgordet, Today, 11:48 AM
|
0 responses
1 view
0 likes
|
Last Post
by sgordet
Today, 11:48 AM
|
||
Started by Trader146, Today, 11:41 AM
|
0 responses
2 views
0 likes
|
Last Post
by Trader146
Today, 11:41 AM
|
||
Started by jpapa, 04-23-2024, 07:22 AM
|
2 responses
16 views
0 likes
|
Last Post
by rene69851
Today, 11:39 AM
|
||
Started by funk10101, Today, 11:35 AM
|
0 responses
1 view
0 likes
|
Last Post
by funk10101
Today, 11:35 AM
|
Leave a comment: