Here is an algo-strategy with CCI to improve:
Purchase conditions (BUY)
– When the CCI is negative (and)
– When the (array of) CCI reaches the lowest value ==> Then buy (BUY)
– “Exit when the CCI reaches the highest point and as soon as it begins to descend”
Conditions of sale (SELL)
– When the CCI is positive (and)
– When the (array of) CCI reaches the highest value ==> Then sell (SELLSHORT)
– “Exit when the CCI reaches the lowest point and as soon as it starts to rise”
Here is the code to improve:
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
Thank you for your contributions to the science of trading.
Don Macdo.
It is slightly positive on 200 bar, largerly negative on 200K bars.
I can only suggest to always test strategies using the maximun available units.