Décalage Kijun H1 codée versus Indicateur Ichimoku en M5

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

    Bonsoir à tous,

    Dans l’objectif de coder un indicateur MTF, j’ai inséré dans le code ci-joint le calcul d’une KijunSen H1 dont la valeur serait exploitée en M5.

    J’ai codé KijunSen en utilisant la formule PRT intégrée, et en codant directement la formule.

    Je constate un décalage d’1 h entre le résultat (identiques) de ces deux calculs et la KijunSen de l’indicateur Ichimoku H1 appliqué sur le graphique M5.

    Je n’arrive pas à identifier mon erreur. Quelqu’un sait il m’aiguiller?

    Merci pour votre aide!

    Cordialement.

     

    //=================================================================
    // Indicator
    // Test MTF Kijun-Sen H1 + M5
    //=================================================================
    
    DEFPARAM CALCULATEONLASTBARS = 1000
    
    
    //=================================================================
    // Timeframe H1
    //=================================================================
    
    TIMEFRAME(1H,UPDATEONCLOSE)
    
    KSh1 = KijunSen[9,26,52]
    KSh2 = (highest[26](high) + lowest[26](low)) / 2
    
    
    //=================================================================
    // Timeframe Default
    //=================================================================
    
    TIMEFRAME(DEFAULT,DEFAULT)
    
    KS1 = KijunSen[9,26,52]
    KS2 = (highest[26](high) + lowest[26](low)) / 2
    
    //// DISPLAY
    
    IF DisplayKS THEN
    DRAWPOINT(barindex,KS2) COLOURED(0,0,0,0) BORDERCOLOR(0,0,255,255)
    ENDIF
    
    IF DisplayKSH1 THEN
    DRAWPOINT(barindex,KSh2) COLOURED(0,0,0,0) BORDERCOLOR(0,0,255,255)
    ENDIF
    
    
    RETURN KS1 COLOURED(0,0,255,100) STYLE(LINE,1) as "KS1", KSh1 COLOURED(0,0,255,100) STYLE(LINE,1) as "KSh1"
    Capture-decran-2021-10-12-a-21.58.26.png Capture-decran-2021-10-12-a-21.58.26.png
    #179537 quote
    NicolasNicolas
    Keymaster
    Legend

    Tu utilises UPDATEONCLOSE, donc la valeur utilisée est celle de la dernière bougie clôturée, donc il y a 1 heure en UT H1. Si tu veux avoir la valeur fluctuante durant la bougie H1 non clôturée, tu supprimes UPDATEONCLOSE de ton code et voilà 🙂

    Stephane thanked this post
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

Décalage Kijun H1 codée versus Indicateur Ichimoku en M5


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Stephane @sco472 Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 10/12/2021
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...