NexusFi: Find Your Edge


Home Menu

 





Is MC. NET RSI CORRECT?


Discussion in MultiCharts

Updated
    1. trending_up 1,713 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
alex27
Surrey - UK
 
Posts: 41 since Sep 2015
Thanks Given: 12
Thanks Received: 8

Hi There,

I have based a strategy off RSI in the think or swim platform, moving over to automation with mc.net but im not sure if these 2 RSI's formulas are the same.

Feedback be great thanks,
RSI CALCULATION



THINK OR SWIM - (CORRECT ONE WHICH STRATEGY IS BASED OFF)





declare lower;



input length = 14;

input over_Bought = 70;

input over_Sold = 30;

input price = close;

input averageType = AverageType.WILDERS;



def NetChgAvg = MovingAverage(averageType, price - price[1], length);

def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);

def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;



plot RSI = 50 * (ChgRatio + 1);

plot OverSold = over_Sold;

plot OverBought = over_Bought;



RSI.DefineColor("OverBought", GetColor(5));

RSI.DefineColor("Normal", GetColor(7));

RSI.DefineColor("OverSold", GetColor(1));

RSI.AssignValueColor(if RSI > over_Bought then RSI.color("OverBought") else if RSI < over_Sold then RSI.color("OverSold") else RSI.color("Normal"));

OverSold.SetDefaultColor(GetColor(8));

OverBought.SetDefaultColor(GetColor(8));



























MC.NET RSI CODE



using System;

using System.Drawing;



namespace PowerLanguage.Indicator

{

public class RSI : IndicatorObject

{

private Function.RSI m_rsi1;



private VariableSeries<Double> m_myrsi;



private IPlotObject Plot1;



private IPlotObject Plot2;



private IPlotObject Plot3;



public RSI(object ctx) :

base(ctx){

overbcolor = Color.Red;

overscolor = Color.Cyan;

overbought = 70;

oversold = 30;

length = 14;

}



[Input]

public int length { get; set; }



[Input]

public double oversold { get; set; }



[Input]

public double overbought { get; set; }



[Input]

public Color overscolor { get; set; }



[Input]

public Color overbcolor { get; set; }



protected override void Create(){

m_rsi1 = new Function.RSI(this);

m_myrsi = new VariableSeries<Double>(this);

Plot1 =

AddPlot(new PlotAttributes("RSI", 0, Color.Silver,

Color.Empty, 0, 0, true));

Plot2 =

AddPlot(new PlotAttributes("OverBot", 0, Color.Green,

Color.Empty, 0, 0, true));

Plot3 =

AddPlot(new PlotAttributes("OverSld", 0, Color.Green,

Color.Empty, 0, 0, true));

}



protected override void StartCalc(){

m_rsi1.price = Bars.Close;

m_rsi1.length = length;

}





protected override void CalcBar(){

m_myrsi.Value = m_rsi1[0];

Plot1.Set(0, m_myrsi.Value);

Plot2.Set(0, overbought);

Plot3.Set(0, oversold);

if (PublicFunctions.DoubleGreater(m_myrsi.Value, overbought)){

Plot1.Colors[0] = overbcolor;

}

else{

if (PublicFunctions.DoubleLess(m_myrsi.Value, oversold)){

Plot1.Colors[0] = overscolor;

}

}

if (this.CrossesOver(m_myrsi, oversold)){

Alerts.Alert("Indicator exiting oversold zone");

}

else{

if (this.CrossesUnder(m_myrsi, overbought)){

Alerts.Alert("Indicator exiting overbought zone");

}

}

}

}

}


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Probability Collapse: Bitcoin $150k Craters from 15% to …
Prediction Markets & Event Contracts
Double Deadlock: Rubio Calls Hormuz Tolls "Unfeasib …
Traders Hideout
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
Tradeify 3.0 Overhauls Futures Prop Firm Model -- One-Ti …
Funded Trading Evaluation Firms
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
The Pivot Point 113.6³ — Navigating the Prediction of …
26 thanks
Sober Journey With S&P
16 thanks
The Confluence Meter: A Multi-Layered Signal Framework B …
11 thanks
NT8 color choices
10 thanks
Volume Indicators
7 thanks
  #2 (permalink)
 
Jura's Avatar
 Jura   is a Vendor
 
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 691


alex27 View Post
I have based a strategy off RSI in the think or swim platform, moving over to automation with mc.net but im not sure if these 2 RSI's formulas are the same.

This isn't something that we can compare given the use of proprietary functions by both platforms. Have you tried outputting the computed data from each platform and compare the RSI scripts that way?


Reply With Quote
  #3 (permalink)
alex27
Surrey - UK
 
Posts: 41 since Sep 2015
Thanks Given: 12
Thanks Received: 8


Yes got it roughly working the same now


Reply With Quote




Last Updated on March 8, 2016


© 2026 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 - Downloads - Top
no new posts