STOP TRADE EN COURS

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #235326 quote
    RICOU
    Participant
    New

    Bonjour les experts, pouvez vous m’aider à trouver un code qui puisse stopper mon trade quand il se trouve dans la configuration suivante (voir PJ), c’est à dire le stopper quand il est à son pic et éviter la chute qui arrive et annule la belle progression. Par avance merci.

    Screenshot_2024-07-15-19-40-52-300_com.iggroup.android.cfd_.jpg Screenshot_2024-07-15-19-40-52-300_com.iggroup.android.cfd_.jpg
    #235328 quote
    robertogozzi
    Moderator
    Master

    Le voici, vous pouvez voir à partir des variables affichées avec GRAPH  lorsque les modèles de sortie se produisent (à condition que l’opération soit en profit):

    ONCE N     = 10
    Sma100     = average[100,0](close)
    LongCond   = close CROSSES OVER  Sma100
    ShortCond  = close CROSSES UNDER Sma100
    Body       = abs(close - open)
    BodyCond   = Body > (range * 0.75)       //Body must be > 75% of the range
    RangeCond  = range >= average[N,0](range)
    Bullish    = close > open
    Bearish    = close < open
    HH         = max(high,high[1]) = highest[N](high)
    LL         = min(low,low[1])   = lowest[N](low)
    UpperSwing = HH AND Bearish AND Bullish[1] AND BodyCond AND RangeCond
    LowerSwing = LL AND Bullish AND Bearish[1] AND BodyCond AND RangeCond
    IF Not OnMarket THEN
       IF LongCond  THEN
          BUY 1 CONTRACT AT MARKET
       ELSIF ShortCond THEN
          SELLSHORT 1 CONTRACT AT MARKET
       ENDIF
       SET TARGET pPROFIT 500
       SET STOP   pLOSS   100
    ELSE
       IF PositionPerf > 0 THEN
          IF LongOnMarket AND UpperSwing THEN
             SELL AT MARKET
          ELSIF ShortOnMarket AND LowerSwing THEN
             EXITSHORT AT MARKET
          ENDIF
       ENDIF
    ENDIF
    graph LongOnMarket  AND (PositionPerf > 0) AND UpperSwing coloured("Red")
    graph ShortOnMarket AND (PositionPerf > 0) AND LowerSwing coloured("Blue")
    Iván González thanked this post
    ExitPattern.itf
    #235332 quote
    RICOU
    Participant
    New

    Bonjour Roberto, merci beaucoup, je dois donc insérer cette partie de code dans mon code original….jeune saisis pas trop la notion de graph.

    #235334 quote
    GraHal
    Participant
    Master

    Le code de Roberto (2 articles ci-dessus) ajouté en tant que journal 389 ici…

    Bibliothèque de liens d’extraits

    robertogozzi thanked this post
    #235355 quote
    Iván González
    Moderator
    Master

    Je pense qu'on pourra rarement sortir au point le plus haut ou entrer au point le plus bas d'une opération… Pour tenter de sortir avant une correction vous pouvez utiliser par exemple un oscillateur comme RSI, Stochastic, CCI, etc. qui vous permettent de détecter les zones extrêmes.

    #235376 quote
    robertogozzi
    Moderator
    Master

    @RICOU

    Insérez cette partie dans votre code, peu importe où, tant que votre code ne contient pas de variables du même nom, auquel cas vous devrez la modifier même en ajoutant un seul caractère.

    ONCE N     = 10
    Sma100     = average[100,0](close)
    LongCond   = close CROSSES OVER  Sma100
    ShortCond  = close CROSSES UNDER Sma100
    Body       = abs(close - open)
    BodyCond   = Body > (range * 0.75)       //Body must be > 75% of the range
    RangeCond  = range >= average[N,0](range)
    Bullish    = close > open
    Bearish    = close < open
    HH         = max(high,high[1]) = highest[N](high)
    LL         = min(low,low[1])   = lowest[N](low)
    UpperSwing = HH AND Bearish AND Bullish[1] AND BodyCond AND RangeCond
    LowerSwing = LL AND Bullish AND Bearish[1] AND BodyCond AND RangeCond
    IF OnMarket AND PositionPerf > 0 THEN
       IF LongOnMarket AND UpperSwing THEN
          SELL AT MARKET
       ELSIF ShortOnMarket AND LowerSwing THEN
          EXITSHORT AT MARKET
       ENDIF
    ENDIF
    #235392 quote
    GraHal
    Participant
    Master

    Stratégie de sortie ci-dessus   ajoutée en tant que journal 390 ici…

    Snippet Link Library

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

STOP TRADE EN COURS


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
RICOU @ricou Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by GraHal
1 year, 7 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 07/16/2024
Status: Active
Attachments: 2 files
Logo Logo
Loading...