Could you please code this strategy for pi?

Setup

1). Timeframe : 5min chart
2). EMA : 110 period
3). CCI : 14 days

Why EMA 110? To be frank no idea but when tested proved with results to guage the TREND!

RULE

BUY / GO LONG CONDITION

a). The 5 min candle should be above 110 EMA.
b). CCI should be > 100. We consider CCI reading only for ENTRY not for EXIT. This CCI will act as a FILTER to avoid false Traps
c). A 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. We consider CCI reading only for ENTRY and not for EXIT. This CCI will act as a FILTER to avoid false Traps
c). A 0.10% filter on the Low price

As per above condition

Buy Script:

LOW>EMA(CLOSE,110)*1.001 AND
CCI(14, SIMPLE) > 100

Sell Script:

HIGH<EMA(CLOSE,110)*99.999  AND
CCI(14, SIMPLE) < -100 

you have to select 5 min time frame in chart

1 Like