Exemplo n.º 1
0
        private bool IsLongSetup(PriceBars priceBar)
        {
            int  lastBearishCandle = LastBearishCandle(priceBar);
            bool closedMidCandle   = lastBearishCandle != int.MinValue;

            if (lastBearishCandle > 0)
            {
                closedMidCandle = priceBar.Last(lastBearishCandle).High > priceBar.Last(lastBearishCandle - 1).Close&& priceBar.Last(lastBearishCandle).Low > priceBar.Last(lastBearishCandle - 1).Close;
            }

            return(rsi.Value() < 50 && stoch.PercentD() < 50 && CrossesAbove(stoch.PercentK(1), stoch.PercentK(), stoch.PercentD(1), stoch.PercentD()) && closedMidCandle);
        }
Exemplo n.º 2
0
        private TrendDirectionMode GetMajorTrend()
        {
            TrendDirectionMode trend;

            if (CrossesAbove(stochMajor.PercentK(1), stochMajor.PercentK(), stochMajor.PercentD(1), stochMajor.PercentD()))
            {
                trend = TrendDirectionMode.Bullish;
            }
            else if (CrossesBelow(stochMajor.PercentK(1), stochMajor.PercentK(), stochMajor.PercentD(1), stochMajor.PercentD()))
            {
                trend = TrendDirectionMode.Bearish;
            }
            else
            {
                trend = TrendDirectionMode.Neutral;
            }
            return(trend);
        }
Exemplo n.º 3
0
        private bool RisingStochasticLines()
        {
            bool rising = false;

            if (!double.IsNaN(stoch.PercentK(2)))
            {
                double averagePreviousPercentK = (stoch.PercentK(1) + stoch.PercentK(2)) / 2;
                double averagePreviousPercentD = (stoch.PercentD(1) + stoch.PercentD(2)) / 2;
                rising = averagePreviousPercentK < stoch.PercentK() && averagePreviousPercentD < stoch.PercentD();
            }
            return(rising);
        }
Exemplo n.º 4
0
 private bool IsLongSetup(PriceBars priceBar)
 {
     return(stoc.PercentK() > 63 && psar.Direction(1) != psar.Direction() && psar.Direction() == 1 && priceBar.LastItem.Close > ema.Value());
 }
Exemplo n.º 5
0
 private bool IsLongSetup(PriceBars priceBar)
 {
     return(majorTrend == TrendDirectionMode.Bullish && CrossesAbove(stochRetrace.PercentK(1), stochRetrace.PercentK(), stochRetrace.PercentD(1), stochRetrace.PercentD()));
 }
Exemplo n.º 6
0
 private bool IsLongSetup(PriceBars priceBar)
 {
     return(CrossesAbove(stoch.PercentK(1), stoch.PercentK(), stoch.PercentD(1), stoch.PercentD()));
 }
Exemplo n.º 7
0
 private bool IsWithinOversoldRange()
 {
     return(stoc.PercentK() > OVERSOLD_START);
 }