Converting 2 RSI Divergence from Tradingview to NT - futures io
futures io



Converting 2 RSI Divergence from Tradingview to NT


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Kharmaz with 3 posts (1 thanks)
    2. looks_two TigerStripes with 3 posts (4 thanks)
    3. looks_3 bobwest with 2 posts (0 thanks)
    4. looks_4 SamirOfSalem with 1 posts (0 thanks)
    1. trending_up 1,128 views
    2. thumb_up 5 thanks given
    3. group 4 followers
    1. forum 8 posts
    2. attach_file 4 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Converting 2 RSI Divergence from Tradingview to NT

(login for full post details)
  #1 (permalink)
Kharmaz
Orlando, FL
 
 
Posts: 26 since Jun 2014
Thanks: 13 given, 3 received

I need help with converting 2 RSI Divergence from Tradingview to TOS and NT8.
Introduced by Shizaru
https://www.tradingview.com/script/fH6e5TuN-RSI-Divergence/

Basically 5 RSI and 14 RSI Divergence. Instead of a line, I need the indicator to print columns, similar to picture.

Attached Thumbnails
Click image for larger version

Name:	Screenshot_20220807-141851~2.png
Views:	34
Size:	82.3 KB
ID:	326280  
Reply With Quote

Can you help answer these questions
from other members on futures io?
SafeDayTradingorg
Trading Reviews and Vendors
AddPlotNames2a support thread
NinjaTrader
Jumpstart Trading
Trading Reviews and Vendors
TradingView like VOLUME indi for Ninja8 ?!?!
NinjaTrader
Why do you trade the US indices vs Asia/Europe indices i …
Emini and Emicro Index
 
 
(login for full post details)
  #2 (permalink)
TigerStripes
Surrey
 
 
Posts: 54 since Mar 2021
Thanks: 17 given, 30 received


Kharmaz View Post
I need help with converting 2 RSI Divergence from Tradingview to TOS and NT8.
Introduced by Shizaru
https://www.tradingview.com/script/fH6e5TuN-RSI-Divergence/

Basically 5 RSI and 14 RSI Divergence. Instead of a line, I need the indicator to print columns, similar to picture.

if you build the indie w a moving average or plotting a line to represent the values NT has a built in indie plot visual combo box and allows you to set the visuals of most histogram values to different plot settings, like a Bar(shown in your image), Block, Box, Cross, Dot, Hash, Horizontal Line, Line, so just create it to use that and set to Bar.

Reply With Quote
The following user says Thank You to TigerStripes for this post:
 
(login for full post details)
  #3 (permalink)
 bobwest 
Site Moderator
Sarasota FL
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
 
bobwest's Avatar
 
Posts: 7,497 since Jan 2013
Thanks: 54,462 given, 24,846 received


Giving this thread a bump, if anyone can give @Kharmaz a hand with this indicator request.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
 
(login for full post details)
  #4 (permalink)
 bobwest 
Site Moderator
Sarasota FL
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
 
bobwest's Avatar
 
Posts: 7,497 since Jan 2013
Thanks: 54,462 given, 24,846 received

To renew the request, can someone with a knowledge of NT8 give @Kharmaz some help with this indicator?

He does not appear to have programming skills, and basically just needs someone to create the indicator.

Details are in the first post.

Thanks.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
Reply With Quote
 
(login for full post details)
  #5 (permalink)
TigerStripes
Surrey
 
 
Posts: 54 since Mar 2021
Thanks: 17 given, 30 received


Kharmaz View Post
I need help with converting 2 RSI Divergence from Tradingview to TOS and NT8.
Introduced by Shizaru
https://www.tradingview.com/script/fH6e5TuN-RSI-Divergence/

Basically 5 RSI and 14 RSI Divergence. Instead of a line, I need the indicator to print columns, similar to picture.

That is something I can try.

I have questions, can you explain the chart. Please post a picture showing the histogram & the corresponding chart.
If you use indies that are best used to reproduce that image or ones that you like, post those or a link to those indies.
My q's here start w Why is there 2 RSI's, one slow & one fast, if you can also add an image showing what part of the image is the RSI 5 & which is the RSI 14 I can attempt to write it. I am able to nest an RSI into momentum indie which reproduces that effect and can do the opposite nesting the momentum in the RSI to show when momentum in RSI shows an Overbought or oversold condition. Still not sure here when the need to have 2 comes into the indie, unless you overlay each and notice convergence, or you just want to display 2 values of the trend to get a confirmed momentum.

Attached Thumbnails
Click image for larger version

Name:	Screenshot_78 (3).png
Views:	24
Size:	57.6 KB
ID:	326747  
Reply With Quote
The following 2 users say Thank You to TigerStripes for this post:
 
(login for full post details)
  #6 (permalink)
Kharmaz
Orlando, FL
 
 
Posts: 26 since Jun 2014
Thanks: 13 given, 3 received

Hello @TigerStripes
Here is how the RSI Divergence works here. Please read the description by Shizaru on Tradingview.
https://www.tradingview.com/script/fH6e5TuN-RSI-Divergence/

RSI DIVERGENCE is a difference between a fast and a slow RSI . Default values are 5 for the fast one and 14 for the slow one.
signal line: when RSI Divergence cross zero line from bottom to top you get a buy signal (the line become green), vice versa when the RSI Divergence cross zero line in the opposite way you get a sell signal (the line become red)
I need help coding from Tradingvidew to Ninjatrader 8. Instead of a line, I need the indicator to print columns, similar to picture.
Here is the TV code:

