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
    capc
    Participant
    New

    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
    JS
    Participant
    Senior

    Salut,

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

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

    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
    capc
    Participant
    New
    oui en backtest ça fonctionne très bien… mais en réel mes ordres sont rejetés
    #250804 quote
    JS
    Participant
    Senior

    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
    fifi743
    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
    capc
    Participant
    New
    Merci beaucoup pour vos retours, je teste ça des demain
    #250817 quote
    capc
    Participant
    New
    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.

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 capc
5 months, 2 weeks ago.

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