コード例 #1
0
 /**
  * Constructor.
  *
  * @param indicator the indicator
  * @param timeFrame the time frame
  */
 public DoubleEMAIndicator(IIndicator <decimal> indicator, int timeFrame)
     : base(indicator)
 {
     _timeFrame = timeFrame;
     _ema       = new EMAIndicator(indicator, timeFrame);
     _emaEma    = new EMAIndicator(_ema, timeFrame);
 }
コード例 #2
0
ファイル: PPOIndicator.cs プロジェクト: johndpope/TA4Net
 /**
  * Constructor.
  *
  * @param indicator the indicator
  * @param shortTimeFrame the short time frame
  * @param longTimeFrame the long time frame
  */
 public PPOIndicator(IIndicator <decimal> indicator, int shortTimeFrame, int longTimeFrame)
     : base(indicator)
 {
     if (shortTimeFrame > longTimeFrame)
     {
         throw new ArgumentException("Long term period count must be greater than short term period count");
     }
     _shortTermEma = new EMAIndicator(indicator, shortTimeFrame);
     _longTermEma  = new EMAIndicator(indicator, longTimeFrame);
 }
コード例 #3
0
        /**
         * Constructor.
         * @param series the time series
         * @param emaTimeFrame the time frame for EMAs (usually 9)
         * @param timeFrame the time frame
         */
        public MassIndexIndicator(ITimeSeries series, int emaTimeFrame, int timeFrame)
            : base(series)
        {
            IIndicator <decimal> highLowDifferential = new DifferenceIndicator(
                new MaxPriceIndicator(series),
                new MinPriceIndicator(series)
                );

            _singleEma = new EMAIndicator(highLowDifferential, emaTimeFrame);
            _doubleEma = new EMAIndicator(_singleEma, emaTimeFrame); // Not the same formula as doubleEMAIndicator
            _timeFrame = timeFrame;
        }
コード例 #4
0
        public TSIIndicator(IIndicator <decimal> indicator, ITimeSeries timeSeries) : base(timeSeries)
        {
            _indicator = indicator;

            // Double Smoothed price change
            _differenceIndicator                = new DifferenceIndicator(indicator, new PreviousValueIndicator(indicator));
            _ema25OfPriceChangeIndicator        = new EMAIndicator(_differenceIndicator, 25);
            _ema13OfEma25OfPriceChangeIndicator = new EMAIndicator(_ema25OfPriceChangeIndicator, 13);

            // Double Smoothed Absolute price change
            _absolutePriceChangeIndicator               = new AbsoluteIndicator(_differenceIndicator);
            _ema25OfAbsolutePriceChangeIndicator        = new EMAIndicator(_absolutePriceChangeIndicator, 25);
            _ema13OfEma25OfAbsolutePriceChangeIndicator = new EMAIndicator(_ema25OfAbsolutePriceChangeIndicator, 13);
        }