Inversion d’ un code très perdant?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #266039 quote
    48014801
    Participant
    Junior

    Bonjour tout le monde,

    Le code en pièce jointe donne un résultat horrible, l’ equity cuve est cependant intéressante car pertes successives très régulières.

    Peut on écrire ce code à l’ envers, afin d’ inverser l’ equity cuve, ce qui donnerait un beau résultat ?


    // Définition des paramètres du code

    DEFPARAM CumulateOrders = False

    DEFPARAM PreLoadBars = 15000

    macdCourt = 12

    macdLong = 26

    macdLissage = 9

    stFacteur = 4

    stPeriode = 30

    ligneMacd = MACDLine[macdCourt,macdLong,macdLissage](close)

    ligneSignal = MACDSignal[macdCourt,macdLong,macdLissage](close)

    histoMacd = ligneMacd – ligneSignal

    valeurST = Supertrend[stFacteur,stPeriode]

    tendanceHausse = close > valeurST

    tendanceBaisse = close < valeurST

    croisementBas = histoMacd CROSSES UNDER 0

    croisementHaut = histoMacd CROSSES OVER 0

    // Deux baisses consecutives, histogramme courant encore positif.

    deuxBaisses = histoMacd < histoMacd[1] AND histoMacd[1] < histoMacd[2]

    // Deux hausses consecutives, histogramme courant encore negatif.

    deuxHausses = histoMacd > histoMacd[1] AND histoMacd[1] > histoMacd[2]

    sortieLong = (histoMacd > 0 AND deuxBaisses) OR tendanceBaisse

    sortieShort = (histoMacd < 0 AND deuxHausses) OR tendanceHausse


    IF LongOnMarket THEN

    IF sortielong THEN

    SELL AT MARKET

    ENDIF

    ELSIF ShortOnMarket THEN

    IF sortieShort THEN

    EXITSHORT AT MARKET

    ENDIF

    ELSE

    IF tendanceHausse AND croisementBas THEN

    BUY 1 CONTRACT AT MARKET

    ELSIF tendanceBaisse AND croisementHaut THEN

    SELLSHORT 1 CONTRACT AT MARKET

    ENDIF

    ENDIF


    //Objectif gain

    SET TARGET PROFIT gain

    SET STOP LOSS perte

    Merci beaucoup.

    equity-curve-avec-UKX-15-mn.png equity-curve-avec-UKX-15-mn.png Rapport-GPT-V4.png Rapport-GPT-V4.png
Viewing 1 post (of 1 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

Inversion d’ un code très perdant?


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
4801 @4801 Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 11/04/2026
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...