limite de validité indicateur

Viewing 15 posts - 46 through 60 (of 67 total)
  • Author
    Posts
  • #169179 quote
    pierre66
    Participant
    Senior

    Désolé pour l’erreur la date est bien  :

    Date>20211231

    mais ça ne marche pas .

    Merci pour le retour Nicolas.

    #169182 quote
    robertogozzi
    Moderator
    Master

    Ça marche:

    Date <= 20211231
    #169183 quote
    pierre66
    Participant
    Senior

    merci, desolé pour le dérangement.

    #169184 quote
    pierre66
    Participant
    Senior

     

    Bonjour Roberto,

    En fait ça marche mais dans le mauvais sens.

    L’indicateur me dit qu’il est fermé jusqu’à la date du 31122021 , donc effectivement j’ai le message , mais je souhaiterais l’inverse soit:

    l’indicateur  accessible jusqu’au 20211231 puis se ferme avec l’affichage du message (et la il ne fonctionne pas si la date>=20211231)

    Merci beaucoup pour retour .

    #169188 quote
    robertogozzi
    Moderator
    Master

    Avec la condition:

    If Date <= 20211231 then

    ajoutez ces lignes à la ligne 21:

    else
    DRAWTEXT("Licence expirée",barindex,high + range*2) coloured(255,0,0,255)
    #169206 quote
    pierre66
    Participant
    Senior

    Bonsoir Roberto,

    Je vous renvoie le code car je n’ai pas de vue sur le code que je vous ai adressé.

    Le code ne fonctionne pas correctement , il m’affiche aujourd’hui que la licence est expirée alors qu’elle doit finir le 31122021

    Merci de jeter un coup d’oeil et  merci encore

    DEFPARAM DrawOnLastBarOnly = True
    IF Date <=20211231 tHEN
    
    wup = low[0] > low[1] and low[1] <low[2]
    wdown= High[0]<high[1] and high[1]>high[2]
    
    atr=Averagetruerange[14]
    IF wup and  close> high[1]THEN
     
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    drawarrowup(barindex[1], low[1] -0.5*atr ) coloured (0,255,0)
    endif
    
    if wdown and  close< LOW[1]  then
    drawarrowdown(barindex[1], high[1]+0.5*atr) coloured (255,0,0)
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    else
    DRAWTEXT("Licence expirée",barindex,high + range*2) coloured(255,0,0,255)
    
    endif
    endif
    return

     

    pour votre patience.

    #169207 quote
    robertogozzi
    Moderator
    Master

    Vous avez les mauvaises lignes.

    #169210 quote
    robertogozzi
    Moderator
    Master

    Voilà:

    DEFPARAM DrawOnLastBarOnly = True
    IF Date <=20211231 tHEN
     
    wup = low[0] > low[1] and low[1] <low[2]
    wdown= High[0]<high[1] and high[1]>high[2]
     
    atr=Averagetruerange[14]
    IF wup and  close> high[1]THEN
     
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    drawarrowup(barindex[1], low[1] -0.5*atr ) coloured (0,255,0)
    endif
     
    if wdown and  close< LOW[1]  then
    drawarrowdown(barindex[1], high[1]+0.5*atr) coloured (255,0,0)
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    Endif
    else
    DRAWTEXT("Licence expirée",barindex,high + range*2) coloured(255,0,0,255)
     
    endif
    return
    #169221 quote
    pierre66
    Participant
    Senior

    ok , merci roberto pour votre aide

    #169226 quote
    pierre66
    Participant
    Senior

    rebonjour,

    Désolé Roberto , mais le code ne fonctionne toujours pas je vous adresse le code que j’ai copier directement de PRT .

    Merci

    DEFPARAM DrawOnLastBarOnly = True
    IF Date <=20211231 tHEN
     
    wup = low[0] > low[1] and low[1] <low[2]
    wdown= High[0]<high[1] and high[1]>high[2]
     
    atr=Averagetruerange[14]
    IF wup and  close> high[1]THEN
     
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    drawarrowup(barindex[1], low[1] -0.5*atr ) coloured (0,255,0)
    endif
     
    if wdown and  close< LOW[1]  then
    drawarrowdown(barindex[1], high[1]+0.5*atr) coloured (255,0,0)
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    Endif
    else
    DRAWTEXT("Licence expirée",barindex,high + range*2) coloured(255,0,0,255)
     
    endif
    return
    #169232 quote
    robertogozzi
    Moderator
    Master

    Je comprends. mais le problème n’a rien à voir avec la validité, n’avez-vous pas reçu le message qu’une variable est manquante?

    Ajoutez, entre la ligne 1 et la ligne 2 extension = 2 (mais vous pouvez également mettre 0 ou 5 ou une valeur négative) et si vous souhaitez supprimer toutes les lignes précédentes, vous devez supprimer les barres de commentaires de la ligne 1:

    //DEFPARAM DrawOnLastBarOnly = True
    extension = 2
    IF Date <=20211231 tHEN
    
    wup = low[0] > low[1] and low[1] <low[2]
    wdown= High[0]<high[1] and high[1]>high[2]
    
    atr=Averagetruerange[14]
    IF wup and close> high[1]THEN
    
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    drawarrowup(barindex[1], low[1] -0.5*atr ) coloured (0,255,0)
    endif
    
    if wdown and close< LOW[1] then
    drawarrowdown(barindex[1], high[1]+0.5*atr) coloured (255,0,0)
    DRAWsegment(barindex[1],low[1],barindex+Extension,low[1])coloured(255,0,0)
    DRAWsegment(barindex[1],HIGH[1],barindex+Extension,HIGH[1])coloured(0,255,0)
    Endif
    else
    DRAWTEXT("Licence expirée",barindex,high + range*2) coloured(255,0,0,255)
    
    endif
    return
    #169338 quote
    pierre66
    Participant
    Senior

    Bonsoir Roberto,

    La variable extension =2 est présente dans le module (variable) pour pouvoir changer la longueur des segment.

    Je vous remercie , car maintenant l’indicateur  fonctionne .

    #169366 quote
    pierre66
    Participant
    Senior

    Bonjour ,

     

    Le code de l’indic ci-dessous fonctionne bien et s’affiche correctement  sur mon graphe . Par contre je voudrais insérer ce code dans un autre code existant et des que j’enléve la 1ére ligne  “defparam..” il ne fonctionne pas correctement .

    Merci pour le retour

    defparam drawonlastbaronly = true
    
    per=10
    bna=4
    
    
    vie= per * bna
    if vie>0 then
    mm=average[1](vie)
    texte=mm
    if vie then
    DRAWTEXT("Valeur Estimée =#texte#",barindex[10],mm+0.2,dialog,bold,18)coloured(255,2240,188)
    ENDIF
    ENDIF
    RETURN mm as "mm"
    #169373 quote
    robertogozzi
    Moderator
    Master

    Voilà:

    defparam drawonlastbaronly = true
     
    per=10
    bna=4
    IF Date <=20211231 tHEN
     
    vie= per * bna
    if vie>0 then
    mm=average[1](vie)
    texte=mm
    if vie then
    DRAWTEXT("Valeur Estimée =#texte#",barindex[10],mm+0.2,dialog,bold,18)coloured(255,2240,188)
    ENDIF
    ENDIF
    ELSE
    mm = 0
    DRAWTEXT("Licence expirée",barindex,mm*2) coloured(255,0,0,255)
    ENDIF
    RETURN mm as "mm"
    #169423 quote
    pierre66
    Participant
    Senior

    Merci pour le retour Roberto

    robertogozzi thanked this post
Viewing 15 posts - 46 through 60 (of 67 total)
  • You must be logged in to reply to this topic.

limite de validité indicateur


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
remy92400 @remy92400 Participant
Summary

This topic contains 66 replies,
has 5 voices, and was last updated by warningff
4 years, 7 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 11/13/2019
Status: Active
Attachments: 5 files
Logo Logo
Loading...