study(title="RSI Divergence", shorttitle="RSI Divergence")
src_fast = close, len_fast = input(5, minval=1, title="Length Fast RSI")
src_slow = close, len_slow = input(14,minval=1, title="Length Slow RSI")
up_fast = rma(max(change(src_fast), 0), len_fast)
down_fast = rma(-min(change(src_fast), 0), len_fast)
rsi_fast = down_fast == 0 ? 100 : up_fast == 0 ? 0 : 100 - (100 / (1 + up_fast / down_fast))
up_slow = rma(max(change(src_slow), 0), len_slow)
down_slow = rma(-min(change(src_slow), 0), len_slow)
rsi_slow = down_slow == 0 ? 100 : up_slow == 0 ? 0 : 100 - (100 / (1 + up_slow / down_slow))
//plotfast = plot(rsi_fast, color=blue)
//plotslow = plot(rsi_slow, color=orange)
divergence = rsi_fast - rsi_slow
plotdiv = plot(divergence, color = divergence > 0 ? lime:red, linewidth = 2)
//band1 = hline(70,color=green)
//band0 = hline(30,color=red)
band = hline(0)







Screenshot_20220903-203949~2


Screenshot_20220807-141851_2

Reply With Quote
The following user says Thank You to Kharmaz for this post:
 
(login for full post details)
  #7 (permalink)
Kharmaz
Orlando, FL
 
 
Posts: 26 since Jun 2014
Thanks: 13 given, 3 received

@TigerStripes just a friendly reminder, any update on the RSI indicator for NT8? Thanks for your help.

Reply With Quote
 
(login for full post details)
  #8 (permalink)
TigerStripes
Surrey
 
 
Posts: 54 since Mar 2021
Thanks: 17 given, 30 received

I am unsure myself how two RSI MAs and validate the values they currently are then equate each, show divergences and display each.

I have a few divergence Indies, it will bet show RSI and price divergence
They use as an input data series under an RSI or any indie that can display the divergence between it's values and current price relative to recent swig high and lows.

Reply With Quote
The following user says Thank You to TigerStripes for this post:
 
(login for full post details)
  #9 (permalink)
SamirOfSalem
Dubai + United Arab Emirates
 
 
Posts: 54 since Jan 2020
Thanks: 17 given, 34 received


Kharmaz View Post
Hello @TigerStripes
Here is how the RSI Divergence works here. Please read the description by Shizaru on Tradingview.
https://www.tradingview.com/script/fH6e5TuN-RSI-Divergence/

RSI DIVERGENCE is a difference between a fast and a slow RSI . Default values are 5 for the fast one and 14 for the slow one.

If the requirement is indeed just a simple subtraction of 2 RSI lines*, see if this works for you:

 
Code
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.DrawingTools;
#endregion

//This namespace holds Indicators in this folder and is required. Do not change it. 
namespace NinjaTrader.NinjaScript.Indicators
{
	public class fio2RSI : Indicator
	{
		protected override void OnStateChange()
		{
			if (State == State.SetDefaults)
			{
				Description									= @"Enter the description for your new custom Indicator here.";
				Name										= "fio2RSI";
				Calculate									= Calculate.OnBarClose;
				IsOverlay									= false;
				DisplayInDataBox							= true;
				DrawOnPricePanel							= true;
				DrawHorizontalGridLines						= true;
				DrawVerticalGridLines						= true;
				PaintPriceMarkers							= true;
				ScaleJustification							= NinjaTrader.Gui.Chart.ScaleJustification.Right;
				//Disable this property if your indicator requires custom values that cumulate with each new market data event. 
				//See Help Guide for additional information.
				IsSuspendedWhileInactive					= true;
				Slow					= 5;
				Fast					= 14;
				
				AddPlot(new Stroke(Brushes.Orange, 4), PlotStyle.Bar, "Difference");
				AddLine(Brushes.Gray, 0, "Zero line");
			}
			else if (State == State.Configure)
			{
			}
		}

		protected override void OnBarUpdate()
		{
			//Add your custom indicator logic here.
			double fast = RSI(Fast, 3)[0];
			double slow = RSI(Slow, 3)[0];
			
			Difference[0] = fast - slow;
			
			if (Difference[0] > 0)
				PlotBrushes[0][0] = Brushes.Green;
			else
				PlotBrushes[0][0] = Brushes.Red;

		}

		#region Properties
		[NinjaScriptProperty]
		[Range(1, int.MaxValue)]
		[Display(Name="Slow", Order=1, GroupName="Parameters")]
		public int Slow
		{ get; set; }

		[NinjaScriptProperty]
		[Range(1, int.MaxValue)]
		[Display(Name="Fast", Order=2, GroupName="Parameters")]
		public int Fast
		{ get; set; }

		[Browsable(false)]
		[XmlIgnore]
		public Series<double> Difference
		{
			get { return Values[0]; }
		}
		#endregion

	}
}


* Caveat 1: NinjaTrader's built-in RSI indicator has a parameter called "Smoothing". I haven't looked into how it affects the calculations. The default value (if you apply an RSI indie to a chart) is 3, which is what I've hard-coded here in lines 60 and 61.

* Caveat 2: Also, the builti-in RSI plots two curves, one being the RSI and the other being an "Average" of some sort. If you want the calcs to use this "Average" value instead, change lines 60 and 61 to:

 
Code
			double fast = RSI(Fast, 3).Avg[0];
			double slow = RSI(Slow, 3).Avg[0];

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Converting 2 RSI Divergence from Tradingview to NT


Last Updated on September 18, 2022


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2022 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts