TEMA sans le dimanche

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #257141 quote
    Sylvain BernardSylvain Bernard
    Participant
    Junior

    Bonjour, je voudrai obtenir une TEMA qui ne prend pas en compte la bougie journalière du dimanche dans son calcul.

    Comment pourrais-je faire?

    Merci d’avance.

    Sylvain

    #257142 quote
    Iván GonzálezIván González
    Moderator
    Legend

    voici

    // TEMA calculation excluding Sundays
    period =20
    isSunday = (DayOfWeek = 0)
    IF NOT isSunday THEN
       alpha = 2 / (period + 1)
       IF BarIndex < period THEN
          ema1 = close
          ema2 = close
          ema3 = close
       ELSE
          // EMA = Price * alpha + EMA[prev] * (1 - alpha)
          ema1 = (close * alpha) + (ema1[1] * (1 - alpha))
          ema2 = (ema1 * alpha) + (ema2[1] * (1 - alpha))
          ema3 = (ema2 * alpha) + (ema3[1] * (1 - alpha))
       ENDIF
       customTEMA = (3 * ema1) - (3 * ema2) + ema3
    ELSE
       ema1 = ema1[1]
       ema2 = ema2[1]
       ema3 = ema3[1]
       customTEMA = customTEMA[1]
    ENDIF
    
    RETURN customTEMA AS "TEMA No Sundays"
    


    Sylvain Bernard and robertogozzi thanked this post
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

TEMA sans le dimanche


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
7 months, 3 weeks ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 01/30/2026
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...