View Full Version : Stochastics Overlay
NinjaTrader_Josh
08-10-2007, 05:59 AM
Stochastics Overlay
http://i17.tinypic.com/6ajyxk9
This indicator takes the normal Stochastics indicator and overlays it on top of the price panel.
Changelog:
v0.1.3 - Fixed color parameters
v0.1.2 - Fixed error in calculations for D and K lines
v0.1.1 - Added ability to customize scale
v0.1.0 - Public Release
pbastowski
08-10-2007, 07:40 AM
Thank you very much for this. I've downloaded the code and will check it out tomorrow.
Paul
stevestrading
11-06-2007, 02:52 AM
Josh, thanks. This is very useful. I would like to apply this to other indicators. Can you explain what is necessary to modify in the ninjascript to plot an indicator as an overlay on price?
Thanks,
Steve
NinjaTrader_Josh
11-06-2007, 02:59 AM
There is actually a decently advanced routine to accomplish this. I overrode the Plot() method to get it to plot the way it does. Basically I had to create my own "scale" on the price panel based on pixel count of the height/width of the window.
stevestrading
11-06-2007, 03:06 AM
Thanks for the explanation. Sounds like it's more complicated than I thought. You wouldn't by chance want to program the Ninjatrader TRIX indicator to plot in overlay mode would you? If I thought I had the expertise, I'd try to do it myself.
Thanks,
Steve
NinjaTrader_Josh
11-06-2007, 03:09 AM
Unfortunately I just don't have the spare time to commit to handling custom indicator requests at the moment. Maybe someone from the community can hack up my code for you.
stevestrading
11-06-2007, 03:12 AM
I understand, no problem.
zq655
01-08-2008, 07:26 AM
I also want the %K overlaid on the price.
I downloaded the zip files but I cannot tell what format the file is in.
Any ideas would be appreciated
many thanks
NinjaTrader_Ray
01-08-2008, 07:57 AM
You need to import the Zip file.
http://www.ninjatrader-support.com/HelpGuideV6/Import1.html
aslane
04-09-2008, 05:28 PM
Josh,
I have applied this method to an indicator I wrote, and it works like a charm.
My question is how would I modify the plot method to plot things like trendlines or text objects (from calls to drawLine() and drawText()) on the indicators scale?
I would think this is similar code, in that you would iterate thru the collections of drawing objects and plot them based on the indicator scale. Any help would be greatly appreciated.
NinjaTrader_Josh
04-09-2008, 09:04 PM
I'm not sure if I understand what you are trying to do exactly, but if you are trying to use the draw objects on the price panel you can already do that. Setting the property DrawOnPricePanel to true in the Initialize() method of your indicator should do the trick.
aslane
04-09-2008, 09:14 PM
I have an indicator that is similar to your stochastic, and I have used your plot code to plot it on the price panel but using a different scale. In that same indicator, I would like to do something like draw a trendline between specific peaks of the indicator or place a text object at a peak, again on the indicator scale not the price scale.
In the indicator, the plot method was overriden to get the indicator on the price scale. I am asking how would I get other draw objects to show up on the price panel but with the indicaotrs scale.
NinjaTrader_Josh
04-09-2008, 09:26 PM
I do not remember the exact algorithms I used in the overlay, but the general idea is to normalize the drawing field and then plotting to absolute pixels. You will need to do the same with the draw objects.
Unfortunately the answer is not a simple one and beyond the brief overview above it is beyond the level of support we can provide due to bandwidth issues. Thanks for understanding.
aslane
04-09-2008, 09:37 PM
Understood. I can try to figure it out if you can at least point me to how to access the collection of objects that have been added via the drawLine or drawText methods. Thanks.
NinjaTrader_Dierk
04-10-2008, 12:04 AM
Unfortunately this is beyond what we provide support for.
azzurro
04-13-2009, 07:18 PM
Hi,
Thanks for this indicator. I'm finding the up/lower 80/20 lines reset to transparent when chart is restarted. It would be great if this was fixed as well as being able to set line thickness of these upper and lower lines. The ability to add a 50% line would be out the top.
Azzurro
NinjaTrader_Josh
04-14-2009, 08:27 AM
Azzurro,
I have fixed the color issue on the first post. If you want to set line thickness you will need to custom modify the code. This indicator was released as a 3rd party indicator and unfortunately I am not making any enhancements on it currently.
NT7 will provide indicator overlays natively which will make this obsolete.
bobgie94
08-14-2009, 02:38 PM
After unzipping the .zip file, how do you install the stochastic chart?
NinjaTrader_Josh
08-14-2009, 02:42 PM
Leave it as a zip and use the NinjaScript import utility directly on the zip.
Go to File -> Utilities -> Import NinjaScript.