예제 #1
0
        /// <summary>
        /// Woodies Pivot Points.
        /// </summary>
        /// <returns></returns>
        public Indicator.WoodiesPivots WoodiesPivots(Data.IDataSeries input, Data.HLCCalculationMode priorDayHLC, int width)
        {
            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.WoodiesPivots(input, priorDayHLC, width));
        }
예제 #2
0
        /// <summary>
        /// Woodies Pivot Points.
        /// </summary>
        /// <returns></returns>
        public WoodiesPivots WoodiesPivots(Data.IDataSeries input, Data.HLCCalculationMode priorDayHLC, int width)
        {
            checkWoodiesPivots.PriorDayHLC = priorDayHLC;
            priorDayHLC = checkWoodiesPivots.PriorDayHLC;
            checkWoodiesPivots.Width = width;
            width = checkWoodiesPivots.Width;

            if (cacheWoodiesPivots != null)
            {
                for (int idx = 0; idx < cacheWoodiesPivots.Length; idx++)
                {
                    if (cacheWoodiesPivots[idx].PriorDayHLC == priorDayHLC && cacheWoodiesPivots[idx].Width == width && cacheWoodiesPivots[idx].EqualsInput(input))
                    {
                        return(cacheWoodiesPivots[idx]);
                    }
                }
            }

            WoodiesPivots indicator = new WoodiesPivots();

            indicator.BarsRequired        = BarsRequired;
            indicator.CalculateOnBarClose = CalculateOnBarClose;
            indicator.Input       = input;
            indicator.PriorDayHLC = priorDayHLC;
            indicator.Width       = width;
            indicator.SetUp();

            WoodiesPivots[] tmp = new WoodiesPivots[cacheWoodiesPivots == null ? 1 : cacheWoodiesPivots.Length + 1];
            if (cacheWoodiesPivots != null)
            {
                cacheWoodiesPivots.CopyTo(tmp, 0);
            }
            tmp[tmp.Length - 1] = indicator;
            cacheWoodiesPivots  = tmp;
            Indicators.Add(indicator);

            return(indicator);
        }
예제 #3
0
        /// <summary>
        /// Pivot Points.
        /// </summary>
        /// <returns></returns>
        public Indicator.SJC_Pivots SJC_Pivots(Data.IDataSeries input, Data.PivotRange pivotRangeType, Data.HLCCalculationMode priorDayHLC, double userDefinedClose, double userDefinedHigh, double userDefinedLow, int width)
        {
            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.SJC_Pivots(input, pivotRangeType, priorDayHLC, userDefinedClose, userDefinedHigh, userDefinedLow, width));
        }
예제 #4
0
 public Indicator.SJC_Pivots SJC_Pivots(Data.PivotRange pivotRangeType, Data.HLCCalculationMode priorDayHLC, double userDefinedClose, double userDefinedHigh, double userDefinedLow, int width)
 {
     return(_indicator.SJC_Pivots(Input, pivotRangeType, priorDayHLC, userDefinedClose, userDefinedHigh, userDefinedLow, width));
 }
예제 #5
0
        /// <summary>
        /// Pivot Points.
        /// </summary>
        /// <returns></returns>
        public SJC_Pivots SJC_Pivots(Data.IDataSeries input, Data.PivotRange pivotRangeType, Data.HLCCalculationMode priorDayHLC, double userDefinedClose, double userDefinedHigh, double userDefinedLow, int width)
        {
            if (cacheSJC_Pivots != null)
            {
                for (int idx = 0; idx < cacheSJC_Pivots.Length; idx++)
                {
                    if (cacheSJC_Pivots[idx].PivotRangeType == pivotRangeType && cacheSJC_Pivots[idx].PriorDayHLC == priorDayHLC && Math.Abs(cacheSJC_Pivots[idx].UserDefinedClose - userDefinedClose) <= double.Epsilon && Math.Abs(cacheSJC_Pivots[idx].UserDefinedHigh - userDefinedHigh) <= double.Epsilon && Math.Abs(cacheSJC_Pivots[idx].UserDefinedLow - userDefinedLow) <= double.Epsilon && cacheSJC_Pivots[idx].Width == width && cacheSJC_Pivots[idx].EqualsInput(input))
                    {
                        return(cacheSJC_Pivots[idx]);
                    }
                }
            }

            lock (checkSJC_Pivots)
            {
                checkSJC_Pivots.PivotRangeType = pivotRangeType;
                pivotRangeType = checkSJC_Pivots.PivotRangeType;
                checkSJC_Pivots.PriorDayHLC = priorDayHLC;
                priorDayHLC = checkSJC_Pivots.PriorDayHLC;
                checkSJC_Pivots.UserDefinedClose = userDefinedClose;
                userDefinedClose = checkSJC_Pivots.UserDefinedClose;
                checkSJC_Pivots.UserDefinedHigh = userDefinedHigh;
                userDefinedHigh = checkSJC_Pivots.UserDefinedHigh;
                checkSJC_Pivots.UserDefinedLow = userDefinedLow;
                userDefinedLow        = checkSJC_Pivots.UserDefinedLow;
                checkSJC_Pivots.Width = width;
                width = checkSJC_Pivots.Width;

                if (cacheSJC_Pivots != null)
                {
                    for (int idx = 0; idx < cacheSJC_Pivots.Length; idx++)
                    {
                        if (cacheSJC_Pivots[idx].PivotRangeType == pivotRangeType && cacheSJC_Pivots[idx].PriorDayHLC == priorDayHLC && Math.Abs(cacheSJC_Pivots[idx].UserDefinedClose - userDefinedClose) <= double.Epsilon && Math.Abs(cacheSJC_Pivots[idx].UserDefinedHigh - userDefinedHigh) <= double.Epsilon && Math.Abs(cacheSJC_Pivots[idx].UserDefinedLow - userDefinedLow) <= double.Epsilon && cacheSJC_Pivots[idx].Width == width && cacheSJC_Pivots[idx].EqualsInput(input))
                        {
                            return(cacheSJC_Pivots[idx]);
                        }
                    }
                }

                SJC_Pivots indicator = new SJC_Pivots();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input            = input;
                indicator.PivotRangeType   = pivotRangeType;
                indicator.PriorDayHLC      = priorDayHLC;
                indicator.UserDefinedClose = userDefinedClose;
                indicator.UserDefinedHigh  = userDefinedHigh;
                indicator.UserDefinedLow   = userDefinedLow;
                indicator.Width            = width;
                Indicators.Add(indicator);
                indicator.SetUp();

                SJC_Pivots[] tmp = new SJC_Pivots[cacheSJC_Pivots == null ? 1 : cacheSJC_Pivots.Length + 1];
                if (cacheSJC_Pivots != null)
                {
                    cacheSJC_Pivots.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cacheSJC_Pivots     = tmp;
                return(indicator);
            }
        }
예제 #6
0
 public Indicator.WoodiesPivots WoodiesPivots(Data.HLCCalculationMode priorDayHLC, int width)
 {
     return(_indicator.WoodiesPivots(Input, priorDayHLC, width));
 }