Affichage prix ouverture et clôture horaire spécifique

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #99233 quote
    Phil4910
    Participant
    Average

    Bonjour Nicolas,

    Ci-joint, un code qui indique les prix à l’ouverture à 08h00 et à 09h00 et la clôture à 17h30 du jour précédent et les prix à l’ouverture à 08h00 et à 09h00 du jour en cours.

    J’ai 2 problèmes:

    1.   les prix à l’ouverture à 08h00 et à 09h00 du jour en cours ne s’affichent pas;
    2.   si je mets l’écran en affichage 1000 unités, les prix à l’ouverture à 08h00 et à 09h00 et la clôture à 17h30 du jour précédent s’affichent mais si je passe en 200 unités, ils disparaissent -> ?

    De plus, je pense que le code dont la base est reprise d’un autre topic pourrait être simplifié.

    idate=date
    //plot Open/close
    if today-idate<=1 then
    if time=173000 then
    fermcash=close
    
    endif
    if time=080100 then
    OuvFut=Open
    
    endif
    if time=090100 then
    Ouvcash=Open
    
    endif
    endif
    if today-idate>1 then
    if time=080100 then
    OuvFutJ=Open
    
    endif
    if time=090100 then
    OuvcashJ=Open
    
    endif
    endif
    Voffset = 1*pipsize
    If time=currenttime-10000 Then
    count=count+1
    drawtext("Ferm Cash (J. Pre)",barindex+100,fermcash+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Fut (J. Pre)",barindex+100,OuvFut+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Cash (J. Pre)",barindex+100,Ouvcash+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Fut",barindex+100,OuvFutJ+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Cash",barindex+100,OuvcashJ+Voffset,SansSerif,standard,12)coloured(91,173,207)
    DRAWLINE(barindex-count,fermcash,barindex,fermcash)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvfut,barindex,ouvfut)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvcash,barindex,ouvcash)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvfutJ,barindex,ouvfutJ)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvcashJ,barindex,ouvcashJ)coloured(91,173,207)
    else
    count=0
    endif
    
    return
    

     

    Merci de ton aide.

    Phil4910

    #103851 quote
    Phil4910
    Participant
    Average

    Nicolas,

    Je me permet de déterrer le topic ci-dessus car je n’a pas eu de réponse.

    Merci d’avance,

    Phil4910.

    #103901 quote
    Nicolas
    Keymaster
    Master

    Désolé pas vu à l’époque.

    En effet si 200 unités n’est pas suffisant à l’historique pour connaître les prix de la veille, alors tu n’obtiendras rien sur ton graphique, logique ! 😉

    Les prix sont testés à 08h01, il faut que le graphique voit cette heure fixe passé au moment de la fermeture d’une bougie. Si tu utilises un autre graphique que le 1 minute, alors ça ne fonctionnera pas.

    #103944 quote
    Phil4910
    Participant
    Average

    Sorry Nicolas, mais cela ne fonctionne toujours pas même si je modifie l’unité d’affichage.

    Je suis en 5′ et affichage 1000 unités.

    Je souhaiterais l’affichage de 5 lignes:

    1) les prix à l’ouverture à 08h00 du jour précédent

    2) les prix à l’ouverture à 09h00 du jour précédent

    3) les prix à la clôture à 17h30 du jour précédent

    4) les prix à l’ouverture à 08h00 du jour en cours

    5) les prix à l’ouverture à 09h00 du jour en cours

    Merci de ton aide.

    Defparam Drawonlastbaronly = false
    idate=date
    //plot Open/close
    if today-idate<=1 then
    if time=173000 then
    fermcash=close
    
    endif
    if time=080000 then
    OuvFut=Open
    
    endif
    if time=090000 then
    Ouvcash=Open
    
    endif
    endif
    if today-idate>1 then
    if time=080000 then
    OuvFutJ=Open
    
    endif
    if time=090000 then
    OuvcashJ=Open
    
    endif
    endif
    Voffset = 1*pipsize
    If time=currenttime-1000 Then
    count=count+1
    drawtext("Ferm Cash (J. Pre)",barindex+100,fermcash+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Fut (J. Pre)",barindex+100,OuvFut+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Cash (J. Pre)",barindex+100,Ouvcash+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Fut",barindex+100,OuvFutJ+Voffset,SansSerif,standard,12)coloured(91,173,207)
    drawtext("Ouv Cash",barindex+100,OuvcashJ+Voffset,SansSerif,standard,12)coloured(91,173,207)
    DRAWLINE(barindex-count,fermcash,barindex,fermcash)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvfut,barindex,ouvfut)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvcash,barindex,ouvcash)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvfutJ,barindex,ouvfutJ)coloured(91,173,207)
    DRAWLINE(barindex-count,ouvcashJ,barindex,ouvcashJ)coloured(91,173,207)
    else
    count=0
    endif
    
    return
    #103982 quote
    Nicolas
    Keymaster
    Master

    Je suis certain d’avoir codé cela au moins 10 fois, faudrait chercher 🙂

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

Affichage prix ouverture et clôture horaire spécifique


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Phil4910 @phil4910 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Nicolas
6 years, 7 months ago.

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