Tradescript not giving trades even though condition met

Hi,
I have the below strategy I am trying to code.

1 Candle = 60 Mins.

The code should scan the list of stock I provide during trading hours.

Condition:-

Buy :-

  1. EMA 50> EMA 100 and both sloping up.
    AND
  2. Price > EMA50 and EMA 100.
    AND
  3. RSI 9 > RSI 14 and both sloping up.
    AND
  4. Either of the below conditions in price happens.All below conditions should be OR.
    a) Last 3 or 4 or less candles have just touched EMA 50 or EMA 100 and then bouncing back ( to trade on intermediate corrections).
    b) Any of the Bullish Candlestick Patterns happen.

The Code I used is:-

Buy:-

(CLOSE > EMA(CLOSE, 50) AND
CLOSE > EMA(CLOSE, 100)) AND
(EMA(CLOSE, 50) > EMA(CLOSE, 100)) AND
TREND(EMA(CLOSE,50), 10) = UP AND
TREND(EMA(CLOSE,100), 10) = UP AND
((CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 1)) OR
CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 2)) OR
CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 3)) OR
CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 4))) OR
( REF(CLOSE, 1) <=
CSP()= BULLISH_ENGULFING_LINE OR
CSP()= ENGULFING_CANDLE OR
CSP() = LL OR
CSP()= STARS OR
CSP()= BULLISH_MATCHING_LOW OR
CSP()= BULLISH_BELT_HOLD OR
CSP()= BULLISH_KICKING OR
CSP()= BULLISH_HAMMER OR
CSP()= BULLISH_UPSIDE_GAP OR
CSP()= THREE_WHITE_SOLDIERS OR
CSP()= ABANDONED_BABY OR
CSP()= HARAMI_CROSS OR
CSP()= SPINNING_TOPS OR
CSP()= PIERCING_LINE OR
CSP()= MORNING_STAR OR
CSP()= HARAMI OR
CSP()= DOJI OR
CSP()= HAMMER)

Sell:-

(CLOSE < EMA(CLOSE, 50) AND
CLOSE < EMA(CLOSE, 100)) AND
(EMA(CLOSE, 50) < EMA(CLOSE, 100)) AND
TREND(EMA(CLOSE,50), 10) = DOWN AND
TREND(EMA(CLOSE,100), 10) = DOWN AND
((CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 1)) OR
CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 2)) OR
CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 3)) OR
CROSSOVER(EMA(CLOSE, 50), REF(CLOSE, 4))) OR
CSP()= DOJI OR
CSP()= HAMMER OR
CSP() = HARAMI OR
CSP()= STARS OR
CSP()= DOJI_STAR OR
CSP()= EVENING_STAR OR
CSP()= BEARISH_ENGULFING_LINE OR
CSP()= DARK_CLOUD_COVER OR
CSP()= HANGING_MAN OR
CSP()= BEARISH_DOJI_STAR OR
CSP()= BEARISH_SHOOTING_STAR OR
CSP()= SPINNING_TOPS OR
CSP()= THREE_BLACK_CROWS OR
CSP()= BEARISH_KICKING OR
CSP()= BEARISH_BELT_HOLD OR
CSP()= BEARISH_TWO_CROWS)

When it didn’t gave me trades I reduced it to mathc a condition I can see manualy in Banknifty Chart.

~~Buy:-

(CLOSE > EMA(CLOSE, 50) AND
CLOSE > EMA(CLOSE, 100))

Sell :-

~~Buy:-

(CLOSE < EMA(CLOSE, 50) AND
CLOSE < EMA(CLOSE, 100))

It still gave no trades.

My Questions are:-

  1. Please advice why this is happening?

  2. I also coded the MACD-RSI-ADX EA available in the public view while it gave good Back Testing result I created the same as my own EA.But when I tried to apply EA in a chart no list of EAs are comming in the screen,not even the public EAs.

  3. I tried using the same EA in a Scanner and it always gave me roor of “Scanner unable to load”.

you have made code very complex  as per the above given condition please check this below code and try to backtest and check in higher historical data.. like 30 days

Buy Script:

CROSSOVER(EMA(CLOSE,50),EMA(CLOSE,100)) AND RSI(CLOSE,9)>RSI(CLOSE,14) AND TREND(CLOSE,3)=UP

Sell Script:

CROSSOVER(EMA(CLOSE,100),EMA(CLOSE,50)) AND RSI(CLOSE,14)>RSI(CLOSE,9) AND TREND(CLOSE,3)=DOWN