code qui marche en back test mais qui n’exécute pas les ordres

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #250796 quote
    capccapc
    Participant
    Junior
    bonjour, Lorsque j’ai voulu activer pro order avec le code ci après je me suis heurtée à un refus de l’exécution des ordres au motif  ” ordre rejeté par le courtier ou par le marché. “For the controlled risk order, neither contingent stop nor the tralling stop is set”  
    SMA=Average[Periods](close)
    
    IF NOT ONMARKET THEN
    IF Close CROSSES OVER SMA THEN
    BUY AT MARKET
    ENDIF
    ELSE
    
    IF Close CROSSES UNDER SMA THEN
    SET STOP %LOSS StopPercent
    SET Target %PROFIT StopPercent * ProfitLossRatio
    ENDIF
    ENDIF
    GRAPHONPRICE SMA
    pourtant les instructions de sortie me paraissent définies. Auriez vous une idée pour que les ordres s’exécutent? Je vous en remercie par avance
    #250797 quote
    JSJS
    Participant
    Master

    Salut,

    Quelles valeurs avez-vous utilisées pour le “StopPercent” et le “ProfitLossRatio”… ?

    #250800 quote
    capccapc
    Participant
    Junior
    bonjour, Merci à vous de vous penchez sur mon problème 🙂 J’ai utilisé les valeurs suivantes: StopPercent: 1.5% ProfitLossRatio: 0.5
    #250801 quote
    JSJS
    Participant
    Master

    En principe, tout fonctionne… ?

    Scherm­afbeelding-2025-09-14-om-12.04.03.jpg Scherm­afbeelding-2025-09-14-om-12.04.03.jpg
    #250803 quote
    capccapc
    Participant
    Junior
    oui en backtest ça fonctionne très bien… mais en réel mes ordres sont rejetés
    #250804 quote
    JSJS
    Participant
    Master

    Je vois maintenant ce qui risque de se passer, car si vous achetez sans « StopLoss » lié, les ordres seront rejetés sur votre compte « risque limité »…

    Essayez ceci…

    Periods=20
    StopPercent=1.5
    ProfitLossRatio=0.5
    
    SMA=Average[Periods](close)
    
    IF NOT ONMARKET THEN
    IF Close CROSSES OVER SMA THEN
    BUY AT MARKET
    SET STOP %LOSS StopPercent
    SET Target %PROFIT StopPercent * ProfitLossRatio
    ENDIF
    EndIf
    
    GraphOnPrice SMA coloured("Red")

    robertogozzi, capc and Iván González thanked this post
    #250806 quote
    fifi743fifi743
    Participant
    Master
    et si vous modifié comme ci dessous en lui donnant le nombre de contrat
    
    Periods=20
    StopPercent=1.5
    ProfitLossRatio=0.5
     
    SMA=Average[Periods](close)
     
    IF NOT ONMARKET THEN
    IF Close CROSSES OVER SMA THEN
    BUY 1 contract AT MARKET
    SET STOP %LOSS StopPercent
    SET Target %PROFIT StopPercent * ProfitLossRatio
    ENDIF
    EndIf
     
    GraphOnPrice SMA coloured("Red")
    robertogozzi, capc and Iván González thanked this post
    #250808 quote
    capccapc
    Participant
    Junior
    Merci beaucoup pour vos retours, je teste ça des demain
    #250817 quote
    capccapc
    Participant
    Junior
    Corrigé selon vos conseil l’ordre a bien été éxécuté! Merci à vous 🙂
    JS thanked this post
Viewing 9 posts - 1 through 9 (of 9 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

code qui marche en back test mais qui n’exécute pas les ordres


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
capc @capc Participant
Summary

This topic contains 8 replies,
has 3 voices, and was last updated by capccapc
1 year, 1 month ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 09/14/2025
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...