Detection de Dimanche pour BreakoutDaily

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #225781 quote
    Pierreco1991Pierreco1991
    Participant
    Junior

    Bonjour
    Je recherche à détecter des breakouts daily mais en évitant le dimanche.  j’ai donc crée ce code

     

    if OpenDay <> OpenDay [1] THEN
    if DayOfWeek[2]=0 and DayOfWeek = 2 THEN
    // Lundi vs vendredi 
    C1 = DClose(1)>DHigh(3)
    C2 = DClose(1)<DLow(3)
    Cbreak = C1 or C2
    
    ELSE
    C1 = DClose(1)>DHigh(2)
    C2 = DClose(1)<DLow(2)
    Cbreak = C1 or C2
    
    ENDIF
    ENDIF 
    
    RETURN DayOfWeek[2]=0 and DayOfWeek = 2
    

    L’exception que je vise à mettre en place est : Lorsqu’on est mardi , je compare la close du lundi à celle du vendredi si mon J-2 est un dimanche. Sinon , je n’ai pas de dimanche à prendre en compte et je compare toujours avec la précédente bougie.

    Pour être sur de ma condition , j’ai donc placé DayOfWeek[2]=0 and DayOfWeek = 2 en return . Je m’attends donc à une condition vrai lorsque je tombe un mardi car DayOfWeek[2]=0 .

    Pour tester mon code , j’ai pris du forex qui cote le dimanche et comme on peut le voir dans le Screenshot pas de trigg de ma condition.

    Ai je fais une erreur ou mauvaise utilisation du DayOfWeek ?

    Merci

    Capture-3.png Capture-3.png
    #226156 quote
    CotiRCotiR
    Moderator
    Junior

    Bonjour Pierreco

    Le plus simple est d’utiliser l’opendayofweek:

    if OpenDay <> OpenDay [1] THEN
    if OpenDayOfWeek[2]=0 and OpenDayOfWeek = 2 THEN
    // Lundi vs vendredi
    C1 = DClose(1)>DHigh(3)
    C2 = DClose(1)<DLow(3)
    Cbreak = C1 or C2
     
    ELSE
    C1 = DClose(1)>DHigh(2)
    C2 = DClose(1)<DLow(2)
    Cbreak = C1 or C2
     
    ENDIF
    ENDIF
    
    RETURN OpenDayOfWeek[2]=0 and OpenDayOfWeek = 2
    
    

    Bonne journée

    Pierreco1991 thanked this post
    #226274 quote
    Pierreco1991Pierreco1991
    Participant
    Junior

    Merci pour la réponse

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

Detection de Dimanche pour BreakoutDaily


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Pierreco1991Pierreco1991
2 years, 8 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 12/28/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...