Hello! Perhaps someone faced with similar and will help me in solving this issue: In the strategy, where there are two tools, you need to connect your indicator to each tool. The data of these indicators should be displayed on the panel number 3 of the chart. I would be very grateful if someone responds to this letter. Attached to the letter screen.
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
In the strategy of two tools to each connect indicator
Collapse
X
-
In the strategy of two tools to each connect indicator
Hello! Perhaps someone faced with similar and will help me in solving this issue: In the strategy, where there are two tools, you need to connect your indicator to each tool. The data of these indicators should be displayed on the panel number 3 of the chart. I would be very grateful if someone responds to this letter. Attached to the letter screen.Tags: None
-
Hello ArchakovDenis,
Thanks for your post.
Additional panels will be added to a chart if the Strategy adds a plot or an Indicator is added with AddChartIndicator() and the strategy/indicator have IsOverlay set to false. If IsOverlay is set to true, the indicator/strategy will not create a new panel for plots.
Since AddChartIndicator is called in State.DataLoaded, any strategy added plots will be take the first added panel, and each indicator added with AddChartIndicator will take additional panels after that. If you would like to reorganize these, you can change the Panel property for the indicators and the strategy so they are organized to your liking. You will have to keep in mind how many panels are added and which panels the plots should be drawn to avoid issues. I suggest setting this after you have called AddChartIndicator in State.DataLoaded.
Code:private ADL ADL1; private ADL ADL2; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"Enter the description for your new custom Strategy here."; Name = "Test"; AddPlot(Brushes.White, "StrategyPlot"); } else if (State == State.DataLoaded) { ADL1 = ADL(Close); ADL2 = ADL(High); ADL1.Plots[0].Brush = Brushes.MediumSpringGreen; ADL2.Plots[0].Brush = Brushes.DarkCyan; AddChartIndicator(ADL1); AddChartIndicator(ADL2); ADL1.Panel = 2; ADL2.Panel = 3; Panel = 4; } } protected override void OnBarUpdate() { Values[0][0] = Close[0]; }
Last edited by NinjaTrader_Jim; 12-03-2018, 12:10 PM.JimNinjaTrader Customer Service
- Likes 1
-
Comment
-
Hello ArchakovDenis,
You are setting the strategy plots and the plots for both SUM's to Panel 3. Panel 3 will be scaled to display these values. If you would like to have the plots displayed with a more meaningful visual representation, I would suggest having the plots use their own panels so the panel scale does not squeeze all plots to make them viewable.
Please let us know if you have any questions.JimNinjaTrader Customer Service
Comment
-
Hello! I think that you did not really understand my motivation. 1. I would like for each of the two tools (for example, ES and VX) to have its own indicator. 2. These two indicators were on the same panel, for example, on panel No. 3. 3. The intersection of these two indicators of each other would be a condition for entry / exit into the position. Here is a simple strategy to succeed.
Comment
-
Hello ArchakovDenis,
Where the indicators are drawn will simply be visual. You could take the approaches mentioned earlier in the thread to customize where these plots will be presented.
Conditions that the strategy uses will be based on the prices associated with the indicator plots and will not check for visual crosses. Let's say for example we have SMA values for ES at 2785.38 and 2786.32 and SMA values for VX at 18.00 and 19.03. If you wanted to create a crossover here, you would have to scale the indicator values so the price values will create the crossovers and appropriate logic in your strategy.
Please refer to the documentation page below which describes valid inputs for system indicators for reference on having indicators based off of separate Series objects like from an additional data series. I'll also include documentation for Multi Time Frame and instruments as it provides a complete walkthrough for working with multi series NinjaScripts.
Valid input for system indicators - https://ninjatrader.com/support/help..._indicator.htm
Multi Time Frame and instruments - https://ninjatrader.com/support/help...nstruments.htm
Please let us know if you have any additional questions.JimNinjaTrader Customer Service
Comment
-
"If you want to create a crossover here, you will have to scale the indicators so that the price values create crossovers and the corresponding logic in your strategy."
Please tell me to create a crossover here, how is it possible to scale the indicators so that the price values create crossovers and the corresponding logic in the strategy?
Comment
-
Hello ArchakovDenis,
You would have to multiply or divide the indicator values so they are relative to each other. For example, let's say our SMA on VX is instantiated as SMA_VX. We would have to multiply SMA_VX[0] to scale it to be relative to the SMA for ES. The coefficient for scaling would be subjective to each instrument pair and how you would like the scaling to be done.
If there is anything else we can do to help, please let us know.JimNinjaTrader Customer Service
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by spottysallrite, Today, 11:31 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 11:31 AM | ||
Started by johnMoss, 03-04-2024, 01:53 PM
|
2 responses
31 views
0 likes
|
Last Post
by Overnhou
Today, 11:21 AM
|
||
Started by Padan, Today, 02:02 AM
|
5 responses
16 views
0 likes
|
Last Post Today, 11:14 AM | ||
Started by Lele2k24, Yesterday, 11:24 AM
|
8 responses
28 views
0 likes
|
Last Post
by Lele2k24
Today, 11:00 AM
|
||
Started by kramnor2001, Yesterday, 02:30 PM
|
4 responses
24 views
0 likes
|
Last Post
by bltdavid
Today, 10:44 AM
|
Comment