View Full Version : Using My New Indicator
rob36
09-09-2008, 10:09 AM
I have edited an existing indicator using the NinjaScript editor,
Then saved it.
I am wondering how I now incorporate it into my chart?
If I have a chart open, and click on Indicators it doesn't appear to be there?
NinjaTrader_Josh
09-09-2008, 10:18 AM
You will need to compile your indicator before it will show up on the list. Go back to the NinjaScript Editor and hit F5 to compile.
rob36
09-09-2008, 10:28 AM
Many Thanks
Also I am a novice programmer, If I want to colour format a stochastic that has both K & D, do I only need to put the formatting code;
Add(new Plot(Color.LimeGreen, PlotStyle.Line, "Rising"));
Add(new Plot(Color.Red, PlotStyle.Line, "Falling"));
Add(new Plot(Color.Yellow, PlotStyle.Line, "Neutral"));
in once or do I need to put it in for each of the variables?
If I do need to put it in for each variable to I reference it as "RisingD" or "Rising","D" ?
Also if I wanted to have the indicator as a line and bars I just need to add a new plot?
Many thanks in advance
rob36
09-09-2008, 10:36 AM
Also,
Once I compile it, place it on a chart am I still able to edit it?
I assume that it will continue to look the same on the chart until I compile it again?
NinjaTrader_Josh
09-09-2008, 10:53 AM
If you want K and D to be both color coded you will need a total of 6 plots. Please see the reference sample section for Multi-Colored Plots. You need 3 plots for K and 3 for D.
You can edit your indicator whenever you like, but to have it reflected on the chart you may need to remove the indicator and readd it on.
rob36
09-09-2008, 12:39 PM
I have cut and pasted and ammended the code from your sample.
The error messages relating to ; and } I have tried placing them in the required rows and that doesn't seem to make any difference. I am also unsure why the code would expect a statement.
There mst be something that I am doing terribly wrong are you able to help @ all?
Just looking at it the errors occur in an area "the properties" down the bottom that I haven't touched?
NinjaTrader_Josh
09-09-2008, 12:45 PM
Expand the reference sample's Properties region. You will see there have been several lines of code added. You need to make 6 plots in there to correspond with the 6 in the Initialize().
If all this does not make sense you could try a NinjaScript Consultant to produce what you want: http://www.ninjatrader.com/webnew/partners_onlinetrading_NinjaScript.htm