Configuration – Plus Haut & Plus bas précédent

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #92239 quote
    Nicolas
    Keymaster
    Master

    Il faut simplement enregistrer dans une variable la valeur du Volume uniquement lorsque le haut ou le bas mensuel change:

    once currenthighmensuel=high
    once currentlowmensuel=low
    
    once previoushighmensuel=undefined
    once previouslowmensuel=undefined
    
    if openmonth <> openmonth[1] then
     previoushighmensuel=currenthighmensuel
     previouslowmensuel=currentlowmensuel
     currenthighmensuel=high
     currentlowmensuel=low
    else
     currenthighmensuel=max(high,currenthighmensuel)
     currentlowmensuel=min(low,currentlowmensuel)
     if currenthighmensuel<>currenthighmensuel[1] then 
      highvol=volume
     endif
     if currentlowmensuel<>currentlowmensuel[1] then 
      lowvol=volume
     endif
    endif
    
    return highvol as "haut volume",lowvol as "bas volume", previoushighmensuel coloured(139,0,139) as "Précédent haut mensuel", previouslowmensuel coloured(139,0,139) as "Précédent bas mensuel"

    (non testé)

    #92304 quote
    MrCrous
    Participant
    Average

    Bonjour,

     

    Ca ne fonctionne pas car à chaque changement même dans le mois “else” il met à jour le volume.

    J’ai fais avec une boucle “while” le temps de me débloquer. Pour le moment ca rame pas trop 🙂

    #92323 quote
    Nicolas
    Keymaster
    Master

    Oui en effet j’ai oublié de récupérer ces données au changement de mois :

    once currenthighmensuel=high
    once currentlowmensuel=low
    
    once previoushighmensuel=undefined
    once previouslowmensuel=undefined
    
    if openmonth <> openmonth[1] then
     previoushighmensuel=currenthighmensuel
     previouslowmensuel=currentlowmensuel
     currenthighmensuel=high
     currentlowmensuel=low
     currenthighmensuelVol=highvol
     currentlowmensuelVol=lowvol
    else
     currenthighmensuel=max(high,currenthighmensuel)
     currentlowmensuel=min(low,currentlowmensuel)
     if currenthighmensuel<>currenthighmensuel[1] then 
      highvol=volume
     endif
     if currentlowmensuel<>currentlowmensuel[1] then 
      lowvol=volume
     endif
    endif
    
    return currenthighmensuelVol as "haut volume",currentlowmensuelVol as "bas volume", previoushighmensuel coloured(139,0,139) as "Précédent haut mensuel", previouslowmensuel coloured(139,0,139) as "Précédent bas mensuel"

    Non testé.

    #92911 quote
    MrCrous
    Participant
    Average

    Bonjour Nicolas,

    Hum me semble pas fonctionner.

    Par exemple le volume bas reste le même sur plusieurs moi.

    Pour le moment je suis en intraday, j’ai fais ceci :

    if intradaybarindex = 0 then
    maxbars= intradaybarindex[1]
    i = 0
    while i <> maxbars do
    cond1 = (high[i] = previoushighday)
    cond2 = (low[i] = previouslowday)
    if cond1 then
    Volprecplushaut = volume[i]
    endif
    if cond2 then
    Volprecplusbas = volume[i]
    endif
    i = i+1
    wend
    endif

    Ca fonctionne. 7

    Pour les timeframe plus élevés j’affinerai ma partie openmonth afin d’aller comparer sur les X barres du mois précédent.

    Pas encore essayé.

    #93146 quote
    Nicolas
    Keymaster
    Master

    Selon moi ça fonctionne (voir image), pourvu qu’il y ait des informations de Volume pour l’instrument en question et suffisamment d’unités affichées pour constater un changement de mois. As-tu un exemple pour bien comprendre ton problème ?

    Bravo pour ton code.

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

Configuration – Plus Haut & Plus bas précédent


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
jhonhamy @jhonhamy Participant
Summary

This topic contains 19 replies,
has 6 voices, and was last updated by Nicolas
6 years, 11 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 10/30/2017
Status: Active
Attachments: 3 files
Logo Logo
Loading...