![]() |
|
|
#1 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
I am trying to plot a constant line at 3 and -3 on a panel. this is what I have:
Add(new Plot(Color.Transparent, PlotStyle.Line, "Plot8")); // Plot 8 Add(new Plot(Color.Transparent, PlotStyle.Line, "Plot9")); // Plot 9 Plot8.Set(3); // Make Oscillator Scale constant at 3 on average Plot9.Set(-3); // Make Oscillator Scale constant at -3 on average I keep getting an error that: The name Plot8 does not exist in the current context The name Plot9 does not exist in the current context Where am I going wrong? |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
|
Hi velocity, are the associated dataseries added in the properties for Plot8 and Plot9?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
i added the following
[Browsable(false)] [XmlIgnore()] public DataSeries Plot8 { get { return Values[8]; } } [Browsable(false)] [XmlIgnore()] public DataSeries Plot9 { get { return Values[9]; } } But, it does not work. the scale will go to +1/-1 if the oscillator's values are between +1 and -1. However I want the scale to be +3 amd -3 even if the values are between +1 and -1 Any thoughts as to where I am going wrong? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
|
Hi velocity, unfortunately changing the scale is not supported at this time - have you tried working with Min and Max as in this tutorial?http://www.ninjatrader-support.com/H...ionLogic3.html
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
that is what i thought too. However, if I place a constant value as an idicator and make it transparent, I was trying to fake NT out so the scale would adjust.
Any thoughts? |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
velocity,
Not supported at this point in time. If you want to "fake" it out, don't use a transparent color.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
OK. I changed everything to the following and now I do not get any plots, what's wrong here?
Add(new Plot(Color.Black, PlotStyle.Line, "Plot8")); // Plot 8 Add(new Plot(Color.Black, PlotStyle.Line, "Plot9")); // Plot 9 Plot8.Set(3); // Make Oscillator Scale constant at 3 on average Plot9.Set(-3); // Make Oscillator Scale constant at -3 on average Plots[8].Max = 3; Plots[9].Min =-3; |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Don't set your plots inside Initialize(). Do it inside OnBarUpdate().
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
that did it, thank you
|
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Mar 2009
Posts: 109
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
A similar question from me: In my strategy Initialize() section, I have included Add(Stochastics(7,14,3)) in the code. When running the strategy, the stochastics panel appears as desired; however, it has the "standard" channel lines at 20 and 80. How do I change those values to 30 and 70, for example? Something like Add(Stochastics(7,14,3),UpLine = 70,DownLine = 30) would be great... Thanks for helping! |
|
|
|
|
|
#11 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
|
Unfortunately this is not possible without custom coding, as you can only Add() full indicators, not specific plots of indicators.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problems learning to change line plot color & draw arrows once only | cclsys | Indicator Development | 39 | 03-29-2009 03:00 PM |
| Plot Line Length | ozfader | General Programming | 3 | 07-12-2008 11:39 PM |
| Plot a line of the bar close | dryan_uk | General Programming | 1 | 06-09-2008 11:44 AM |
| Plot an Horizontal line on chart with value from a strategy | skynetman | General Programming | 5 | 05-01-2008 01:30 PM |
| line plot mathematics? | Burga1 | General Programming | 0 | 04-14-2008 10:18 PM |