Example #1
0
 public Indicator.ZADX ZADX(int aDXLength, RWT_MA.MAType aDXType, double barSmoothArg, RWT_HA.SecondaryOHLC barSmoothType, RWT_HA.PrimaryOHLC barsType, int dMLength, RWT_MA.MAType dMType)
 {
     return(_indicator.ZADX(Input, aDXLength, aDXType, barSmoothArg, barSmoothType, barsType, dMLength, dMType));
 }
Example #2
0
        /// <summary>
        /// better adx
        /// </summary>
        /// <returns></returns>
        public Indicator.ZADX ZADX(Data.IDataSeries input, int aDXLength, RWT_MA.MAType aDXType, double barSmoothArg, RWT_HA.SecondaryOHLC barSmoothType, RWT_HA.PrimaryOHLC barsType, int dMLength, RWT_MA.MAType dMType)
        {
            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.ZADX(input, aDXLength, aDXType, barSmoothArg, barSmoothType, barsType, dMLength, dMType));
        }
        /// <summary>
        /// price proxy
        /// </summary>
        /// <returns></returns>
        public Indicator.zPriceProxy2 zPriceProxy2(Data.IDataSeries input, double filterArg, RWT_MA.MAType filterType, int lookback, RWT_HA.PrimaryOHLC primaryType, double smoothArg, RWT_HA.SecondaryOHLC smoothType, double tolerance)
        {
            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.zPriceProxy2(input, filterArg, filterType, lookback, primaryType, smoothArg, smoothType, tolerance));
        }
