DEFPARAM CumulateOrders = False
Once Interval = 55 // Default value = 14
// STL = 100 // OK at 100 for BTC &&& at 300-500 for Forex
REM Purchase
indicoteNegatif = CCI [Interval] (Close) <0
indicator1 = CCI [Interval] (Close)
indicator2 = CCI [Interval] (Close [2])
indicator3 = CCI [Interval] (Close [3])
c1 = (indicator3 <indicator2) AND (indicator1> indicator2)
IF indicote Negative AND c1 THEN
EXITSHORT AT MARKET
BUY 1 SHARES AT MARKET
//// Risk management
// “Exit when the CCI reaches the highest point and as soon as it starts to drop”
if CCI [Interval] (Close [3]) <CCI [Interval] (Close [1]) then
EXITSHORT AT MARKET
endif
ENDIF
REM Sale
indicotePositif = CCI [Interval] (Close)> 0
c2 = (indicator3> indicator2) AND (indicator1 <indicator2)
IF indicote Positive AND c2 THEN
EXITSHORT AT MARKET
SELLSHORT 1 SHARES AT MARKET
//// Risk management
// “Exit when the CCI reaches the lowest point and as soon as it starts to rise”
if CCI [Interval] (Close [3])> CCI [Interval] (Close [1]) then
EXITSHORT AT MARKET
endif
ENDIF