indiTraders - Forum for the Active Indian Trader  

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

Reply
 
Bookmark and Share LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 15-09-2015, 08:28 PM
nTP's Avatar
nTP nTP is offline
Flash Crash
 
Join Date: Dec 2013
Location: kolkata
Posts: 2,023
Thanks: 7,757
Thanked 2,198 Times in 1,317 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 Klinger Volume Oscillator Positive Territory

Hi

http://www.positiveterritory.com/do/tw/kvo11.htm
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>
    /// DEFINITION of 'Klinger Oscillator'  
	/// A technical indicator developed by Stephen Klinger that is used to determine long-term trends 
	/// of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to 
	/// predict short-term reversals. This indicator compares the volume flowing in and out of a security
	/// to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  
	/// A signal line (13-period moving average) is used to trigger transaction decisions. This technique
	/// is very similar to signals that are created with other indicators such as the 'moving average 
	/// convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and 
	/// volume are not confirming the direction of the move. It is considered to be a bullish sign when 
	/// the value of the indicator is heading upward while the price of the security continues to fall. 
	/// Traders will use other tools such as trendlines, moving averages and other indicators to confirm 
	/// the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  
	/// Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or 
	/// KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a
	/// volume- and price-based oscillator intended to measure both short- and long-term money flows into
	/// and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both 
	/// short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based
	/// on volume.  The KVO is derived from three types of data: the high-low price range, volume, and 
	/// accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” 
	/// price (TP) for today and yesterday:      
	/// TPTODAY = (HTODAY + LTODAY + CTODAY) / 3    
	/// TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      
	/// If TPTODAY > TPYESTERDAY, then SV = +V     
	/// If TPTODAY < TPYESTERDAY, then SV = -V  
	/// In our research, we found no statement as to how to treat the case      
	/// TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive. 
	/// Klinger refers to the signed volume value SV as the “volume force.” A positive volume force 
	/// indicates accumulation, while a negative volume force indicates distribution.  
	/// Next, calculate two EMAs of the signed volume value and their difference:      
	/// KVO = EMA(34)(SV) - EMA(55)(SV)  
	/// Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the 
	/// KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from 
	/// price trends.  If KVO is rising and price is declining, this is a bullish divergence. 
	/// When KVO crosses over zero, expect a price increase.  
	/// If KVO is declining and price is rising, this is a bearish divergence. 
	/// When KVO crosses under zero, expect a price decline.  For our purposes, 
	/// we use only using the crossover form, not the divergence form, of KVO. 
	/// Positive Development Calculation:  For this TAI, a new positive development (NPD)
	/// occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line).
	/// That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under 
	/// the 13-period EMA of KVO (the trigger line) 
	/// That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, 
	/// it will no longer be new, but will be a cumulative positive development (CPD).  
	/// If this TAI was a new positive development (NPD) yesterday, and is still positive today,
	/// then it becomes a cumulative positive development (CPD). History: 
	/// Developed by Stephen I. Klinger, the KVO appeared in an article in 
	/// (Technical Analysis of) Stocks and Commodities magazine (December 1997). 
	/// An excerpt from the article appears at
	/// http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  
	/// Profiting from earlier research on volume by such well-known technicians as 
	/// Joseph Granville, Larry Williams, and Marc Chaikin, 
	/// Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses. 
	/// The KVO was developed with two apparently opposing goals in mind: 
	/// to be sensitive enough to signal short-term tops and bottoms, yet 
	/// accurate enough to reflect the long-term flow of money into and out of a security.  
	/// The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) 
	/// are numbers from the Fibonacci sequence where each number is the sum of the previous two 
	/// numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values
	/// were chosen, we leave that explanation to Mr. Klinger.  
	/// The chart below shows the Klinger Oscillator indicator in action.
	/// Notice the volatility of the signals and the potential for damaging whipsaws. 
	/// Shown are three times between February and June 2005 where KVO predicted a price rise. 
	/// Notice the whipsaw in May 2005. 
    /// </summary>
    [Description("DEFINITION of 'Klinger Oscillator'  A technical indicator developed by Stephen Klinger that is used to determine long-term trends of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to predict short-term reversals. This indicator compares the volume flowing in and out of a security to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  A signal line (13-period moving average) is used to trigger transaction decisions. This technique is very similar to signals that are created with other indicators such as the 'moving average convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and volume are not confirming the direction of the move. It is considered to be a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. Traders will use other tools such as trendlines, moving averages and other indicators to confirm the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a volume- and price-based oscillator intended to measure both short- and long-term money flows into and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based on volume.  The KVO is derived from three types of data: the high-low price range, volume, and accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” price (TP) for today and yesterday:      TPTODAY = (HTODAY + LTODAY + CTODAY) / 3     TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      If TPTODAY > TPYESTERDAY, then SV = +V     If TPTODAY < TPYESTERDAY, then SV = -V  In our research, we found no statement as to how to treat the case      TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive.  Klinger refers to the signed volume value SV as the “volume force.” A positive volume force indicates accumulation, while a negative volume force indicates distribution.  Next, calculate two EMAs of the signed volume value and their difference:      KVO = EMA(34)(SV) - EMA(55)(SV)  Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from price trends.  If KVO is rising and price is declining, this is a bullish divergence. When KVO crosses over zero, expect a price increase.  If KVO is declining and price is rising, this is a bearish divergence. When KVO crosses under zero, expect a price decline.  For our purposes, we use only using the crossover form, not the divergence form, of KVO. Positive Development Calculation:  For this TAI, a new positive development (NPD) occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line). That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under the 13-period EMA of KVO (the trigger line) That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, it will no longer be new, but will be a cumulative positive development (CPD).  If this TAI was a new positive development (NPD) yesterday, and is still positive today, then it becomes a cumulative positive development (CPD). History:  Developed by Stephen I. Klinger, the KVO appeared in an article in (Technical Analysis of) Stocks and Commodities magazine (December 1997). An excerpt from the article appears at http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  Profiting from earlier research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses.  The KVO was developed with two apparently opposing goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security.  The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) are numbers from the Fibonacci sequence where each number is the sum of the previous two numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values were chosen, we leave that explanation to Mr. Klinger.  The chart below shows the Klinger Oscillator indicator in action. Notice the volatility of the signals and the potential for damaging whipsaws. Shown are three times between February and June 2005 where KVO predicted a price rise. Notice the whipsaw in May 2005. ")]
    public class KVO14092015 : Indicator
    {
        
	#region KVOL UTIl	
		public IDataSeries KVOLfunc(IDataSeries TPYDAY,IDataSeries TPTOYDAY,int fastX,int trigLen,int slowX)
		{
			
			SVOL.Set(TPTOYDAY[0]>=TPTOYDAY[0] ? +Volume[0] : -Volume[0]);
			KVOL.Set(EMA(SVOL,fastX)[0]-EMA(SVOL,slowX)[0]);
			return  KVOL;
		}
		#endregion // KVOL Calculations
		
		
		
		#region Variables
		
		
		private const string		_versionText		= "V0.1Beta";
		private	const string 		_copyrightText	= "All rights reserved to nTuple And KKS.And All credit goes to Orginal researchers";
        // Wizard generated variables
		
        // Wizard generated variables
            private int trigLen = 13; // Default setting for TrigLen
            private int fastX = 34; // Default setting for FastX
            private int slowX = 55; // Default setting for SlowX
        // User defined variables (add any user defined variables below)
		
		private DataSeries KVOL;
		private DataSeries VOL;
		private DataSeries XFAST;
		private DataSeries XSLOW;
		private DataSeries XTREND;
		private DataSeries TPYDAY;
		private DataSeries TPTOYDAY;
		private DataSeries SVOL;
        #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()
        {
            Add(new Plot(Color.FromKnownColor(KnownColor.SaddleBrown), PlotStyle.Bar, "KVOx"));
            Add(new Plot(Color.FromKnownColor(KnownColor.DarkGreen), PlotStyle.Line, "TRIGGERx"));
            Add(new Line(Color.FromKnownColor(KnownColor.LightSeaGreen), 0, "OSCILLATORx"));
            Overlay				= false;
			
			
			XSLOW =new DataSeries(this);
			KVOL =new DataSeries(this);
			VOL =new DataSeries(this);
			XFAST =new DataSeries(this);
			SVOL =new DataSeries(this);
			XTREND =new DataSeries(this);
			TPYDAY=new DataSeries(this);
			TPTOYDAY=new DataSeries(this);
        }

        /// <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.
			
			//trigLen||CurrentBar>=slowX||CurrentBar>=fastX
			if(CurrentBar >= Math.Min(Math.Min(trigLen,slowX),fastX)) {
			TPYDAY.Set((High[1]+Low[1]+Open[1])/3);
			TPTOYDAY.Set((High[0]+Low[0]+Open[0])/3);
			KVOx.Set(KVOLfunc(TPYDAY,TPTOYDAY,fastX,trigLen,slowX)[0]);
            TRIGGERx.Set(EMA(KVOLfunc(TPYDAY,TPTOYDAY,fastX,trigLen,slowX),trigLen)[0]);
			}
			else
			Print("Not In Range");
        
        }

        #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 KVOx
        {
            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 TRIGGERx
        {
            get { return Values[1]; }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int TrigLen
        {
            get { return trigLen; }
            set { trigLen = Math.Max(1, value); }
        }

        [Description("For MA of KVOL")]
        [GridCategory("Parameters")]
        public int FastX
        {
            get { return fastX; }
            set { fastX = Math.Max(1, value); }
        }

        [Description("For MA of KVOL")]
        [GridCategory("Parameters")]
        public int SlowX
        {
            get { return slowX; }
            set { slowX = 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 KVO14092015[] cacheKVO14092015 = null;

        private static KVO14092015 checkKVO14092015 = new KVO14092015();

        /// <summary>
        /// DEFINITION of 'Klinger Oscillator'  A technical indicator developed by Stephen Klinger that is used to determine long-term trends of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to predict short-term reversals. This indicator compares the volume flowing in and out of a security to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  A signal line (13-period moving average) is used to trigger transaction decisions. This technique is very similar to signals that are created with other indicators such as the 'moving average convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and volume are not confirming the direction of the move. It is considered to be a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. Traders will use other tools such as trendlines, moving averages and other indicators to confirm the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a volume- and price-based oscillator intended to measure both short- and long-term money flows into and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based on volume.  The KVO is derived from three types of data: the high-low price range, volume, and accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” price (TP) for today and yesterday:      TPTODAY = (HTODAY + LTODAY + CTODAY) / 3     TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      If TPTODAY > TPYESTERDAY, then SV = +V     If TPTODAY < TPYESTERDAY, then SV = -V  In our research, we found no statement as to how to treat the case      TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive.  Klinger refers to the signed volume value SV as the “volume force.” A positive volume force indicates accumulation, while a negative volume force indicates distribution.  Next, calculate two EMAs of the signed volume value and their difference:      KVO = EMA(34)(SV) - EMA(55)(SV)  Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from price trends.  If KVO is rising and price is declining, this is a bullish divergence. When KVO crosses over zero, expect a price increase.  If KVO is declining and price is rising, this is a bearish divergence. When KVO crosses under zero, expect a price decline.  For our purposes, we use only using the crossover form, not the divergence form, of KVO. Positive Development Calculation:  For this TAI, a new positive development (NPD) occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line). That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under the 13-period EMA of KVO (the trigger line) That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, it will no longer be new, but will be a cumulative positive development (CPD).  If this TAI was a new positive development (NPD) yesterday, and is still positive today, then it becomes a cumulative positive development (CPD). History:  Developed by Stephen I. Klinger, the KVO appeared in an article in (Technical Analysis of) Stocks and Commodities magazine (December 1997). An excerpt from the article appears at http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  Profiting from earlier research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses.  The KVO was developed with two apparently opposing goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security.  The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) are numbers from the Fibonacci sequence where each number is the sum of the previous two numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values were chosen, we leave that explanation to Mr. Klinger.  The chart below shows the Klinger Oscillator indicator in action. Notice the volatility of the signals and the potential for damaging whipsaws. Shown are three times between February and June 2005 where KVO predicted a price rise. Notice the whipsaw in May 2005. 
        /// </summary>
        /// <returns></returns>
        public KVO14092015 KVO14092015(int fastX, int slowX, int trigLen)
        {
            return KVO14092015(Input, fastX, slowX, trigLen);
        }

        /// <summary>
        /// DEFINITION of 'Klinger Oscillator'  A technical indicator developed by Stephen Klinger that is used to determine long-term trends of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to predict short-term reversals. This indicator compares the volume flowing in and out of a security to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  A signal line (13-period moving average) is used to trigger transaction decisions. This technique is very similar to signals that are created with other indicators such as the 'moving average convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and volume are not confirming the direction of the move. It is considered to be a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. Traders will use other tools such as trendlines, moving averages and other indicators to confirm the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a volume- and price-based oscillator intended to measure both short- and long-term money flows into and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based on volume.  The KVO is derived from three types of data: the high-low price range, volume, and accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” price (TP) for today and yesterday:      TPTODAY = (HTODAY + LTODAY + CTODAY) / 3     TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      If TPTODAY > TPYESTERDAY, then SV = +V     If TPTODAY < TPYESTERDAY, then SV = -V  In our research, we found no statement as to how to treat the case      TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive.  Klinger refers to the signed volume value SV as the “volume force.” A positive volume force indicates accumulation, while a negative volume force indicates distribution.  Next, calculate two EMAs of the signed volume value and their difference:      KVO = EMA(34)(SV) - EMA(55)(SV)  Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from price trends.  If KVO is rising and price is declining, this is a bullish divergence. When KVO crosses over zero, expect a price increase.  If KVO is declining and price is rising, this is a bearish divergence. When KVO crosses under zero, expect a price decline.  For our purposes, we use only using the crossover form, not the divergence form, of KVO. Positive Development Calculation:  For this TAI, a new positive development (NPD) occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line). That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under the 13-period EMA of KVO (the trigger line) That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, it will no longer be new, but will be a cumulative positive development (CPD).  If this TAI was a new positive development (NPD) yesterday, and is still positive today, then it becomes a cumulative positive development (CPD). History:  Developed by Stephen I. Klinger, the KVO appeared in an article in (Technical Analysis of) Stocks and Commodities magazine (December 1997). An excerpt from the article appears at http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  Profiting from earlier research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses.  The KVO was developed with two apparently opposing goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security.  The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) are numbers from the Fibonacci sequence where each number is the sum of the previous two numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values were chosen, we leave that explanation to Mr. Klinger.  The chart below shows the Klinger Oscillator indicator in action. Notice the volatility of the signals and the potential for damaging whipsaws. Shown are three times between February and June 2005 where KVO predicted a price rise. Notice the whipsaw in May 2005. 
        /// </summary>
        /// <returns></returns>
        public KVO14092015 KVO14092015(Data.IDataSeries input, int fastX, int slowX, int trigLen)
        {
            if (cacheKVO14092015 != null)
                for (int idx = 0; idx < cacheKVO14092015.Length; idx++)
                    if (cacheKVO14092015[idx].FastX == fastX && cacheKVO14092015[idx].SlowX == slowX && cacheKVO14092015[idx].TrigLen == trigLen && cacheKVO14092015[idx].EqualsInput(input))
                        return cacheKVO14092015[idx];

            lock (checkKVO14092015)
            {
                checkKVO14092015.FastX = fastX;
                fastX = checkKVO14092015.FastX;
                checkKVO14092015.SlowX = slowX;
                slowX = checkKVO14092015.SlowX;
                checkKVO14092015.TrigLen = trigLen;
                trigLen = checkKVO14092015.TrigLen;

                if (cacheKVO14092015 != null)
                    for (int idx = 0; idx < cacheKVO14092015.Length; idx++)
                        if (cacheKVO14092015[idx].FastX == fastX && cacheKVO14092015[idx].SlowX == slowX && cacheKVO14092015[idx].TrigLen == trigLen && cacheKVO14092015[idx].EqualsInput(input))
                            return cacheKVO14092015[idx];

                KVO14092015 indicator = new KVO14092015();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.FastX = fastX;
                indicator.SlowX = slowX;
                indicator.TrigLen = trigLen;
                Indicators.Add(indicator);
                indicator.SetUp();

                KVO14092015[] tmp = new KVO14092015[cacheKVO14092015 == null ? 1 : cacheKVO14092015.Length + 1];
                if (cacheKVO14092015 != null)
                    cacheKVO14092015.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheKVO14092015 = 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>
        /// DEFINITION of 'Klinger Oscillator'  A technical indicator developed by Stephen Klinger that is used to determine long-term trends of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to predict short-term reversals. This indicator compares the volume flowing in and out of a security to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  A signal line (13-period moving average) is used to trigger transaction decisions. This technique is very similar to signals that are created with other indicators such as the 'moving average convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and volume are not confirming the direction of the move. It is considered to be a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. Traders will use other tools such as trendlines, moving averages and other indicators to confirm the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a volume- and price-based oscillator intended to measure both short- and long-term money flows into and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based on volume.  The KVO is derived from three types of data: the high-low price range, volume, and accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” price (TP) for today and yesterday:      TPTODAY = (HTODAY + LTODAY + CTODAY) / 3     TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      If TPTODAY > TPYESTERDAY, then SV = +V     If TPTODAY < TPYESTERDAY, then SV = -V  In our research, we found no statement as to how to treat the case      TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive.  Klinger refers to the signed volume value SV as the “volume force.” A positive volume force indicates accumulation, while a negative volume force indicates distribution.  Next, calculate two EMAs of the signed volume value and their difference:      KVO = EMA(34)(SV) - EMA(55)(SV)  Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from price trends.  If KVO is rising and price is declining, this is a bullish divergence. When KVO crosses over zero, expect a price increase.  If KVO is declining and price is rising, this is a bearish divergence. When KVO crosses under zero, expect a price decline.  For our purposes, we use only using the crossover form, not the divergence form, of KVO. Positive Development Calculation:  For this TAI, a new positive development (NPD) occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line). That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under the 13-period EMA of KVO (the trigger line) That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, it will no longer be new, but will be a cumulative positive development (CPD).  If this TAI was a new positive development (NPD) yesterday, and is still positive today, then it becomes a cumulative positive development (CPD). History:  Developed by Stephen I. Klinger, the KVO appeared in an article in (Technical Analysis of) Stocks and Commodities magazine (December 1997). An excerpt from the article appears at http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  Profiting from earlier research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses.  The KVO was developed with two apparently opposing goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security.  The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) are numbers from the Fibonacci sequence where each number is the sum of the previous two numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values were chosen, we leave that explanation to Mr. Klinger.  The chart below shows the Klinger Oscillator indicator in action. Notice the volatility of the signals and the potential for damaging whipsaws. Shown are three times between February and June 2005 where KVO predicted a price rise. Notice the whipsaw in May 2005. 
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.KVO14092015 KVO14092015(int fastX, int slowX, int trigLen)
        {
            return _indicator.KVO14092015(Input, fastX, slowX, trigLen);
        }

        /// <summary>
        /// DEFINITION of 'Klinger Oscillator'  A technical indicator developed by Stephen Klinger that is used to determine long-term trends of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to predict short-term reversals. This indicator compares the volume flowing in and out of a security to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  A signal line (13-period moving average) is used to trigger transaction decisions. This technique is very similar to signals that are created with other indicators such as the 'moving average convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and volume are not confirming the direction of the move. It is considered to be a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. Traders will use other tools such as trendlines, moving averages and other indicators to confirm the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a volume- and price-based oscillator intended to measure both short- and long-term money flows into and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based on volume.  The KVO is derived from three types of data: the high-low price range, volume, and accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” price (TP) for today and yesterday:      TPTODAY = (HTODAY + LTODAY + CTODAY) / 3     TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      If TPTODAY > TPYESTERDAY, then SV = +V     If TPTODAY < TPYESTERDAY, then SV = -V  In our research, we found no statement as to how to treat the case      TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive.  Klinger refers to the signed volume value SV as the “volume force.” A positive volume force indicates accumulation, while a negative volume force indicates distribution.  Next, calculate two EMAs of the signed volume value and their difference:      KVO = EMA(34)(SV) - EMA(55)(SV)  Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from price trends.  If KVO is rising and price is declining, this is a bullish divergence. When KVO crosses over zero, expect a price increase.  If KVO is declining and price is rising, this is a bearish divergence. When KVO crosses under zero, expect a price decline.  For our purposes, we use only using the crossover form, not the divergence form, of KVO. Positive Development Calculation:  For this TAI, a new positive development (NPD) occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line). That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under the 13-period EMA of KVO (the trigger line) That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, it will no longer be new, but will be a cumulative positive development (CPD).  If this TAI was a new positive development (NPD) yesterday, and is still positive today, then it becomes a cumulative positive development (CPD). History:  Developed by Stephen I. Klinger, the KVO appeared in an article in (Technical Analysis of) Stocks and Commodities magazine (December 1997). An excerpt from the article appears at http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  Profiting from earlier research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses.  The KVO was developed with two apparently opposing goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security.  The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) are numbers from the Fibonacci sequence where each number is the sum of the previous two numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values were chosen, we leave that explanation to Mr. Klinger.  The chart below shows the Klinger Oscillator indicator in action. Notice the volatility of the signals and the potential for damaging whipsaws. Shown are three times between February and June 2005 where KVO predicted a price rise. Notice the whipsaw in May 2005. 
        /// </summary>
        /// <returns></returns>
        public Indicator.KVO14092015 KVO14092015(Data.IDataSeries input, int fastX, int slowX, int trigLen)
        {
            return _indicator.KVO14092015(input, fastX, slowX, trigLen);
        }
    }
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    public partial class Strategy : StrategyBase
    {
        /// <summary>
        /// DEFINITION of 'Klinger Oscillator'  A technical indicator developed by Stephen Klinger that is used to determine long-term trends of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to predict short-term reversals. This indicator compares the volume flowing in and out of a security to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  A signal line (13-period moving average) is used to trigger transaction decisions. This technique is very similar to signals that are created with other indicators such as the 'moving average convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and volume are not confirming the direction of the move. It is considered to be a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. Traders will use other tools such as trendlines, moving averages and other indicators to confirm the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a volume- and price-based oscillator intended to measure both short- and long-term money flows into and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based on volume.  The KVO is derived from three types of data: the high-low price range, volume, and accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” price (TP) for today and yesterday:      TPTODAY = (HTODAY + LTODAY + CTODAY) / 3     TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      If TPTODAY > TPYESTERDAY, then SV = +V     If TPTODAY < TPYESTERDAY, then SV = -V  In our research, we found no statement as to how to treat the case      TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive.  Klinger refers to the signed volume value SV as the “volume force.” A positive volume force indicates accumulation, while a negative volume force indicates distribution.  Next, calculate two EMAs of the signed volume value and their difference:      KVO = EMA(34)(SV) - EMA(55)(SV)  Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from price trends.  If KVO is rising and price is declining, this is a bullish divergence. When KVO crosses over zero, expect a price increase.  If KVO is declining and price is rising, this is a bearish divergence. When KVO crosses under zero, expect a price decline.  For our purposes, we use only using the crossover form, not the divergence form, of KVO. Positive Development Calculation:  For this TAI, a new positive development (NPD) occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line). That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under the 13-period EMA of KVO (the trigger line) That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, it will no longer be new, but will be a cumulative positive development (CPD).  If this TAI was a new positive development (NPD) yesterday, and is still positive today, then it becomes a cumulative positive development (CPD). History:  Developed by Stephen I. Klinger, the KVO appeared in an article in (Technical Analysis of) Stocks and Commodities magazine (December 1997). An excerpt from the article appears at http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  Profiting from earlier research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses.  The KVO was developed with two apparently opposing goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security.  The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) are numbers from the Fibonacci sequence where each number is the sum of the previous two numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values were chosen, we leave that explanation to Mr. Klinger.  The chart below shows the Klinger Oscillator indicator in action. Notice the volatility of the signals and the potential for damaging whipsaws. Shown are three times between February and June 2005 where KVO predicted a price rise. Notice the whipsaw in May 2005. 
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.KVO14092015 KVO14092015(int fastX, int slowX, int trigLen)
        {
            return _indicator.KVO14092015(Input, fastX, slowX, trigLen);
        }

        /// <summary>
        /// DEFINITION of 'Klinger Oscillator'  A technical indicator developed by Stephen Klinger that is used to determine long-term trends of money flow while remaining sensitive enough to short-term fluctuations to enable a trader to predict short-term reversals. This indicator compares the volume flowing in and out of a security to price movement, and it is then turned into an oscillator. BREAKING DOWN 'Klinger Oscillator'  A signal line (13-period moving average) is used to trigger transaction decisions. This technique is very similar to signals that are created with other indicators such as the 'moving average convergence divergence'.  The Klinger Oscillator also uses divergence to identify when price and volume are not confirming the direction of the move. It is considered to be a bullish sign when the value of the indicator is heading upward while the price of the security continues to fall. Traders will use other tools such as trendlines, moving averages and other indicators to confirm the reversal.  TAI - Klinger Volume Oscillator 	   	 Name, Sometimes Called:  Klinger Volume Oscillator Also known as Klinger Oscillator Sometimes abbreviated KVO or KO Klinger is sometimes misspelled as Klingler. Brief Description:  The Klinger Oscillator is a volume- and price-based oscillator intended to measure both short- and long-term money flows into and out of a security. Definitions, Formulas:  Developed by Stephen J. Klinger to help in both short- and long-term analysis, the Klinger Volume Oscillator measures trends of money flows based on volume.  The KVO is derived from three types of data: the high-low price range, volume, and accumulation /distribution.  Determining KVO begins with calculating the so-called “typical” price (TP) for today and yesterday:      TPTODAY = (HTODAY + LTODAY + CTODAY) / 3     TPYESTERDAY = (HYESTERDAY + LYESTERDAY + CYESTERDAY) / 3  where      H = High, L = Low, and C = Close, respectively  Based on the TP values, assign a signed value (SV) to today’s volume (V):      If TPTODAY > TPYESTERDAY, then SV = +V     If TPTODAY < TPYESTERDAY, then SV = -V  In our research, we found no statement as to how to treat the case      TPTODAY = TPYESTERDAY  So for equal TP values, SV=+V. That is, we treat this case as positive.  Klinger refers to the signed volume value SV as the “volume force.” A positive volume force indicates accumulation, while a negative volume force indicates distribution.  Next, calculate two EMAs of the signed volume value and their difference:      KVO = EMA(34)(SV) - EMA(55)(SV)  Finally, calculate a 13-period EMA of the KVO, used as a trigger line for the KVO:      EMA(13)(KVO)  Note that the KVO TAI can also be used during divergence from price trends.  If KVO is rising and price is declining, this is a bullish divergence. When KVO crosses over zero, expect a price increase.  If KVO is declining and price is rising, this is a bearish divergence. When KVO crosses under zero, expect a price decline.  For our purposes, we use only using the crossover form, not the divergence form, of KVO. Positive Development Calculation:  For this TAI, a new positive development (NPD) occurs when the KVO crosses above the 13-period EMA of KVO (the trigger line). That is, KVO x+ EMA(13)(KVO).  This TAI is no longer positive when the KVO crosses under the 13-period EMA of KVO (the trigger line) That is, KVO x- EMA(13)(KVO).  If this TAI is still positive tomorrow, it will no longer be new, but will be a cumulative positive development (CPD).  If this TAI was a new positive development (NPD) yesterday, and is still positive today, then it becomes a cumulative positive development (CPD). History:  Developed by Stephen I. Klinger, the KVO appeared in an article in (Technical Analysis of) Stocks and Commodities magazine (December 1997). An excerpt from the article appears at http://www.traders.com/Documentation/FEEDbk_docs/Archive/1297/ Abstracts_new/Klinger9712/Kinger.html  The full article is available for purchase here: http://store.yahoo.com/traderscom/-v15-c12-identif-pdf.html  Profiting from earlier research on volume by such well-known technicians as Joseph Granville, Larry Williams, and Marc Chaikin, Klinger set out to develop a volume-based indicator to aid both short- and long-term analyses.  The KVO was developed with two apparently opposing goals in mind: to be sensitive enough to signal short-term tops and bottoms, yet accurate enough to reflect the long-term flow of money into and out of a security.  The values 13, 34, and 55 (the periods of the three EMAs used in the KVO) are numbers from the Fibonacci sequence where each number is the sum of the previous two numbers:      0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...  As to why those specific values were chosen, we leave that explanation to Mr. Klinger.  The chart below shows the Klinger Oscillator indicator in action. Notice the volatility of the signals and the potential for damaging whipsaws. Shown are three times between February and June 2005 where KVO predicted a price rise. Notice the whipsaw in May 2005. 
        /// </summary>
        /// <returns></returns>
        public Indicator.KVO14092015 KVO14092015(Data.IDataSeries input, int fastX, int slowX, int trigLen)
        {
            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.KVO14092015(input, fastX, slowX, trigLen);
        }
    }
}
#endregion
Attached Images
File Type: jpg HCLTECH_NS (Daily) 05_05_2015 - 11_09_2015.jpg (79.8 KB, 22 views)
Attached Files
File Type: zip kvol.zip (7.0 KB, 5 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; 15-09-2015 at 09:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 3 Users Say 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



All times are GMT +5.5. The time now is 12:25 PM.


vBulletin Copyright by vBulletin

Content Relevant URLs by vBSEO 3.3.2