예제 #1
0
 public Indicator.anaPivotsWeeklyV43 anaPivotsWeeklyV43(anaSessionCountPW43 activeSession, anaCalcModePW43 calcMode, anaPivotStylesPW43 pivotFormula, anaSessionTypePW43 pivotSession, bool showMidpivots, bool showPriorPeriods, double userDefinedClose, double userDefinedHigh, double userDefinedLow)
 {
     return _indicator.anaPivotsWeeklyV43(Input, activeSession, calcMode, pivotFormula, pivotSession, showMidpivots, showPriorPeriods, userDefinedClose, userDefinedHigh, userDefinedLow);
 }
예제 #2
0
        /// <summary>
        /// Weekly Session Pivots.
        /// </summary>
        /// <returns></returns>
        public Indicator.anaPivotsWeeklyV43 anaPivotsWeeklyV43(Data.IDataSeries input, anaSessionCountPW43 activeSession, anaCalcModePW43 calcMode, anaPivotStylesPW43 pivotFormula, anaSessionTypePW43 pivotSession, bool showMidpivots, bool showPriorPeriods, double userDefinedClose, double userDefinedHigh, double userDefinedLow)
        {
            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.anaPivotsWeeklyV43(input, activeSession, calcMode, pivotFormula, pivotSession, showMidpivots, showPriorPeriods, userDefinedClose, userDefinedHigh, userDefinedLow);
        }
예제 #3
0
        /// <summary>
        /// Weekly Session Pivots.
        /// </summary>
        /// <returns></returns>
        public anaPivotsWeeklyV43 anaPivotsWeeklyV43(Data.IDataSeries input, anaSessionCountPW43 activeSession, anaCalcModePW43 calcMode, anaPivotStylesPW43 pivotFormula, anaSessionTypePW43 pivotSession, bool showMidpivots, bool showPriorPeriods, double userDefinedClose, double userDefinedHigh, double userDefinedLow)
        {
            if (cacheanaPivotsWeeklyV43 != null)
                for (int idx = 0; idx < cacheanaPivotsWeeklyV43.Length; idx++)
                    if (cacheanaPivotsWeeklyV43[idx].ActiveSession == activeSession && cacheanaPivotsWeeklyV43[idx].CalcMode == calcMode && cacheanaPivotsWeeklyV43[idx].PivotFormula == pivotFormula && cacheanaPivotsWeeklyV43[idx].PivotSession == pivotSession && cacheanaPivotsWeeklyV43[idx].ShowMidpivots == showMidpivots && cacheanaPivotsWeeklyV43[idx].ShowPriorPeriods == showPriorPeriods && Math.Abs(cacheanaPivotsWeeklyV43[idx].UserDefinedClose - userDefinedClose) <= double.Epsilon && Math.Abs(cacheanaPivotsWeeklyV43[idx].UserDefinedHigh - userDefinedHigh) <= double.Epsilon && Math.Abs(cacheanaPivotsWeeklyV43[idx].UserDefinedLow - userDefinedLow) <= double.Epsilon && cacheanaPivotsWeeklyV43[idx].EqualsInput(input))
                        return cacheanaPivotsWeeklyV43[idx];

            lock (checkanaPivotsWeeklyV43)
            {
                checkanaPivotsWeeklyV43.ActiveSession = activeSession;
                activeSession = checkanaPivotsWeeklyV43.ActiveSession;
                checkanaPivotsWeeklyV43.CalcMode = calcMode;
                calcMode = checkanaPivotsWeeklyV43.CalcMode;
                checkanaPivotsWeeklyV43.PivotFormula = pivotFormula;
                pivotFormula = checkanaPivotsWeeklyV43.PivotFormula;
                checkanaPivotsWeeklyV43.PivotSession = pivotSession;
                pivotSession = checkanaPivotsWeeklyV43.PivotSession;
                checkanaPivotsWeeklyV43.ShowMidpivots = showMidpivots;
                showMidpivots = checkanaPivotsWeeklyV43.ShowMidpivots;
                checkanaPivotsWeeklyV43.ShowPriorPeriods = showPriorPeriods;
                showPriorPeriods = checkanaPivotsWeeklyV43.ShowPriorPeriods;
                checkanaPivotsWeeklyV43.UserDefinedClose = userDefinedClose;
                userDefinedClose = checkanaPivotsWeeklyV43.UserDefinedClose;
                checkanaPivotsWeeklyV43.UserDefinedHigh = userDefinedHigh;
                userDefinedHigh = checkanaPivotsWeeklyV43.UserDefinedHigh;
                checkanaPivotsWeeklyV43.UserDefinedLow = userDefinedLow;
                userDefinedLow = checkanaPivotsWeeklyV43.UserDefinedLow;

                if (cacheanaPivotsWeeklyV43 != null)
                    for (int idx = 0; idx < cacheanaPivotsWeeklyV43.Length; idx++)
                        if (cacheanaPivotsWeeklyV43[idx].ActiveSession == activeSession && cacheanaPivotsWeeklyV43[idx].CalcMode == calcMode && cacheanaPivotsWeeklyV43[idx].PivotFormula == pivotFormula && cacheanaPivotsWeeklyV43[idx].PivotSession == pivotSession && cacheanaPivotsWeeklyV43[idx].ShowMidpivots == showMidpivots && cacheanaPivotsWeeklyV43[idx].ShowPriorPeriods == showPriorPeriods && Math.Abs(cacheanaPivotsWeeklyV43[idx].UserDefinedClose - userDefinedClose) <= double.Epsilon && Math.Abs(cacheanaPivotsWeeklyV43[idx].UserDefinedHigh - userDefinedHigh) <= double.Epsilon && Math.Abs(cacheanaPivotsWeeklyV43[idx].UserDefinedLow - userDefinedLow) <= double.Epsilon && cacheanaPivotsWeeklyV43[idx].EqualsInput(input))
                            return cacheanaPivotsWeeklyV43[idx];

                anaPivotsWeeklyV43 indicator = new anaPivotsWeeklyV43();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.ActiveSession = activeSession;
                indicator.CalcMode = calcMode;
                indicator.PivotFormula = pivotFormula;
                indicator.PivotSession = pivotSession;
                indicator.ShowMidpivots = showMidpivots;
                indicator.ShowPriorPeriods = showPriorPeriods;
                indicator.UserDefinedClose = userDefinedClose;
                indicator.UserDefinedHigh = userDefinedHigh;
                indicator.UserDefinedLow = userDefinedLow;
                Indicators.Add(indicator);
                indicator.SetUp();

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