MOGALEF TREND FILTER

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #249088 quote
    kats
    Participant
    Junior

    Bonjour

    j’ai vu que certaines d’entre vous cherchaient le code du Mogalef trend filter d’eric lefort

    donc ci apres le code reconstruit pour PRT avec l’aide de l’IA depuis le code nano trader

    il fonctionne correctement

    // Paramètres
    R1= 5 // Période courte pour détecter les poussées
    P2= 20 // Période moyenne pour les tendances intermédiaires
    R3= 80 // Période longue pour les tendances principales
    threshold = 0 // Seuil pour identifier la force de la tendance

    // Calcul des moyennes mobiles pour simuler les tendances
    shortMA = average[R1](close)
    mediumMA = average[P2](close)
    longMA = average[R3](close)

    // Calcul de la force relative (approximation de la logique MTF)
    trendStrength = (close – longMA) / longMA * 100

    // Détection des tendances
    IF shortMA > mediumMA AND mediumMA > longMA AND trendStrength > threshold THEN
    trend = 7 // Tendance haussière forte
    ELSIF shortMA < mediumMA AND mediumMA < longMA AND trendStrength < -threshold THEN
    trend = 1 // Tendance baissière forte
    ELSE
    trend = 3 // Range ou tendance neutre
    ENDIF

    // Affichage
    RETURN trend AS “Mogalef Trend Filter”

    GraHal and robertogozzi thanked this post
    #249090 quote
    Iván González
    Moderator
    Master

    Merci pour la contribution

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

MOGALEF TREND FILTER


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
kats @kats Participant
Summary

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

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/24/2025
Status: Active
Attachments: No files
Logo Logo
Loading...