Boucle, besoin d’aide

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #145876 quote
    toshtosh
    Participant
    Junior

    Bonjour, sur diverses conditions j’ai un code qui me renvoie la variable : ecartSup = 1
    Et colore le background en Bleu ( voir image ci-joint)

    Je voudrais après avoir reçu le signal “ecarSup =1” ( donc dès que le background est bleu) créer un nouveau signal  “ecartSupOK = 1“ sur le prochain chandelier baissier.
    Ce signal colorerait le background en violet au niveau du chandelier baisser ( voir image )

    J’ai essayé ce code, mais il ne fonctionne pas

    if ecartSup = 1 then
    while close[1] < close do
    r1 = 0
    v1 = 100
    b1 = 0
    if close[1] > close then
    r1 = 250
    v1 = 100
    b1 = 0
    ecartSupOK = 1
    break
    endif
    wend
    endif

    Merci d’avance

    img_01.jpg img_01.jpg
    #145879 quote
    toshtosh
    Participant
    Junior
    if ecartSup = 1 then
        while close[1] < close do
        r1 = 0
        v1 = 100
        b1 = 0
           if close[1] > close then
              r1 = 250
              v1 = 100
              b1 = 0
              ecartSupOK = 1
              break
           endif
        wend
    endif

    C’est le même code ( j’ai juste refait l’indentation à la main. car l’indentation ne fonctionne pas, je ne sais pas pourquoi)

    r1,v1,b1 sont les variable pour backgroundcolor()

    #145928 quote
    NicolasNicolas
    Keymaster
    Legend

    Inutile de faire une boucle. Essayons de faire plus simple, pour voir si j’ai bien compris 🙂

    condition = rsi[14] crosses over 70 
    
    if close[1]<close then
     r=0
     g=100
     b=0
    else
     r=100
     g=0
     b=0
    endif 
    
    if condition then 
     r=0
     g=0
     b=255
     ecartSup=1
    endif 
    if close[1]<open[1] and ecartSup then 
     r=250
     g=100
     b=0
     ecartSup=0
    endif
    
    backgroundcolor(r,g,b,50)
    
    return

    (l’indentation du code n’est pas automatique)

    #145981 quote
    toshtosh
    Participant
    Junior

    Ce code n’est pas vraiment ce que je cherché a faire. Je me suis certainement mal exprimé. Mais un de vos messages sur un post recent ma permis de résoudre mon problème avec barindex.
    Merci pour votre aide

Viewing 4 posts - 1 through 4 (of 4 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

Boucle, besoin d’aide


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
tosh @tosh Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by toshtosh
5 years, 11 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 09/29/2020
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...