NexusFi: Find Your Edge


Home Menu

 





Need simple code for StochRSI please


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Fat Tails with 3 posts (24 thanks)
    2. looks_two mrback with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 TraderTom with 1 posts (0 thanks)
    1. trending_up 6,031 views
    2. thumb_up 24 thanks given
    3. group 4 followers
    1. forum 5 posts
    2. attach_file 2 attachments




 
Search this Thread

Need simple code for StochRSI please

  #1 (permalink)
TraderTom
USA
 
Posts: 1 since Sep 2010
Thanks Given: 1
Thanks Received: 0

Hello there,
I use StochRSI indicator a lot in Ninjatrader, however It only display %K line.
I would like it to also display the %D line; StochRSI %D is a moving average of %K over %D Length bars.
I came up with some code by adding D as SMA of StochRSI but it doesn't show the correct results, the D line is way off. can someone help? can I just modify stochRSI.cs and get it done? if so what code should I add and where.

Thank you for your assistance
Tom

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Request for MACD with option to use different MAs for fa …
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
48 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



TraderTom View Post
Hello there,
I use StochRSI indicator a lot in Ninjatrader, however It only display %K line.
I would like it to also display the %D line; StochRSI %D is a moving average of %K over %D Length bars.
I came up with some code by adding D as SMA of StochRSI but it doesn't show the correct results, the D line is way off. can someone help? can I just modify stochRSI.cs and get it done? if so what code should I add and where.

Thank you for your assistance
Tom

Indicator below includes the D signal line. I have also enhanced the original period of the indicator . You can now select a different period for the RSI and the Stochastics K line. If you use the same period for both, the modified indicator displays the same results as the original indicator.

Now, I have to make some reserves. There are about 10 different versions of RSI and Stoch supplied by various charting packages. Some packages use the close, others the typical price to calculate the Stochastics. For smoothing I have seen simple, exponential and weighted smoothing, so you will not necessarily find exactly the same results as with other charting packages.

I intend to start a thread to explain all those different versions of these two indicators and how to use them, but it is not for now.

Attached Files
Elite Membership required to download: anaStochRSI.zip
Reply With Quote
The following 12 users say Thank You to Fat Tails for this post:
  #4 (permalink)
mrback
Vancouver Canada
 
Posts: 2 since Feb 2013
Thanks Given: 1
Thanks Received: 0

Hi There
Thank you very much for having posted the stochastic RSI code for Ninja
Where do I need to download it in order to use it and would it work with the new version of Ninja?
Thank you

Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


mrback View Post
Hi There
Thank you very much for having posted the stochastic RSI code for Ninja
Where do I need to download it in order to use it and would it work with the new version of Ninja?
Thank you

@mrback: You can download the attachment from the post above. The indicator works with NinjaTrader 7, which is the latest version.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
  #6 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

I have reworked the Stochastic RSI. Please disregard the four year old version from post #3.

The new version comes with the following enhancements, when compared to the NinjaTrader default indicator.

- The NinjaTrader default indicator calculates a raw Stochastics directly from the RSI, which is used as an input series. No further smoothing is possible. The enhanced version allows further smoothing of the raw K line. The default period for the K line smoothing is set to 1 (no smoothing).

- The indicator comes with a D line added. The D line is calculated as a SMA of the K line and can be used as signal line.

- The NinjaTrader default version uses the same lookback period for the RSI and the Stochastics. This is in line with the suggestions by Tushar Chande and Stanley Kroll. However, this version allows to select different periods for RSI and Stochastics.

- Code efficiency is improved, which results in a reduced CPU load, when the indicator is set to COBC = false.

Download link:





Reply With Quote
The following 11 users say Thank You to Fat Tails for this post:





Last Updated on May 6, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts