TASC2015April journal.what i am missing to get the output of SRSI ??
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
TASC2015April slow RSI
Collapse
X
-
chart looking non-satisfactory.Code:public class srsi : Indicator { #region Variables // Wizard generated variables private int period = 14; // Default setting for Period private int emaperiod = 6; // Default setting for Emaperiod // User defined variables (add any user defined variables below) private DataSeries SRSI; //The SRSI measures the strength of a security relative to a sixday EMA private DataSeries srs; private DataSeries Averagepositivedifference; private DataSeries Averagenegativedifference; private DataSeries positivedifference; private DataSeries negativedifference; private DataSeries wEMA; #endregion /// <summary> /// This method is used to configure the indicator and is called once before any bar data is loaded. /// </summary> protected override void Initialize() { SRSI= new DataSeries(this); //The SRSI measures the strength of a security relative to a sixday EMA srs=new DataSeries(this); Averagepositivedifference=new DataSeries(this,MaximumBarsLookBack.Infinite); Averagenegativedifference=new DataSeries(this,MaximumBarsLookBack.Infinite); positivedifference=new DataSeries(this,MaximumBarsLookBack.Infinite); negativedifference=new DataSeries(this,MaximumBarsLookBack.Infinite); wEMA=new DataSeries(this,MaximumBarsLookBack.Infinite); Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "SRSIPlot0")); Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "EmaSRSI")); Overlay = false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. /* WEMA formula= price today * K + EMA yesterday * (1-K) where K = 2 / (N+1) Wilder EMA formula = price today * K + EMA yesterday (1-K) where K =1/N Where N = the number of periods. */ double k=2/(emaperiod +1); wEMA.Set(Close[0]*k+EMA(Close,emaperiod-1)[0]*(1-k)); //float positive_diff=(Close[0]-wEMA[0]); //float negative_diff=(wEMA[0]+Close[0]); if(Close[0]>EMA(Close,emaperiod)[0]) positivedifference.Set(Close[0]-EMA(Close,emaperiod)[0]); else { negativedifference.Set((EMA(Close,emaperiod)[0]-Close[0])); } //if(positivedifference[0]>=0) Averagepositivedifference.Set(SUM(positivedifference,period)[0]); //if(negativedifference[0]>=0) Averagenegativedifference.Set(SUM(negativedifference,period)[0]); if(Averagenegativedifference[0]!=0) { srs.Set((Averagepositivedifference[0]/Averagenegativedifference[0])); SRSI.Set(100 - (100/(1+srs[0]))); } else { SRSI.Set(SRSI.Get(1)); } SRSIPlot0.Set(SRSI[0]); //EmaSRSI.Set(Averagepositivedifference[0]/Averagenegativedifference[0]); }
Comment
-
Hello sumana.m,
Thank you for your patience.
I was waiting to see if the April TASC trader's tip was already created for NinjaTrader, but it has not been. Unfortunately, I do not have access to this article and therefore have no way to properly troubleshoot your code nor compare against the source information.
Please let me know if you have any questions.
Comment
-
SRSI published
I have tested the SRSI and added a signal line. It is available open source for free download here:
If you are not an elite member of Big Mike's you may contact me via private message to obtain it. I am not posting it here, because I cannot do the indicator maintenance, if they are posted in different locations.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
577 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|


Comment