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 usazencort, Today, 01:16 AM
|
0 responses
1 view
0 likes
|
Last Post
by usazencort
Today, 01:16 AM
|
||
Started by kaywai, 09-01-2023, 08:44 PM
|
5 responses
603 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
22 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
21 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
Comment