// 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(); } } } }
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); }
public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle) { if ((pPeriod == Minutes) && (pCBTitle == "cbx")) { CandlePatterns.ReceiveTick(pCandle.O, pCandle.H, pCandle.L, pCandle.C); DecisionFunction(); } }
public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle) { if ((pPeriod == Minutes) && (pCBTitle == "cbx")) { Candle = pCandle; DecisionFunction(); } }
// called from CandleBuilder public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle) { if ((pPeriod == Minutes) && (pCBTitle == "cbx")) { StochRSI.ReceiveTick(pCandle.C); RSISlope.ReceiveTick(StochRSI.Value()); DecisionFunction(); } }
public void ReceiveTick(double pO, double pH, double pL, double pC) { sCandle candle = new sCandle(); candle.O = pO; candle.H = pH; candle.L = pL; candle.C = pC; Prices.Add(candle); }
// 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")) { // must manually send candle values to indicator(s) in use // that way, same indicator can be used twice with different // candle periods, or different values (C, O, avg(H,L,C)) // after that, call decision function DecisionFunction(); } }
// 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")) { if (cbx.candlecount > PeriodsLong + PeriodsShort) { MaxAbsDeriv = -1.0E-25; double Sum; sCandle Candle; Sum = 0; for (int i = 1; i < PeriodsLong + 1; i++) { Candle = cbx.GetCandle(i); double a = (Candle.H + Candle.L) / 2; Sum += a; Candle = cbx.GetCandle(i + 1); double b = (Candle.H + Candle.L) / 2; Candle = cbx.GetCandle(i + 2); double c = (Candle.H + Candle.L) / 2; double deriv2 = Math.Abs(a - 2 * b + c); if (deriv2 > MaxAbsDeriv) { MaxAbsDeriv = deriv2; } if (i == 1) { Deriv2 = deriv2; } } AvgLong = Sum / PeriodsLong; Sum = 0; for (int i = PeriodsLong + 1; i < PeriodsLong + PeriodsShort + 1; i++) { Candle = cbx.GetCandle(i); Sum += (Candle.H + Candle.L) / 2; } AvgShort = Sum / PeriodsShort; // after that, call decision function DecisionFunction(); } } }
public void ReceiveTick(double pO, double pH, double pL, double pC) { sCandle candle = new sCandle(); PreviousCandle = CurrentCandle; candle.O = pO; candle.H = pH; candle.L = pL; candle.C = pC; CurrentCandle = candle; }
public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle) { if ((pPeriod == Minutes) && (pCBTitle == "cbx")) { Candle = pCandle; if (minmax.isPrimed()) { DecisionFunction(); } // do not include current candle in Min/Max data // until after the decision function minmax.ReceiveTick(Candle.H); minmax.ReceiveTick(Candle.L); } }
public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle) { if ((pPeriod == Minutes) && (pCBTitle == "cbx")) { double TP = (pCandle.H + pCandle.L + pCandle.C) / 3; Candle = pCandle; BBands.ReceiveTick(pCandle.C); HMA.ReceiveTick(TP); if (BBands.isPrimed() && HMA.isPrimed()) { DecisionFunction(); } } }
public void ReceiveTick(double pO, double pH, double pL, double pC) { sCandle Candle = new sCandle(); Candle.O = pO; Candle.H = pH; Candle.L = pL; Candle.C = pC; Candles[(tickcount % maxcandles)] = Candle; // avoid overflow by restricting range of tickcount // when indicator is fully primed tickcount++; if (tickcount == (3 * maxcandles)) { tickcount = (2 * maxcandles); } }
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(); } } }
public void ReceiveTick(double pO, double pH, double pL, double pC) { Trend.ReceiveTick(pO, pH, pL, pC); sCandle Candle = new sCandle(); Candle.O = pO; Candle.H = pH; Candle.L = pL; Candle.C = pC; Candles[(tickcount % CandlesToBuffer)] = Candle; // avoid overflow by restricting range of tickcount // when indicator is fully primed tickcount++; if (tickcount == (3 * CandlesToBuffer)) { tickcount = (2 * CandlesToBuffer); } }
public iTrueRange() { PreviousCandle = null; CurrentCandle = null; }
public override void ReceiveCandle(sCandle pCandle, int pPeriod, string pCBTitle) { }