Code Pivot 2 jours

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #218011 quote
    PRC_2021PRC_2021
    Participant
    Average

    Bonjour,

    Voici mon code pour le pivot Journalier mais je souhaiterai avoir le code pour le Pivot 2 jours ?

    // POINT PIVOT JOURNALIER
    IF dayofweek = 1 THEN
    dayhigh = DHigh(2)
    daylow = DLow(2)
    dayclose = DClose(2)
    ENDIF
     
    IF dayofweek >=2 and dayofweek < 6 THEN
    dayhigh = DHigh(1)
    daylow = DLow(1)
    dayclose = DClose(1)
    ENDIF
     
    PPDay = (dayhigh + daylow + dayclose) / 3
    
    return PPDay
    

     

    Pouvez vous m’aider svp

    #218096 quote
    PRC_2021PRC_2021
    Participant
    Average

    Personne n’as d’idées ?

    #218685 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Je suppose que c’est pour IG avec l’intention d’enlever le dimanche, si cette version du pivot jour te convient on va partir d’elle (mais pour le lecteur qui passe sur ce post et qui n’est pas chez IG, ou qui n’est pas dans un fuseau horaire compatible avec cette version, il lui en faudra une autre).

    Je rajoute à ta version ce qui va permettre de créer un pivot 2 jours, à tester.

    once compteur2j=1
    jourutile=0
    
    // POINT PIVOT JOURNALIER
    IF dayofweek = 1 THEN
    dayhigh = DHigh(2)
    daylow = DLow(2)
    dayclose = DClose(2)
    jourutile=1
    ENDIF
    
    IF dayofweek >=2 and dayofweek < 6 THEN
    dayhigh = DHigh(1)
    daylow = DLow(1)
    dayclose = DClose(1)
    jourutile=1
    ENDIF
    
    if day<>day[1] and jourutile then
    
    if compteur2j=1 then
    compteur2j=2
    dayhigh1=dayhigh
    daylow1=daylow
    elsif compteur2j=2 then
    compteur2j=1
    dayhigh2=dayhigh
    daylow2=daylow
    dayhigh2j=max(dayhigh1,dayhigh2)
    daylow2j=min(daylow1,daylow2)
    dayclose2j=dayclose
    endif
    endif
    
    PPDay = (dayhigh + daylow + dayclose) / 3
    
    PP2j = (dayhigh2j + daylow2j + dayclose2j) / 3
    
    return PPDay, PP2j
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

Code Pivot 2 jours


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
PRC_2021 @manu35250 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by JC_BywanJC_Bywan
3 years, 1 month ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/22/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...