Affichage zone sur graphique 2min

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #235214 quote
    christophe11560
    Participant
    Senior

    Bonjour à tous,
    J’ai un soucis avec mon code.
    Au début de la session il fonctionne mais ensuite il donne un résultat incohérent à priori sur la valeur définie comme “bas” ou “mymin” dans mon code.

    Je souhaite afficher une zone qui commence 15 barres avant l’ouverture du jour et termine 180 barres après l’ouverture du jour.

    caractéristique de la zone:
    Limite haute:
    – Le plus hauts des 30 dernières bougies de la veille
    – Valeur de la sma 200 de la veille en fin de session

    Limite basse:
    -Le plus bas des 30 dernières bougies de la veille
    – Valeur de la sma200 de la veille en fin de journée

    Si possible, fonctionne quelques soit l’unité de temps sinon pour ut 2 min.

    merci par avance 😉

    #235216 quote
    christophe11560
    Participant
    Senior
    defparam calculateonlastbars = 300
    defparam drawonlastbaronly = true
    
    timeframe(2 Minutes,updateonclose )
    haut=highest[30](high[1])
    Bas=lowest[30](low[1])
    sma200=average[200](close[1])
    
    if intradaybarindex=0 then
    Mymax=max(sma200, haut)
    Mymin=min(sma200, Bas)
    endif
    
    timeframe(default)
    
    if intradaybarindex=0 or day<>day[1] then
    startbar=barindex-15
    startprice=barindex+ LongueurTrait
    endif
    
    if islastbarupdate then
    AlphaFond=max(1,AlphaFond)
    drawrectangle(startbar,mymax,startprice,mymin) coloured(0,0,0,AlphaFond) bordercolor(0,0,0,AlphaFond)
    endif
    return
    #235248 quote
    christophe11560
    Participant
    Senior

    Une précision :

    Limite haute:
    Max ( Le plus hauts des 30 dernières bougies de la veille ut 2min, Valeur de la sma 200 de la veille en fin de session ut 2min)

    Limite basse:
    Min (Le plus bas des 30 dernières bougies de la veille ut 2min,  Valeur de la sma200 de la veille en fin de journée ut 2min)

    #235281 quote
    Iván González
    Moderator
    Master

    Hola Ahora devrait fonctionner :

    defparam drawonlastbaronly = true
    
    LongueurTrait=180
    AlphaFond=200
    
    timeframe(2 Minutes,updateonclose )
    
    haut=highest[30](high)
    Bas=lowest[30](low)
    sma200=average[200](close)
    
    if intradaybarindex=0 or openday<>openday[1] then
    Mymax=max(sma200[1], haut[1])
    Mymin=min(sma200[1], Bas[1])
    
    endif
    
    timeframe(default)
    if intradaybarindex=0 or openday<>openday[1] then
    startbar=barindex-15
    startprice=barindex+ LongueurTrait
    endif
    
    if islastbarupdate then
    AlphaFond=max(1,AlphaFond)
    drawrectangle(startbar,mymax,startprice,mymin) bordercolor(0,0,0,AlphaFond)coloured(0,0,0,AlphaFond)
    endif
    
    return sma200 coloured("purple"), Mymax coloured("red"), Mymin coloured("blue")
    
    christophe11560 thanked this post
    #235312 quote
    christophe11560
    Participant
    Senior

    merci Ivan,
    Le code semble fonctionner correctement ! A suivre

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

Affichage zone sur graphique 2min


Support ProBuilder

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by christophe11560
1 year, 6 months ago.

Topic Details
Forum: Support ProBuilder
Language: French
Started: 07/12/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...