+haut +bas en ut 1min sur clôture bougie ut supérieur

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #232975 quote
    olivier
    Participant
    Junior

    Bonjour,

    j’ai récupéré ce code de JC Bywan (merci à lui). En ut 1min, le rectangle respecte la période de 30 min, mais il ne démarre pas à l’ouverture de la bougie 30 min. comment peut-on obliger le calcul à chaque ouverture de bougie 30 ?

    merci d’avance de vos retour

    Period = 30
    if barindex mod period= 0 then
    DRAWTEXT(HighestV, HighestI, HighestV+2, Dialog, Standard, 12)COLOURED(0,255,0)
    DRAWARROWDOWN(HighestI,HighestV+1) COLOURED(0,255,00)
    //DRAWTEXT(LowestV, LowestI, LowestV-2, Dialog, Standard, 12)COLOURED(200,0,0)
    //DRAWARROWUP(LowestI,LowestV-1) COLOURED(255,0,00)
    DRAWRECTANGLE(barindex[period], LowestV, barindex, HighestV)
    HighestV=low
    LowestV=high
    endif
    if high>HighestV then
    HighestV=high
    HighestI=barindex
    endif
    #233002 quote
    Iván González
    Moderator
    Master

    Salut. Vous pouvez saisir une ligne de code pour contrôler le début du dessin du rectangle.

    Period = 30
    
    n=n+1
    if n mod period = 0 then
    DRAWARROWDOWN(HighestI,HighestV+1) COLOURED(255,0,00)
    DRAWRECTANGLE(barindex[period], LowestV, barindex, HighestV)coloured("red")
    HighestV=low
    LowestV=high
    endif
    
    if high>HighestV then
    HighestV=high
    HighestI=barindex
    endif
    
    return
    #233004 quote
    olivier
    Participant
    Junior

    Nickel

    ça marche parfaitement.

    A quoi correspond le n=n+1

    #233023 quote
    Iván González
    Moderator
    Master

    Brillant! Dans ce cas, n est simplement un compteur de bougies (comme un barindex)

    #233028 quote
    olivier
    Participant
    Junior

    encore merci

    #233029 quote
    olivier
    Participant
    Junior

    mauvaise nouvelle.

    ça ne fonctionne pas bien. En utilisant 1k unités d’historique parfait, avec 2k et + unités, il y a à nouveau le décalage qui n’est pas le même suivant la quantité d’historique.

    Donc le compteur à l’ouverture de la bougie 30min n’est pas respecté.

    #233032 quote
    fifi743
    Participant
    Master

    et avec les minutes

     

    if openminute=0 or openminute=30 then
    
    ton code
    
    endif
    #233071 quote
    olivier
    Participant
    Junior

    Bonjour,

    merci pour les retours

    voici le code final pour corriger les erreurs, enfin je l’espère

    if time>080000 and time<180000 then // selection de la plage horaire
    if openminute=0 or openminute=30 then// selection de la zone de calcul + haut  +bas(bougie 30 min)
    Period = 30
    DRAWTEXT(highestv, HighestI, HighestV+5, Dialog, bold, 16)COLOURED(0,255,0)
    DRAWARROWDOWN(HighestI,HighestV+2) COLOURED(0,255,00)
    DRAWTEXT(lowestv, LowestI, LowestV-5, Dialog, bold, 16)COLOURED(255,0,0)
    DRAWARROWUP(LowestI,LowestV-2) COLOURED(255,0,00)
    DRAWRECTANGLE(barindex[period], LowestV, barindex, HighestV)
    HighestV=low
    LowestV=high
    endif
    if high>HighestV then
    HighestV=high
    HighestI=barindex
    endif
    endif
    if low<LowestV then
    LowestV=low
    LowestI=barindex
    endif
    return
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

+haut +bas en ut 1min sur clôture bougie ut supérieur


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
olivier @olivier Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by olivier
1 year, 8 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 05/24/2024
Status: Active
Attachments: No files
Logo Logo
Loading...