Plus haut plus bas de la nuit TF ticks

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

    Bonjour,
    J’ai cet indicateur :

    DefParam DrawOnLastBarOnly = true
    debut, fin = CALL "Horaires Ouverture"[DAX,NASDAQ]
    if DAX THEN
    start = 173000
    end = 090000
    start2 = 085500
    start3 = 090000
    end2 = 173000
    ENDIF
    
    if NASDAQ THEN
    start = 220000
    end = 153000
    start2 = 152500
    start3 = 153000
    end2 = 220000
    ENDIF
    
    
    
    
    tc = time>=start or time<end
    if tc then
    if not tc[1] then
    i=i+1
    $y1[i]=high
    $z1[i]=low
    hh = High
    endif
    if time = start THEN
    $x1[i]=barindex
    ENDIF
    if time = end2 THEN
    $x3[i]=barindex
    ENDIF
    hh = max(high,hh)
    $y1[i]=max(high,$y1[i])
    $z1[i]=min(low,$z1[i])
    endif
    
    tc2 = time>=start2 or time<end2
    
    
    if tc2 and not tc2[1] then
    i=i+1
    $x1[i]=barindex
    endif
    
    if tc2 then
    $x3[i]=barindex
    endif
    if islastbarupdate  then
    for y = 1 to i do
    DRAWSEGMENT($x1[y],$y1[y],$x3[y],$y1[y]) STYLE(LINE ,2)coloured(200,100,100)
    DRAWTEXT("Plus Haut (HM)",$x3[y],$y1[y]+1,SansSerif,Bold,11) coloured(200,100,100)
    DRAWSEGMENT($x1[y],$z1[y],$x3[y],$z1[y]) STYLE(LINE ,2)coloured(200,100,100)
    DRAWTEXT("Plus Bas (HM)",$x3[y],$z1[y]-1,SansSerif,Bold,11) coloured(200,100,100)
    NEXT
    
    ENDIF
    return
    

    Cela fonctionne très bien pour un TF en min, mais pas en ticks en fait aucun segment n’est tracé.

    Pourriez-vous m’aider ?

    Très bonne journée

    #223818 quote
    Alain
    Participant
    Senior

    Bonjour,

    En ticks, la condition  “if time = start THEN” est fausse quasi tout le temps. Vous n’aurez pas une bougie qui clôture à 22:00:00, mais plutôt à 21:59:56 et la suivante à 22:00:04 (tout dépendant du nombre de ticks choisis).

    Pour pallier ce problème, vous devez adapter la condition comme suit :

    “if time >= start and time[1] < start  THEN”  (clôture de la bougie courante >= start et clôture de la bougie précédente < start)

    Vous aurez le même problème avec la condition “if time = end2 THEN”.

    netskiss thanked this post
    #223857 quote
    netskiss
    Participant
    Average

    Bonjour,

    Merci beaucoup pour votre réponse.
    Cela fonctionne parfaitement maintenant

    Bonne journée

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

Plus haut plus bas de la nuit TF ticks


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
netskiss @netskiss Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 11/15/2023
Status: Active
Attachments: No files
Logo Logo
Loading...