Strategy trend trading when CCI is back from overbought zone
Forums › ProRealTime English forum › ProOrder support › Strategy trend trading when CCI is back from overbought zone
- This topic has 7 replies, 3 voices, and was last updated 3 years ago by
murre87.
-
-
09/10/2021 at 8:46 AM #177184
Hello,
On Twitter, someone was manually backtesting CCI crosses under 100 with SMA200 increasing, on GLO (GL Events).
We were exchanging on the SL position, SMA200 vs SMA20.
I was thinking that BOLLINGERDOWN could be a good compromise, so decided to code this strategy, comparing the 3 SLs.Assets: stocks
Period: Daily
Fees: 0.5% per order
Position: 1000EURStrategy CCI in an uptrend12345678910111213141516171819202122232425262728293031323334DEFPARAM CumulateOrders=False// Variables to optimizeCAPITALInit = 1000 // amount to investREINV = 0 // reinvest profits or notstrategy = 2 // SL BOLLINGERDOWNRRR=1 // Risk Reward RatioIF REINV = 0 THENn = round((CapitalInit / close))ELSIF REINV = 1 THENcapital = (CAPITALinit + strategyprofit)n = round((capital/close))ENDIFma200 = Average[200]c0 = Close>0.5c1 = c0 and CCI[20] crosses under 100 and ma200>ma200[1]IF strategy = 1 THEN // SL: MA20sellprice = min(close*0.97,Average[20])ELSIF strategy = 2 THEN // SL: Boll Infsellprice = min(close*0.97,BollingerDown[20])ELSIF strategy = 3 THEN // SL: MA200sellprice = min(close*0.97,Average[200])ENDIF// Buy orderif not LongOnMarket and c1 thenBUY n shares at market tomorrowopenmyStop = n*(close-sellprice)SET STOP $LOSS myStopSET TARGET $PROFIT RRR*myStopENDIFPS: I don’t think similar subject exist. If yes, the post can be deleted of course
09/10/2021 at 10:05 AM #17719209/10/2021 at 5:27 PM #177220I believe the intent was more to detect a consolidation (though this signal may be too early).
Mean reversion would be to buy out of oversold zone with SMA20 (or any other criteria) as TP, no?
Anyway, I posted here in case someone request the code, so that it can be shared, modified with other entry signals for those who are not confident in programming such simple strategy based on an entry signal (the initial backtest was done manually on graph and in Excel..)
Plus if some members have ideas of improvements to share, this would be a win-win situation.1 user thanked author for this post.
09/14/2021 at 5:18 AM #17747809/14/2021 at 8:10 AM #177490Not yet. I’m developing a file in which I compare several “famous” entry signals returns (MACD+SMA200, Supertrend+SMA200 etc…)
This condition will be added to my file to compare with other strategies
Following the recent excitement around ExtraTrend in the French community, I copied the money management script of the video, with some alternatives.
The next step would be to combine entries and exits to create complex strategy with re-entries, break even levels, and partial profits.
However, I like the simple approach of having a clear signal, SL and TP, backtested as profitable in the long term, and here we go!09/14/2021 at 10:14 AM #17753209/14/2021 at 10:23 AM #17753309/14/2021 at 3:11 PM #177559 -
AuthorPosts
Find exclusive trading pro-tools on