Code pour calcul pivot hebdo et mensuel

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #187752 quote
    fredd786fredd786
    Participant
    Senior

    Bonjour à tous

    Je cherche tout simplement à récupérer la valeur du pivot hebdo sur un graph 1 heure
    et du pivot mensuel sur un graph 4 heures
    (pour m’en servir ultérieurement dans la construction d’indicateur)

    Mais j’ai une erreur de calcul
    Et je ne trouve pas comment la résoudre

    Pour le pivot hebdo, j’ai mis ceci

    timeframe (weekly, updateonclose)
    weekhigh = high
    weeklow = low
    weekclose = close
    
    Pivot = (weekhigh + weeklow + weekclose) / 3
    
    return pivot as "pivot"

    Et pour le pivot mensuel ceci

    //Récupérer Pivot monthly
    timeframe (monthly, updateonclose)
    monthhigh = high
    monthlow = low
    monthclose = close
    
    Pivot = (monthhigh + monthlow + monthclose) / 3
    
    return pivot as "pivot"
    

    Merci de votre aide

    #187799 quote
    fredd786fredd786
    Participant
    Senior

    J’ai finalement repris le code ci-dessous pour le pivot hebdo

    IF dayofweek < dayofweek[1] THEN
    weekhigh = prevweekhigh
    weeklow = prevweeklow
    weekclose = prevweekclose
    prevweekhigh = high
    prevweeklow = low
    ENDIF
    
    prevweekhigh = max(prevweekhigh, high)
    prevweeklow = min(prevweeklow, low)
    prevweekclose = close
    
    PPWeek = (weekhigh + weeklow + weekclose) / 3

    Je vais maintenant chercher une solution pour le pivot mensuel sur graphique 4 heures

Viewing 2 posts - 1 through 2 (of 2 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 pour calcul pivot hebdo et mensuel


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
fredd786 @fredd786 Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by fredd786fredd786
4 years, 7 months ago.

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