Intraday/Positional (one day time frame) strategy for backtesting

Wish to backtest this idea. Can someone help me convert this into a code please

Setup

Timeframe : 5min chart
EMA : 110 period
CCI : 14 days

RULE

BUY / GO LONG CONDITION

a) The 5 min candle should be above 110 EMA. 
b) CCI should be > 100. Require this only for ENTRY not for EXIT. Needs to act as a FILTER to avoid false Traps
c) 0.10% filter on the High price

SELL / GO SHORT CONDITION

a) The 5 min candle should be below 110 EMA. 
b) CCI should be < -100.
c) A 0.10% filter on the Low price

EXIT : Rs.10/- min 

SL : Rs.10/- (wish to keep RR as 1:1)

1 Like


Select 5 minute candle chart

Buy:

CLOSE>EMA(CLOSE, 110) AND CCI(12, SIMPLE) > 100 AND VHF(HIGH, 21) > 0.1

Sell:

CLOSE<EMA(CLOSE, 110) AND CCI(12, SIMPLE) > -100 AND VHF(HIGH, 21) > 0.1
1 Like

Thanks, will test it