Strategy trend trading when CCI is back from overbought zone

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #177184 quote
    Swingueur
    Participant
    Average

    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: 1000EUR

    DEFPARAM CumulateOrders=False
    
    // Variables to optimize
    CAPITALInit = 1000 // amount to invest
    REINV = 0 // reinvest profits or not
    strategy = 2 // SL BOLLINGERDOWN
    RRR=1 // Risk Reward Ratio
    
    IF REINV = 0 THEN
    n = round((CapitalInit / close))
    ELSIF REINV = 1 THEN
    capital = (CAPITALinit + strategyprofit)
    n = round((capital/close))
    ENDIF
    
    ma200 = Average[200]
    c0 = Close>0.5
    c1 = c0 and CCI[20] crosses under 100 and ma200>ma200[1]
    
    IF strategy = 1 THEN // SL: MA20
    sellprice = min(close*0.97,Average[20])
    ELSIF strategy = 2 THEN // SL: Boll Inf
    sellprice = min(close*0.97,BollingerDown[20])
    ELSIF strategy = 3 THEN // SL: MA200
    sellprice = min(close*0.97,Average[200])
    ENDIF
    
    // Buy order
    if not LongOnMarket and c1 then
    BUY n shares at market tomorrowopen
    myStop = n*(close-sellprice)
    SET STOP $LOSS myStop
    SET TARGET $PROFIT RRR*myStop
    ENDIF

    PS: I don’t think similar subject exist. If yes, the post can be deleted of course

    E-5iCsVUcBA8BJD.jpg E-5iCsVUcBA8BJD.jpg
    #177192 quote
    Nicolas
    Keymaster
    Master

    Mean reversion strategy on up trend. You could use any bounded oscillators: RSI, Stochastic, .. They are used to time the entries.

    #177220 quote
    Swingueur
    Participant
    Average

    I 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.

    GraHal thanked this post
    #177478 quote
    murre87
    Participant
    Senior

    Hi. Thanks for sharing. Did u find any improvements ur self ?

    #177490 quote
    Swingueur
    Participant
    Average

    Not 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!

    #177532 quote
    murre87
    Participant
    Senior

    Okey. Will be intresting to folow ur results.

    Have u checked out this thread?

    #177533 quote
    murre87
    Participant
    Senior
    #177559 quote
    murre87
    Participant
    Senior

    Btw can u share the snippetcode of moneymanagement u refered to?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Strategy trend trading when CCI is back from overbought zone


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Swingueur @swingueur Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by murre87
4 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/10/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...