INDICATEURS 3F

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #262127 quote
    Gigi
    Participant
    Senior

    Bonsoir,

    Après avoir demandé un indicateur avec 1 entrée, j’aimerai avoir l’indicateur de cette stratégie en dessous du graphe des prix avec une possibilité jusqu’à 3 entrées. Je vous joins l’itf. Par avance, merci.

    3-FOIS.itf
    #262132 quote
    Iván González
    Moderator
    Legend

    Bonjour, pouvez-vous partager le code en utilisant le bouton </> ?


    #262141 quote
    SOBOUL
    Participant
    Junior

    Bonjour,

    je n’ai pas comprisvotre demande, mais j’ai appuyé sur ce bouton que vous m’avez demandé. C’est la premère fois que je fais cela. Pouvez vous me donnez une explication? Par avance, merci pour tout.

    3-FOIS-1.itf
    #262143 quote
    Iván González
    Moderator
    Legend

    Pour vous aider, nous devons télécharger votre indicateur, l’importer, puis travailler dessus. Le plus simple est de nous transmettre le code en le copiant-collant ici.

    Pour saisir le code, vous pouvez utiliser le bouton dont j’ai parlé précédemment.

    capital = 3000// + strategyprofit
    // On divise le capital par 3 pour chaque tranche
    n = round(((capital / 3) / close))
    IF n < 1 THEN
       n = 1
    ENDIF
    
    // --- INDICATEURS ---
    rsi2 = RSI[2](close)
    tendanceLongTerme = Average[50](close)
    
    // --- INITIALISATION ---
    if not onmarket then
       POSA = 0
    endif
    // --- ENTRÉES (PYRAMIDAGE) ---
    // Entrée 1 : Condition initiale
    IF POSA = 0 AND rsi2  tendanceLongTerme THEN
       BUY n SHARES AT MARKET
       POSA = 1
    ENDIF
    
    // Entrée 2 : Si on est déjà en position, on renforce si baisse de 2%
    IF POSA = 1 AND close < (POSITIONPRICE * 0.95) THEN
       BUY N SHARES AT MARKET
       POSA = 2
    ENDIF
    
    // Entrée 3 : Si on est à 2 niveaux, on renforce si nouvelle baisse de 2%
    IF POSA = 2 AND close  3% ET RSI suracheté
    IF ONMARKET AND close > (POSITIONPRICE * 1.03) AND rsi2 > 59 THEN
       SELL AT MARKET
       POSA = 0
    ENDIF
    
    GRAPH POSA AS "Level (0-3)"
    
    IF ONMARKET THEN
       GRAPHONPRICE POSITIONPRICE AS "Precio medio" coloured("blue")
       IF POSA = 1 THEN
          GRAPHONPRICE POSITIONPRICE * 0.95 AS "Gatillo entrada 2" coloured("orange")
       ELSIF POSA = 2 THEN
          GRAPHONPRICE POSITIONPRICE * 0.85 AS "Gatillo entrada 3" coloured("red")
       ENDIF
    ENDIF
    



    #262146 quote
    SOBOUL
    Participant
    Junior

    Bonsoir,

    j ai bien reçu le code mais il y a un petit souci, je demandai un indicateur mais sur le code il y a la fonction buy et il n’y a pas la fonction return et de plus quand je place le codage dans indicateur, j’ai plusieurs erreurs.

    #262150 quote
    Iván González
    Moderator
    Legend

    D’accord, je comprends. Comme le code que vous avez partagé concernait un système de trading, j’ai supposé qu’il s’agissait d’une erreur.

    Ce serait l’indicateur :

    rsi2 = RSI[2](close)
    tendanceLongTerme = Average[50](close)
    
    
    ONCE posa = 0         
    ONCE sommePrix = 0
    
    
    // Prix moyen des entrées = équivalent de POSITIONPRICE
    prixMoyen = 0
    IF posa > 0 THEN
       prixMoyen = sommePrix / posa
    ENDIF
    
    
    // --- ENTRÉES (pyramidage) : une seule par bougie ---
    IF posa = 0 AND rsi2  tendanceLongTerme THEN
       sommePrix = close
       posa = 1
    ELSIF posa = 1 AND close < prixMoyen * 0.95 THEN
       sommePrix = sommePrix + close
       posa = 2
    ELSIF posa = 2 AND close  0 THEN
       prixMoyen = sommePrix / posa
    ENDIF
    
    
    // --- SORTIE GLOBALE : on solde tout ---
    IF posa > 0 AND close > prixMoyen * 1.03 AND rsi2 > 59 THEN
       posa = 0
       sommePrix = 0
    ENDIF
    
    
    RETURN posa AS "Niveau d'entrée (0-3)"
    
    robertogozzi thanked this post
    #262156 quote
    robertogozzi
    Moderator
    Master

    Vous pouvez également consulter cette version https://www.prorealcode.com/topic/creation-indicateur/#post-262123


    Iván González thanked this post
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

INDICATEURS 3F


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Gigi @gigi Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by robertogozzi
2 weeks, 5 days ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 06/21/2026
Status: Active
Attachments: 2 files
Logo Logo
Loading...