Example #4
0
        /// <summary>
        /// better adx
        /// </summary>
        /// <returns></returns>
        public ZADX ZADX(Data.IDataSeries input, int aDXLength, RWT_MA.MAType aDXType, double barSmoothArg, RWT_HA.SecondaryOHLC barSmoothType, RWT_HA.PrimaryOHLC barsType, int dMLength, RWT_MA.MAType dMType)
        {
            if (cacheZADX != null)
            {
                for (int idx = 0; idx < cacheZADX.Length; idx++)
                {
                    if (cacheZADX[idx].ADXLength == aDXLength && cacheZADX[idx].ADXType == aDXType && Math.Abs(cacheZADX[idx].BarSmoothArg - barSmoothArg) <= double.Epsilon && cacheZADX[idx].BarSmoothType == barSmoothType && cacheZADX[idx].BarsType == barsType && cacheZADX[idx].DMLength == dMLength && cacheZADX[idx].DMType == dMType && cacheZADX[idx].EqualsInput(input))
                    {
                        return(cacheZADX[idx]);
                    }
                }
            }

            lock (checkZADX)
            {
                checkZADX.ADXLength     = aDXLength;
                aDXLength               = checkZADX.ADXLength;
                checkZADX.ADXType       = aDXType;
                aDXType                 = checkZADX.ADXType;
                checkZADX.BarSmoothArg  = barSmoothArg;
                barSmoothArg            = checkZADX.BarSmoothArg;
                checkZADX.BarSmoothType = barSmoothType;
                barSmoothType           = checkZADX.BarSmoothType;
                checkZADX.BarsType      = barsType;
                barsType                = checkZADX.BarsType;
                checkZADX.DMLength      = dMLength;
                dMLength                = checkZADX.DMLength;
                checkZADX.DMType        = dMType;
                dMType = checkZADX.DMType;

                if (cacheZADX != null)
                {
                    for (int idx = 0; idx < cacheZADX.Length; idx++)
                    {
                        if (cacheZADX[idx].ADXLength == aDXLength && cacheZADX[idx].ADXType == aDXType && Math.Abs(cacheZADX[idx].BarSmoothArg - barSmoothArg) <= double.Epsilon && cacheZADX[idx].BarSmoothType == barSmoothType && cacheZADX[idx].BarsType == barsType && cacheZADX[idx].DMLength == dMLength && cacheZADX[idx].DMType == dMType && cacheZADX[idx].EqualsInput(input))
                        {
                            return(cacheZADX[idx]);
                        }
                    }
                }

                ZADX indicator = new ZADX();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input         = input;
                indicator.ADXLength     = aDXLength;
                indicator.ADXType       = aDXType;
                indicator.BarSmoothArg  = barSmoothArg;
                indicator.BarSmoothType = barSmoothType;
                indicator.BarsType      = barsType;
                indicator.DMLength      = dMLength;
                indicator.DMType        = dMType;
                Indicators.Add(indicator);
                indicator.SetUp();

                ZADX[] tmp = new ZADX[cacheZADX == null ? 1 : cacheZADX.Length + 1];
                if (cacheZADX != null)
                {
                    cacheZADX.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cacheZADX           = tmp;
                return(indicator);
            }
        }
 public Indicator.zPriceProxy2 zPriceProxy2(double filterArg, RWT_MA.MAType filterType, int lookback, RWT_HA.PrimaryOHLC primaryType, double smoothArg, RWT_HA.SecondaryOHLC smoothType, double tolerance)
 {
     return(_indicator.zPriceProxy2(Input, filterArg, filterType, lookback, primaryType, smoothArg, smoothType, tolerance));
 }
        /// <summary>
        /// price proxy
        /// </summary>
        /// <returns></returns>
        public zPriceProxy2 zPriceProxy2(Data.IDataSeries input, double filterArg, RWT_MA.MAType filterType, int lookback, RWT_HA.PrimaryOHLC primaryType, double smoothArg, RWT_HA.SecondaryOHLC smoothType, double tolerance)
        {
            if (cachezPriceProxy2 != null)
            {
                for (int idx = 0; idx < cachezPriceProxy2.Length; idx++)
                {
                    if (Math.Abs(cachezPriceProxy2[idx].FilterArg - filterArg) <= double.Epsilon && cachezPriceProxy2[idx].FilterType == filterType && cachezPriceProxy2[idx].Lookback == lookback && cachezPriceProxy2[idx].PrimaryType == primaryType && Math.Abs(cachezPriceProxy2[idx].SmoothArg - smoothArg) <= double.Epsilon && cachezPriceProxy2[idx].SmoothType == smoothType && Math.Abs(cachezPriceProxy2[idx].Tolerance - tolerance) <= double.Epsilon && cachezPriceProxy2[idx].EqualsInput(input))
                    {
                        return(cachezPriceProxy2[idx]);
                    }
                }
            }

            lock (checkzPriceProxy2)
            {
                checkzPriceProxy2.FilterArg = filterArg;
                filterArg = checkzPriceProxy2.FilterArg;
                checkzPriceProxy2.FilterType = filterType;
                filterType = checkzPriceProxy2.FilterType;
                checkzPriceProxy2.Lookback = lookback;
                lookback = checkzPriceProxy2.Lookback;
                checkzPriceProxy2.PrimaryType = primaryType;
                primaryType = checkzPriceProxy2.PrimaryType;
                checkzPriceProxy2.SmoothArg = smoothArg;
                smoothArg = checkzPriceProxy2.SmoothArg;
                checkzPriceProxy2.SmoothType = smoothType;
                smoothType = checkzPriceProxy2.SmoothType;
                checkzPriceProxy2.Tolerance = tolerance;
                tolerance = checkzPriceProxy2.Tolerance;

                if (cachezPriceProxy2 != null)
                {
                    for (int idx = 0; idx < cachezPriceProxy2.Length; idx++)
                    {
                        if (Math.Abs(cachezPriceProxy2[idx].FilterArg - filterArg) <= double.Epsilon && cachezPriceProxy2[idx].FilterType == filterType && cachezPriceProxy2[idx].Lookback == lookback && cachezPriceProxy2[idx].PrimaryType == primaryType && Math.Abs(cachezPriceProxy2[idx].SmoothArg - smoothArg) <= double.Epsilon && cachezPriceProxy2[idx].SmoothType == smoothType && Math.Abs(cachezPriceProxy2[idx].Tolerance - tolerance) <= double.Epsilon && cachezPriceProxy2[idx].EqualsInput(input))
                        {
                            return(cachezPriceProxy2[idx]);
                        }
                    }
                }

                zPriceProxy2 indicator = new zPriceProxy2();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input       = input;
                indicator.FilterArg   = filterArg;
                indicator.FilterType  = filterType;
                indicator.Lookback    = lookback;
                indicator.PrimaryType = primaryType;
                indicator.SmoothArg   = smoothArg;
                indicator.SmoothType  = smoothType;
                indicator.Tolerance   = tolerance;
                Indicators.Add(indicator);
                indicator.SetUp();

                zPriceProxy2[] tmp = new zPriceProxy2[cachezPriceProxy2 == null ? 1 : cachezPriceProxy2.Length + 1];
                if (cachezPriceProxy2 != null)
                {
                    cachezPriceProxy2.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cachezPriceProxy2   = tmp;
                return(indicator);
            }
        }
Example #7
0
        /// <summary>
        /// Heiken Ashi Smoothed view
        /// </summary>
        /// <returns></returns>
        public Indicator.zHASmoothed zHASmoothed(Data.IDataSeries input, RWT_HA.PrimaryOHLC primaryType, double smoothArg, RWT_HA.SecondaryOHLC smoothType)
        {
            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.zHASmoothed(input, primaryType, smoothArg, smoothType));
        }
Example #8
0
 public Indicator.zHASmoothed zHASmoothed(RWT_HA.PrimaryOHLC primaryType, double smoothArg, RWT_HA.SecondaryOHLC smoothType)
 {
     return(_indicator.zHASmoothed(Input, primaryType, smoothArg, smoothType));
 }
Example #9
0
        /// <summary>
        /// Heiken Ashi Smoothed view
        /// </summary>
        /// <returns></returns>
        public zHASmoothed zHASmoothed(Data.IDataSeries input, RWT_HA.PrimaryOHLC primaryType, double smoothArg, RWT_HA.SecondaryOHLC smoothType)
        {
            if (cachezHASmoothed != null)
            {
                for (int idx = 0; idx < cachezHASmoothed.Length; idx++)
                {
                    if (cachezHASmoothed[idx].PrimaryType == primaryType && Math.Abs(cachezHASmoothed[idx].SmoothArg - smoothArg) <= double.Epsilon && cachezHASmoothed[idx].SmoothType == smoothType && cachezHASmoothed[idx].EqualsInput(input))
                    {
                        return(cachezHASmoothed[idx]);
                    }
                }
            }

            lock (checkzHASmoothed)
            {
                checkzHASmoothed.PrimaryType = primaryType;
                primaryType = checkzHASmoothed.PrimaryType;
                checkzHASmoothed.SmoothArg = smoothArg;
                smoothArg = checkzHASmoothed.SmoothArg;
                checkzHASmoothed.SmoothType = smoothType;
                smoothType = checkzHASmoothed.SmoothType;

                if (cachezHASmoothed != null)
                {
                    for (int idx = 0; idx < cachezHASmoothed.Length; idx++)
                    {
                        if (cachezHASmoothed[idx].PrimaryType == primaryType && Math.Abs(cachezHASmoothed[idx].SmoothArg - smoothArg) <= double.Epsilon && cachezHASmoothed[idx].SmoothType == smoothType && cachezHASmoothed[idx].EqualsInput(input))
                        {
                            return(cachezHASmoothed[idx]);
                        }
                    }
                }

                zHASmoothed indicator = new zHASmoothed();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input       = input;
                indicator.PrimaryType = primaryType;
                indicator.SmoothArg   = smoothArg;
                indicator.SmoothType  = smoothType;
                Indicators.Add(indicator);
                indicator.SetUp();

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