// CandleBuilders call this function when registered with them
        // and a new candle is built
        // one distinguished calling CandleBuilder by handle in candle and period
        public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle)
        {
            if ((pPeriod == Minutes) && (pCBTitle == "cbx"))
            {
                HMA.ReceiveTick(pCandle.C);
                FMA.ReceiveTick(pCandle.C);
                CCI.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
                //BBands.ReceiveTick(pCandle.C);
                //StochRSI.ReceiveTick(pCandle.C);

                if (HMA.Value() != 0)
                {
                    Derivatives.ReceiveTick(HMA.Value());
                    BBands.ReceiveTick(HMA.Value());
                    StochRSI.ReceiveTick(HMA.Value());
                }

                if ((cbx.candlecount > 3) && (Derivatives.isPrimed()) && (StochRSI.isPrimed()))
                {
                    double deriv2;
                    double deriv1;

                    Derivatives.Value(out deriv1, out deriv2);

                    Deriv1.Add(deriv1);
                    Deriv2.Add(deriv2);

                    if (Deriv2.tickcount > 2)
                    {
                        DecisionFunction();
                    }
                }
            }
        }
Esempio n. 2
0
        public void ReceiveCandle(sCandle pCandle)
        {
            Candle = pCandle;

            ATR.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
            BB.ReceiveTick(pCandle.C);
            CCI.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
            Derivatives.ReceiveTick(pCandle.C);
            EMA.ReceiveTick(pCandle.C);
            FMA.ReceiveTick(pCandle.C);
            HMA.ReceiveTick(pCandle.C);
            MACD.ReceiveTick(pCandle.C);
            Momemtum.ReceiveTick(pCandle.C);
            RSI.ReceiveTick(pCandle.C);
            Renko.ReceiveTick(pCandle.C);
            SMA.ReceiveTick(pCandle.C);
            STARCBands.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
            STDDEV.ReceiveTick(pCandle.C);
            Slope.ReceiveTick(pCandle.C);
            StochRSI.ReceiveTick(pCandle.C);
            Stochastics.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
            Stub.ReceiveTick(pCandle.C);
            Trend.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
            TrueRange.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
            WMA.ReceiveTick(pCandle.C);
        }
Esempio n. 3
0
        public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle)
        {
            if ((pPeriod == Minutes) && (pCBTitle == "cbx"))
            {
                Candle = pCandle;
                CCI.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);
                TCCI.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C);

                // need to put primed values into this indicators
                // not primed right now to decrease down time
                CCIH.Add(CCI.Value());
                TCCIH.Add(CCI.Value());
                CCISlope.ReceiveTick(CCI.Value());

                if (CCI.isPrimed() && TCCI.isPrimed())
                {
                    DecisionFunction();
                }
            }
        }