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

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

    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
    MrCrousMrCrous
    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
    NicolasNicolas
    Keymaster
    Legend

    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
    MrCrousMrCrous
    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
    NicolasNicolas
    Keymaster
    Legend

    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.

    high-and-low-volumes-each-month.png high-and-low-volumes-each-month.png
Viewing 5 posts - 16 through 20 (of 20 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 NicolasNicolas
7 years, 7 months ago.

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