![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| NinjaScript File Sharing Discussion Discussion for shared NinjaScript files. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
Does anyone have a Color Stochastic, any colored 2-line indicator, or a tutorial for coloring indicators with more than one line? Color's a huge help for determining "has that indicator really turned?" and I'm going bananas trying to convert the Sample color SMA template. Thanks for your help, Cheers, Jeremy |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Check out this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=3227
There is also a similar tutorial here: http://www.ninjatrader-support.com/H...tml?Overview25
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Member
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
Thanks for the tutorials, I've tried to hash the two together & set up my 3 Plot lines for the rising/neutral/falling D-line but the indicator is full of errors. In lines like "DRisingPlot.Set(1, Stochastics(Period)[1]);" I've changed it to "DRisingPlot.Set(1, Stochastics(K, D, Smooth)[1]);" but this is a guess & I only need the D-line colored. Quote:
Thanks, Jeremy |
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Did you add the plots into the Properties? Check out the Properties section in the reference sample. You will need those.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Josh, I entered the plots into the Indicator wizard, but apart from that the only "Properties" section I can find is the large "Properties" section at the very bottom of the code which is by default hidden from the user. As I understand it the samples make no reference to editing this area directly. My misunderstanding, thanks for your patience,
Jeremy |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
You will need to expand that big Properties section. If you don't mind you could post up the current rendition of your code. After I see what you have right now I can provide you with some pointers to get you going. Cheers.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 | |
|
Member
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Josh,
Thanks for the help, good news is I've finally managed to make a smoothed StochRSI and plot it in color. Before I was looking at the entire indicator code, but then discovered the [+] buttons at the side of the code to popup the Properties section only, so I've made some progress. Only thing now is in my color version the smooth line is not plotted, it's the StochRSI line that is both plotted and colored. I'd like the smooth line to be plotted and colored, and StochRSI line plotted only. Here's my code: Quote:
,Kind Regards, Jeremy |
|
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Hi jeremymgp,
I am unfamiliar with the implementation of StochRSI since it is probably a custom indicator you have. When you do the .Set stuff you want it done on the plot you want. So for instance (I am just guessing what it is for your indicator), if you wanted to plot the smooth line you might do something like this: Code:
RisingPlot.Set(StochRSI_Smoothed(Period, Smooth).Smooth[0]) Now to just simply plot StochR_Smoothed you need to add another Values set in the Properties. Code:
[Browsable(false)]
[XmlIgnore()]
public DataSeries StochRSmooth
{
get { return Values[0]; }
}
Code:
StochRSmooth.Set(StochRSI_Smoothed(Period, Smooth)[0]);
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Member
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 times in 0 posts
|
Yippee, looks like I've done it. Only weird thing is when I save the indicator, copy it into a zip file, then try to import the zipped indicator, I can't get the indicator to show in the:
Control Center > Tools > Edit NinjaScript > Indicator box. However if I right click a chart and click Indicators, I can select the indicator fine. Just don't want to distribute this if the zip file isn't 100% OK. Thanks, Jeremy |
|
|
|
|
|
#10 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Member
Join Date: Aug 2007
Posts: 70
Thanks: 0
Thanked 0 times in 0 posts
|
Hello everyone,
Please find attached a color Stochastics indicator, it seems several people have shown interest in this and it also serves as a handy template for anyone wanting to color code indicators with more than one plot. A huge thanks to Ray and Josh for their prompt and accurate response to my questions, hope this helps and good luck trading everyone, Kind Regards, Jeremy |
|
|
|
|
|
#12 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Thanks for the contribution jeremymgp. We appreciate it.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Automatic Trend Line Indicator | Greg1 | Charting | 6 | 07-23-2009 07:48 AM |
| Stochastic Indicator | PorkChop | Indicator Development | 4 | 11-07-2007 06:59 PM |
| Indicator line goes to zero when CalculateOnBarClose set to True | ThePatientOne | Indicator Development | 1 | 08-30-2007 11:42 AM |
| Line "names" in Indicator Box change to "Line" after modification | higler | Charting | 3 | 05-02-2007 06:05 AM |