Bug Affichage Pivot 1heure

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #160939 quote
    Nicolas
    Keymaster
    Master

    Comme tu n’utilises pas “updateonclose” pour le timeframe 1 hour, les infos sont updatés à chaque fermeture de bougie du timeframe courant (default). Fait un

     

    RETURN LL,HH,CC

     

    pour voir les valeurs qui sont récupérés lors d’un trou de cotation, ça pourrait nous donner une piste.

    #161009 quote
    Ichimoku Reading
    Participant
    Master

    Les valeurs sont retourné sans erreur donc c’est ok, sauf pour le lundi 8 janvier x)

    En revanche, pour la projection en avant des DrawSegment, j’utilise ce code :

    //
    //=/===============/=//=/===============/=//=/ Paramettre de Base
    //
    
    defparam drawonlastbaronly = true
    
    Middle     = 0
    Text       = 1
    TextMiddle = 0
    
    //
    //=/===============/=//=/===============/=//=/ Pivot
    //
    
    timeframe(1hour)
    
    //=/ H & L & C
    LL  = low[1]
    HH  = high[1]
    CC  = close[1]
    
    //=/ S & R & P
    PP  = (LL+HH+CC)/3
    //=//
    Rx1 =  2   * PP-LL
    Hx1 = (Rx1 + PP) /2
    Rx2 =  PP  + (HH-LL)
    Hx2 = (Rx2 + Rx1) /2
    Rx3 =  Rx2 + (Rx1-PP)
    Hx3 = (Rx3 + Rx2) /2
    Rx4 =  Rx3 + (Rx2-PP)
    Hx4 = (Rx4 + Rx3) /2
    //=//
    Sx1 = 2   * PP-HH
    Lx1 = (Sx1 + PP) /2
    Sx2 = PP  - (HH-LL)
    Lx2 = (Sx2 + Sx1) /2
    Sx3 = Sx2 - (PP-Sx1)
    Lx3 = (Sx3 + Sx2) /2
    Sx4 = Sx3 - (PP-Sx2)
    Lx4 = (Sx4 + Sx3) /2
    
    //=/ Signal
    if barindex > barindex[1] then
    SL = 1
    endif
    //=//
    if SL[1] = 1 then
    SL    = 0
    endif
    
    timeframe(default)
    
    //=/ Lecture du signal
    if (SL = 1 and SL[1] = 0) or (SL = 0 and SL[1] = 1) then
    TH = 1
    else
    TH = 0
    endif
    
    //=/ Décompte des barindex
    DC = 1
    if TH = 0 then
    DC = DC[1]+1
    endif
    
    //
    //=/===============/=//=/===============/=//=/ Couleur Pivot
    //
    
    //=/ choix des couleur : https://htmlcolorcodes.com/fr/
    
    //=/ Couleur Résistance
    RxR = 255 // Ref 1
    GxR = 0   // Ref 2
    BxR = 0   // Ref 3
    TxR = 255 // opacité de 0 a 255
    
    //=/ Couleur Support
    RxS = 0   //.....
    GxS = 128
    BxS = 0
    TxS = 255
    
    //=/ Couleur Pivot
    RxP = 0
    GxP = 0
    BxP = 0
    TxP = 255
    
    //
    //=/===============/=//=/===============/=//=/ Visuel Pivot
    //
    
    ZZ = (Hx1-PP)/8
    
    if DC => 1 then
    
    //=/ Point Pivot
    drawsegment(barindex[DC-1],PP,barindex+((DC[DC])-DC+1),PP) coloured(RxP,GxP,BxP,TxP) style(line,2)//choix style : Line_DottedLine_Point (2 = taille)
    
    //=/ Résistance
    drawsegment(barindex[DC-1],Rx1,barindex+((DC[DC])-DC+1),Rx1) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)//.....
    drawsegment(barindex[DC-1],Rx2,barindex+((DC[DC])-DC+1),Rx2) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)
    drawsegment(barindex[DC-1],Rx3,barindex+((DC[DC])-DC+1),Rx3) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)
    drawsegment(barindex[DC-1],Rx4,barindex+((DC[DC])-DC+1),Rx4) coloured(RxR,GxR,BxR,TxR) style(dottedline,2)
    
    //=/ Support
    drawsegment(barindex[DC-1],Sx1,barindex+((DC[DC])-DC+1),Sx1) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
    drawsegment(barindex[DC-1],Sx2,barindex+((DC[DC])-DC+1),Sx2) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
    drawsegment(barindex[DC-1],Sx3,barindex+((DC[DC])-DC+1),Sx3) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
    drawsegment(barindex[DC-1],Sx4,barindex+((DC[DC])-DC+1),Sx4) coloured(RxS,GxS,BxS,TxS) style(dottedline,2)
    
    if Middle then
    
    //=/ Résistance Middle
    drawsegment(barindex[DC-1],Hx1,barindex+((DC[DC])-DC+1),Hx1) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)//.....
    drawsegment(barindex[DC-1],Hx2,barindex+((DC[DC])-DC+1),Hx2) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)
    drawsegment(barindex[DC-1],Hx3,barindex+((DC[DC])-DC+1),Hx3) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)
    drawsegment(barindex[DC-1],Hx4,barindex+((DC[DC])-DC+1),Hx4) coloured(RxR,GxR,BxR,TxR) style(dottedline,1)
    
    //=/ Support Middle
    drawsegment(barindex[DC-1],Lx1,barindex+((DC[DC])-DC+1),Lx1) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
    drawsegment(barindex[DC-1],Lx2,barindex+((DC[DC])-DC+1),Lx2) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
    drawsegment(barindex[DC-1],Lx3,barindex+((DC[DC])-DC+1),Lx3) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
    drawsegment(barindex[DC-1],Lx4,barindex+((DC[DC])-DC+1),Lx4) coloured(RxS,GxS,BxS,TxS) style(dottedline,1)
    
    endif
    
    if Text then
    
    //=/ Point Pivot
    drawtext("Piv 1h",barindex+((DC[DC])-DC+1),PP+ZZ,Dialog,Bold,11) coloured(RxP,GxP,BxP,TxP)
    
    //=/ Résistance
    drawtext("R1 1h",barindex+((DC[DC])-DC+1),Rx1+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    drawtext("R2 1h",barindex+((DC[DC])-DC+1),Rx2+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    drawtext("R3 1h",barindex+((DC[DC])-DC+1),Rx3+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    drawtext("R4 1h",barindex+((DC[DC])-DC+1),Rx4+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    
    //=/ Support
    drawtext("S1 1h",barindex+((DC[DC])-DC+1),Sx1+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    drawtext("S2 1h",barindex+((DC[DC])-DC+1),Sx2+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    drawtext("S3 1h",barindex+((DC[DC])-DC+1),Sx3+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    drawtext("S4 1h",barindex+((DC[DC])-DC+1),Sx4+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    
    endif
    
    if TextMiddle then
    
    //=/ Résistance Middle
    drawtext("mR1 1h",barindex+((DC[DC])-DC+1),Hx1+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    drawtext("mR2 1h",barindex+((DC[DC])-DC+1),Hx2+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    drawtext("mR3 1h",barindex+((DC[DC])-DC+1),Hx3+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    drawtext("mR4 1h",barindex+((DC[DC])-DC+1),Hx4+ZZ,Dialog,Bold,11) coloured(RxR,GxR,BxR,TxR)
    
    //=/ Support Middle
    drawtext("mS1 1h",barindex+((DC[DC])-DC+1),Lx1+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    drawtext("mS2 1h",barindex+((DC[DC])-DC+1),Lx2+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    drawtext("mS3 1h",barindex+((DC[DC])-DC+1),Lx3+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    drawtext("mS4 1h",barindex+((DC[DC])-DC+1),Lx4+ZZ,Dialog,Bold,11) coloured(RxS,GxS,BxS,TxS)
    
    endif
    
    endif
    
    //
    //=/===============/=//=/===============/=//=/ Fin
    //
    
    return
    
    Capture-decran-2021-02-11-043640.png Capture-decran-2021-02-11-043640.png
    #161011 quote
    Ichimoku Reading
    Participant
    Master

    Donc en gros, le signal donne 60 si il reste 60 bougie avant la prochaine heure, quand il y a un trou de cotation, le code de donne pas +1 mais +0

    timeframe(1hour)
    
    //=/ Signal
    if barindex > barindex[1] then
    SL = 1
    endif
    //=//
    if SL[1] = 1 then
    SL    = 0
    endif
    
    timeframe(default)
    
    //=/ Lecture du signal
    if (SL = 1 and SL[1] = 0) or (SL = 0 and SL[1] = 1) then
    TH = 1
    else
    TH = 0
    endif
    
    //=/ Décompte des barindex
    DC = 1
    if TH = 0 then
    DC = DC[1]+1
    endif
    
    
    return DC
    #161012 quote
    Ichimoku Reading
    Participant
    Master

    En fait, il ne donne pas +0, mais +rien.

    Le code et comme simplement déporter a la barre suivante comme si le trou de cotation n’existe pas

    L’utilisation de barindex > 1 ou barindex > barindex[1] ne change pas le problème

    Je pourrais utiliser le temps, mais le code serrait utilisable sur une seul unité de temps si je vais ça.

    Il doit bien exister une solution vu que PRT le fait…

    Capture-decran-2021-02-11-043640-1.png Capture-decran-2021-02-11-043640-1.png Capture-decran-2021-02-11-044718.png Capture-decran-2021-02-11-044718.png
Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.

Bug Affichage Pivot 1heure


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 18 replies,
has 2 voices, and was last updated by Ichimoku Reading
5 years, 1 month ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 02/08/2021
Status: Active
Attachments: 11 files
Logo Logo
Loading...