Comment réinitialiser une variab

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #187822 quote
    imencityimencity
    Participant
    Senior

    Bonsoir,

    J’ai un code qui fonctionne bizarrement et je viens d’identifier le problème.

    Pour faire simple il utilise:

    openEU   = 080000
    closeEU  = 173000
    if OpenDayOfWeek = 1 then
    if opentime>=openEU and opentime[1]<openEU then
    lundiopen = barindex
    lundipriceopen = close
    endif
    if opentime>=closeEU and opentime[1]<closeEU then
    lundiclose
    lundiclodeopen = close
    endif
    drawrectangle(lundiopen, lundipriceopen, lundiclose, lundiclodeopen) coloured(204,102,0,50) bordercolor(0,0,0,0) STYLE(line,3)
    endif
    
    

    Puis pareil pour le mardi, le mercredi, etc… MAIS le problème se pose le lundi suivant car lundiopen à déjà une valeur…

    (bon j’ai créé le code ici à la volé pour expliquer le problème alors s’il n’est pas fonctionnel c’est pas important).
    J’ai besoin qu’à chaque semaine, c’est à dire qu’à chaque nouveau lundi, les variables “lundiopen” et ” lundiclodeopen” soit considéré comme “neuve”.

    Peut-on faire un RESET de variable ?
    Je pourrais mettre les variables du lundi à 0 (zéro) dès que “OpenDayOfWeek = 2” (donc le mardi), mais cela entraînerait un affichage sur la ligne des 0.
    Comment faire cela proprement ?

    Merci.

Viewing 1 post (of 1 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

Comment réinitialiser une variab


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
imencity @imencity Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 02/07/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...