Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Adding Indicator to Chart Question
Collapse
X
-
Adding Indicator to Chart Question
I know you can add an indicator to a chart in a strategy. Can you also stipulate the color and width of the lines? For example, if I wanted to add SMA to my chart, in my strategy, under the protected override void Initialize() section, I can simply put "Add(SMA(5)); ........ but can I add something to this line to make in a color of red with a width of 3?Tags: None
-
Hello edgeliner,
Yes, you can do it.
For example if you are adding an SMA then you can set the color and the width using the below code
Code:protected override void Initialize() { SMA(14).Plots[0].Pen.Color = Color.Green; SMA(14).Plots[0].Pen.Width = 3; Add(SMA(14)); //rest of the code }
JoydeepNinjaTrader Customer Service
-
Hello edgeliner,
You have to use the appropriate plot index to do it. Please use the below code to do it
Code:this.Bollinger(2,14).Plots[2].Pen.Color = Color.Black; this.Bollinger(2,14).Plots[1].Pen.Color = Color.Black; this.Bollinger(2,14).Plots[0].Pen.Color = Color.Red; Add(this.Bollinger(2,14));
JoydeepNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by AaronKoRn, Today, 09:49 PM
|
0 responses
10 views
0 likes
|
Last Post
by AaronKoRn
Today, 09:49 PM
|
||
Started by carnitron, Today, 08:42 PM
|
0 responses
9 views
0 likes
|
Last Post
by carnitron
Today, 08:42 PM
|
||
Started by strategist007, Today, 07:51 PM
|
0 responses
10 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,980 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
9 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
Comment