TEMA sans le dimanche

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #257141 quote
    greg2104
    Participant
    New

    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ález
    Moderator
    Master

    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"
    


    greg2104 and robertogozzi thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

TEMA sans le dimanche


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
greg2104 @greg2104 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
4 days, 17 hours ago.

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