Anomalies Indicateur Kagi et ProBacktests

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #182819 quote
    Bernard13
    Participant
    Average

    Bonjour Nicolas et la Communauté

    En voulant tester en Backtest le programme “PRC Kagi on price chart” de Nicolas, je m’aperçois d’anomalies en UT inférieures à Daily et Weekly.

    Les comparaisons élémentaires   kagi[1] < kagi   et   kagi[1] > kagi   ne suffisent-elles plus ?

    Merci d’avance de vos réponses.

    ONCE Capital= 10000
    Nbre= ROUND(Capital/Close)
    
    //PRC_Kagi on price chart | indicator
    //05.09.2019
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- settings
    // select one of the two possible setting (0=don't use)
    ReversalAmountPercent = 1.5 //amount of price percent to inverse Kagi trend
    //ReversalAmountPoints = 0 //amount of points to inverse Kagi trend
    // --- end of settings
    
    once kagi=close
    
    //if ReversalAmountPercent>0 then
    //percent retracement
    pup = (close-kagi)/kagi
    pdn = (kagi-close)/kagi
    InvDec = 1/0.1
    //bullish reversal
    if pup>=ReversalAmountPercent/100 then
    coeff = abs(pup/ReversalAmountPercent)*100
    coeff = round(InvDec*coeff-0.5)/InvDec
    kagi=kagi+(kagi*(ReversalAmountPercent/100)*coeff)
    //r=0
    //g=255
    endif
    //bearish reversal
    if pdn>=ReversalAmountPercent/100 then
    coeff = abs(pdn/ReversalAmountPercent)*100
    coeff = round(InvDec*coeff-0.5)/InvDec
    kagi=kagi-(kagi*(ReversalAmountPercent/100)*coeff)
    //r=255
    //g=0
    endif
    //endif
    
    //RETURN Kagi coloured(r,g,0) style(line,3)
    
    //----------Process
    
    // Conditions pour ouvrir une position acheteuse
    IF NOT LongOnMarket AND kagi[1] < kagi THEN
    BUY Nbre SHARES AT MARKET
    ENDIF
    
    // Conditions pour fermer une position acheteuse
    IF LongOnMarket AND kagi[1] > kagi THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions pour ouvrir une position en vente à découvert
    //IF NOT ShortOnMarket AND VosConditions THEN
    //SELLSHORT 1 CONTRACTS AT MARKET
    //ENDIF
    
    // Conditions pour fermer une position en vente à découvert
    //IF ShortOnMarket AND VosConditions THEN
    //EXITSHORT AT MARKET
    //ENDIF
    
    // Stops et objectifs : entrez vos stops et vos objectifs ici
    
    Danone-en-Kagi.png Danone-en-Kagi.png
    #182866 quote
    Nicolas
    Keymaster
    Master

    Le Kagi doit être calculé différemment, voir sa valeur avec un

    GRAPH kagi

    Ensuite, puisque sa variation dépend d’un pourcentage, la valeur affichée peut différer de celle calculé par la stratégie (différence d’historique). En effet, si on démarre plus tôt, le prix a varier plus.

    Si tu supprimes le pré chargement d’historique avec:

    defparam preloadbars=0

    cela pourrait sans doute aider.

    #182875 quote
    Bernard13
    Participant
    Average

    Merci Nicolas pour ces deux précieuses informations.

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

Anomalies Indicateur Kagi et ProBacktests


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Bernard13 @bernard13 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Bernard13
4 years, 2 months ago.

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