Hi,
I want to test the below strategy in Pi. I have written a code for it, but while backtesting, I am getting error, script generated no trade.
Below is the logic:-
Buy:-
Two 5 min green candles, close of 2nd candle is above close of 1st candle. 1st green candle closed above 50 period EMA along with RSI (14) > 50 & adx(14) > 25
REF(CLOSE,1) > REF(OPEN,1) AND
REF(CLOSE,2) > REF(OPEN,2) AND
REF(CLOSE,2) > REF(CLOSE,1) AND
CROSSOVER(REF(CLOSE,1),EMA(CLOSE,50)) AND
RSI(CLOSE,14) > 50 AND
ADX(14)>25
Sell:- Reverse logic as buy:-
REF(CLOSE,1) < REF(OPEN,1) AND
REF(CLOSE,2) < REF(OPEN,2) AND
REF(CLOSE,2) < REF(CLOSE,1) AND
CROSSOVER(REF(CLOSE,1),EMA(CLOSE,50)) AND
RSI(CLOSE,14) > 50 AND
ADX(14)>25
Can someone please help.
TIA