TASC2015April journal.what i am missing to get the output of SRSI ??
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
TASC2015April slow RSI
Collapse
X
-
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:
The best futures trading community on the planet: futures trading, market news, trading charts, trading platforms, trading strategies
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 mjairg, 07-20-2023, 11:57 PM
|
3 responses
213 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
||
Started by TheWhiteDragon, 01-21-2019, 12:44 PM
|
4 responses
544 views
0 likes
|
Last Post
by PaulMohn
Today, 04:09 AM
|
||
Started by GLFX005, Today, 03:23 AM
|
0 responses
3 views
0 likes
|
Last Post
by GLFX005
Today, 03:23 AM
|
||
Started by XXtrader, Yesterday, 11:30 PM
|
2 responses
12 views
0 likes
|
Last Post
by XXtrader
Today, 03:07 AM
|
||
Started by Waxavi, Today, 02:10 AM
|
0 responses
7 views
0 likes
|
Last Post
by Waxavi
Today, 02:10 AM
|
Comment