encadrement jour de la semaine

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #212034 quote
    denis aig
    Participant
    Average

    Bonjour, je souhaite avoir un encadrement des jour de la semaine mais avec mon code il affiche chaque bar.

    comment faire pour qu’il encadre seulement le début et la fin avec plus haut plus bas.
    Ou encore mieux l’encadrement de tous les jour de la semaine 🙂

    Merci d’avance.

    debut1 = 0
    fin1 = 1
     
    If dayofweek = debut1 then
    haut1 = 0
    bas1 = 0
    barredebut1 = barindex
    endif
     
    if dayofweek = fin1 then
    barrefin1 = barindex
    endif
     
    IF dayofweek >= debut1 AND dayofweek <= fin1 THEN
    IF high > haut1 THEN
    haut1 = high
    ENDIF
    IF low < bas1 OR dayofweek = debut1 THEN
    bas1 = low
    ENDIF
    ENDIF
     
    IF dayofweek >= fin1 THEN
    DRAWRECTANGLE(barredebut1,haut1,barrefin1,bas1) coloured(30,30,255)
    drawtext("lundi",barredebut1,haut1+2*pipsize)coloured(0,0,0)
    ENDIF
    return
    
    EURUSD-1-heure.png EURUSD-1-heure.png
    #212042 quote
    Nicolas
    Keymaster
    Master

    Puisqu’on ne peut pas effacer un objet graphique déjà tracé, on préfère le tracer qu’une seule fois, sur le dernier chandelier mais avec ses coordonnées déjà enregistrés (on utilise DRAWONLASTBARONLY et ISLASTBARUPDATE pour bien attendre d’être en temps réel pour commencer à tracer)

    DEFPARAM DRAWONLASTBARONLY=TRUE
    
    debut1 = 0
    fin1 = 1
     
    If dayofweek = debut1 and intradaybarindex=0 then
    haut1 = high
    bas1 = low
    barredebut1 = barindex
    endif
     
    if dayofweek = fin1 then
    barrefin1 = barindex
    endif
     
    IF dayofweek >= debut1 AND dayofweek <= fin1 THEN
    IF high > haut1 THEN
    haut1 = high
    ENDIF
    IF low < bas1 OR dayofweek = debut1 THEN
    bas1 = low
    ENDIF
    ENDIF
     
    if islastbarupdate then 
    DRAWRECTANGLE(barredebut1,haut1,barrefin1,bas1) coloured(30,30,255)
    drawtext("lundi",barredebut1,haut1+2*pipsize)coloured(0,0,0)
    endif 
    
    return
    monday-box-dayofweek.png monday-box-dayofweek.png
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

encadrement jour de la semaine


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
denis aig @denis-aig Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 03/24/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...