indiTraders - Forum for the Active Indian Trader  

Go Back   indiTraders - Forum for the Active Indian Trader > Tools > Software > NinjaTrader

DPonline
Reply
 
Bookmark and Share LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-03-2015, 11:36 PM
nTP's Avatar
nTP nTP is offline
Flash Crash
 
Join Date: Dec 2013
Location: kolkata
Posts: 2,087
Thanks: 7,912
Thanked 2,313 Times in 1,380 Posts
nTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud of
Default TASC2015April slow RSI

Hi

A slow RSI version proposed in TASC2015April.Please tell me which part need to modify.

srsi_final.zip srsi_final2.zip

(1st one is buggy second one better )
surely something missing

thanks to apollo12 and KKS (looks like it is coded)
Attached Images
File Type: jpg ES 12-14 (Daily) 25_06_2014 - 20_12_2014.jpg (94.4 KB, 24 views)
Attached Files
File Type: zip srsi_final0.03_beta.zip (4.3 KB, 3 views)
__________________
thx
nTuple

Disclaimer: I am not a Research Analyst and not registered with any regulating authority. All posts are for educational purpose only.

Consider us a dumb -dumble guy in this analysis, any type of real time example will be quick-learn approach.

Last edited by nTP; 16-03-2015 at 11:04 PM. Reason: updated with a new version
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 16-03-2015, 04:00 PM
ashis_ch ashis_ch is offline
Market Lizard
 
Join Date: Oct 2010
Posts: 272
Thanks: 582
Thanked 600 Times in 222 Posts
ashis_ch is a jewel in the roughashis_ch is a jewel in the roughashis_ch is a jewel in the roughashis_ch is a jewel in the roughashis_ch is a jewel in the roughashis_ch is a jewel in the roughashis_ch is a jewel in the rough
Default

See if this works in AMI...........

/////////////////

EMA6=EMA(C,6);

PD=IIf((Close-EMA6)>0,(Close-EMA6),0);
ND=IIf((EMA6-Close)>0,(EMA6-Close),0);

AVPD=Wilders(PD,14);
AVND=Wilders(ND,14);

SRS=AVPD/AVND;

SRSI1=(100-(100/(1+SRS)));

SRSI=IIf(AVND==0,100,IIf(AVPD==0,0,SRSI1));

Plot(SRSI,"",colorYellow,styleLine|styleThick);

PlotGrid(80,colorRed);
PlotGrid(20,colorGreen);

////////////////////////////////////////////
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 5 Users Say Thank You to ashis_ch For This Useful Post:
  #3 (permalink)  
Old 17-03-2015, 11:29 AM
nTP's Avatar
nTP nTP is offline
Flash Crash
 
Join Date: Dec 2013
Location: kolkata
Posts: 2,087
Thanks: 7,912
Thanked 2,313 Times in 1,380 Posts
nTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud of
Default

Originally Posted by ashis_ch View Post
See if this works in AMI...........

/////////////////

EMA6=EMA(C,6);

PD=IIf((Close-EMA6)>0,(Close-EMA6),0);
ND=IIf((EMA6-Close)>0,(EMA6-Close),0);

AVPD=Wilders(PD,14);
AVND=Wilders(ND,14);

SRS=AVPD/AVND;

SRSI1=(100-(100/(1+SRS)));

SRSI=IIf(AVND==0,100,IIf(AVPD==0,0,SRSI1));

Plot(SRSI,"",colorYellow,styleLine|styleThick);

PlotGrid(80,colorRed);
PlotGrid(20,colorGreen);

////////////////////////////////////////////


plz post a screen snap.i am on diff trading platform

unzipped code:

Code:
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    /// <summary>
    /// J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.
    /// </summary>
    [Description("J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.")]
    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,2*(emaperiod)-1)[0]);
			
			else
			{
			negativedifference.Set((EMA(Close,2*(emaperiod)-1)[0]-Close[0]));
			}
			
			
			//if(positivedifference[0]>=0)	
			Averagepositivedifference.Set(EMA(positivedifference,2*period-1)[0]);
			
			//if(negativedifference[0]>=0)
			Averagenegativedifference.Set(EMA(negativedifference,2*period-1)[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(EMA(SRSI,2)[0]);
        }

        #region Properties
        [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public DataSeries SRSIPlot0
        {
            get { return Values[0]; }
        }

        [Browsable(false)]	// this line prevents the data series from being displayed in the indicator properties dialog, do not remove
        [XmlIgnore()]		// this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
        public DataSeries EmaSRSI
        {
            get { return Values[1]; }
        }

        [Description("srsi period")]
        [GridCategory("Parameters")]
        public int Period
        {
            get { return period; }
            set { period = Math.Max(2, value); }
        }

        [Description("ema period ")]
        [GridCategory("Parameters")]
        public int Emaperiod
        {
            get { return emaperiod; }
            set { emaperiod = Math.Max(1, value); }
        }
        #endregion
    }
}

