How can you improve this EA with CCI?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #170112 quote
    macdopamacdopa
    Participant
    Average

    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.

    PRT_code_CCI_1.jpg PRT_code_CCI_1.jpg PRT_code_CCI_2.jpg PRT_code_CCI_2.jpg
    #170724 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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.

    x200.jpg x200.jpg x200K.jpg x200K.jpg
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

How can you improve this EA with CCI?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
macdopa @macdopa Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/21/2021
Status: Active
Attachments: 4 files
ProRealCode ProRealCode
Loading...