Is this designed to work this way?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Applying indicators to a chart (for backtestring).
Collapse
X
-
Applying indicators to a chart (for backtestring).
When I run a backtest and click on a Chart tab to view the buys and sells - the indicators I applied to my default chart previously are not there. If I apply the indicators again - then all the buys and sells disappear.
Is this designed to work this way?Tags: None
-
Works for most indicators.
I looked at it - very helpful indeed. Got it it to work for volume and a number of other indicators.
But I can't get to plot current day's high.
Coding the following doesn't work:
Add(CurrentDayOHL().CurrentHigh[0]);
I must be missing something...
Thanks
Comment
-
Still can't get it to work.
Thanks.
But when I code:
Add(CurrentDayOHL());
CurrentDayOHL().CurrentLow[0].Plots[0].Pen.Color = Color.Transparent;
I get an error message. Now if I remove CurrentLow[0] from the above it compiles. But I do not want to show that attribute.
Also I was able to add Macd:
Add(MACD(12, 26, 9));
But can't change each attribute's color. For example:
Avg color = red, diff color = blue, Macd color = yellow.
Thanks
Comment
-
You need to find the Plots[0] value that corresponds with the plot you want to change. 0, 1, 2, etc. You can figure this out by opening up the CurrentDayOHL() indicator and seeing which is assigned to which. The same applies for the MACD.
Plots[0], Plots[1], etc. is how you would need to reference them to change them.Josh P.NinjaTrader Customer Service
Comment
-
It is not the plot[] that's the issue.
I am aware of the plots. The issue is not the plots[]. I think it is the syntax. No matter which plot I assign I get an error: 'NinjaTrader.Data.DataSeries' does not contain a definition for 'Plots'.
My code is:
CurrentDayOHL().CurrentLow[0].Plots[0].Pen.Color = Color.Transparent;
Now if I remove CurrentLow[0] from the above it compiles. But I specifically do not want to see the CurrentLow.
It would be off immense help to just be able to have a setting that applies all the default chart attributes to the chart in backtesting.
To have 4 lines of code just to see one line on a chart is just not efficient.
Same for MACD. I can plot it but can't seem to be able to change the color of Diff, Avg, Macd.
I appreciate your help.
Comment
-
That's right. You don't use CurrentLow. To get access to CurrentLow you need to find the correct Plots[x] that corresponds with it and assign your Color.Transparent to that plot.
You need to open up CurrentDayOHL() to take a look. CurrentLow is assigned to 2 so you would use Plots[2]. Assign Color.Transparent as demonstrated in the tip to Plots[2].
These settings are settable for backtesting. You just need to assign them to the correct plot individually. It is as efficient as possible.
When you do Add() you are adding all plots. You need to access Plots[] to change the colors.Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AttiM, 02-14-2024, 05:20 PM
|
11 responses
184 views
0 likes
|
Last Post Today, 09:28 AM | ||
Started by fernandobr, Today, 09:11 AM
|
1 response
3 views
0 likes
|
Last Post Today, 09:26 AM | ||
Started by timmbbo, Today, 08:59 AM
|
1 response
3 views
0 likes
|
Last Post Today, 09:16 AM | ||
Started by KennyK, 05-29-2017, 02:02 AM
|
2 responses
1,281 views
0 likes
|
Last Post
by marcus2300
Today, 09:13 AM
|
||
Started by itrader46, Today, 09:04 AM
|
1 response
6 views
0 likes
|
Last Post Today, 09:10 AM |
Comment