#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    public partial class Indicator : IndicatorBase
    {
        private srsi[] cachesrsi = null;

        private static srsi checksrsi = new srsi();

        /// <summary>
        /// J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.
        /// </summary>
        /// <returns></returns>
        public srsi srsi(int emaperiod, int period)
        {
            return srsi(Input, emaperiod, period);
        }

        /// <summary>
        /// J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.
        /// </summary>
        /// <returns></returns>
        public srsi srsi(Data.IDataSeries input, int emaperiod, int period)
        {
            if (cachesrsi != null)
                for (int idx = 0; idx < cachesrsi.Length; idx++)
                    if (cachesrsi[idx].Emaperiod == emaperiod && cachesrsi[idx].Period == period && cachesrsi[idx].EqualsInput(input))
                        return cachesrsi[idx];

            lock (checksrsi)
            {
                checksrsi.Emaperiod = emaperiod;
                emaperiod = checksrsi.Emaperiod;
                checksrsi.Period = period;
                period = checksrsi.Period;

                if (cachesrsi != null)
                    for (int idx = 0; idx < cachesrsi.Length; idx++)
                        if (cachesrsi[idx].Emaperiod == emaperiod && cachesrsi[idx].Period == period && cachesrsi[idx].EqualsInput(input))
                            return cachesrsi[idx];

                srsi indicator = new srsi();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.Emaperiod = emaperiod;
                indicator.Period = period;
                Indicators.Add(indicator);
                indicator.SetUp();

                srsi[] tmp = new srsi[cachesrsi == null ? 1 : cachesrsi.Length + 1];
                if (cachesrsi != null)
                    cachesrsi.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cachesrsi = tmp;
                return indicator;
            }
        }
    }
}

// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
    public partial class Column : ColumnBase
    {
        /// <summary>
        /// J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.srsi srsi(int emaperiod, int period)
        {
            return _indicator.srsi(Input, emaperiod, period);
        }

        /// <summary>
        /// J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.
        /// </summary>
        /// <returns></returns>
        public Indicator.srsi srsi(Data.IDataSeries input, int emaperiod, int period)
        {
            return _indicator.srsi(input, emaperiod, period);
        }
    }
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    public partial class Strategy : StrategyBase
    {
        /// <summary>
        /// J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.srsi srsi(int emaperiod, int period)
        {
            return _indicator.srsi(Input, emaperiod, period);
        }

        /// <summary>
        /// J. Welles Wilder’s classic relative strength index has enjoyed a large following of technical analysts over the years. Here’s a slow version of it.
        /// </summary>
        /// <returns></returns>
        public Indicator.srsi srsi(Data.IDataSeries input, int emaperiod, int period)
        {
            if (InInitialize && input == null)
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

            return _indicator.srsi(input, emaperiod, period);
        }
    }
}
#endregion
__________________
thx
nTuple

Disclaimer: I am not a Research Analyst and not registered with any regulating authority. All posts are for educational purpose only.

Consider us a dumb -dumble guy in this analysis, any type of real time example will be quick-learn approach.

Last edited by nTP; 17-03-2015 at 07:54 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 21-03-2015, 01:06 PM
nTP's Avatar
nTP nTP is offline
Flash Crash
 
Join Date: Dec 2013
Location: kolkata
Posts: 2,087
Thanks: 7,912
Thanked 2,313 Times in 1,380 Posts
nTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud ofnTP has much to be proud of
Default

https://www.bigmiketrading.com/downl...load.html?view
__________________
thx
nTuple

Disclaimer: I am not a Research Analyst and not registered with any regulating authority. All posts are for educational purpose only.

Consider us a dumb -dumble guy in this analysis, any type of real time example will be quick-learn approach.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to nTP For This Useful Post:
Reply

indiTraders - Forum for the Active Indian Trader > Tools > Software > NinjaTrader


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


DPonline

All times are GMT +5.5. The time now is 01:35 PM.


vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2