Fermeture d’un trade

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

    Bonjour, je recherche un code qui puisse fermer un trade après la première bougie en fonction de la direction. Si le trade se déclenche en long et que la première bougie est à la baisse le trade est fermé et si le trade déclenché est court et que la première bougie est à la hausse, le trade est fermé.

    Par avance merci

    #235806 quote
    robertogozzi
    Moderator
    Master

    Voilà:

    Bullish = close > open
    Bearish = close < open
    IF (BarIndex - TradeIndex) = 1 THEN
       IF LongOnMarket AND Bearish THEN
          SELL AT MARKET
       ELSIF ShortOnMarket AND Bullish THEN
          EXITSHORT AT MARKET
       ENDIF
    ENDIF
    Iván González thanked this post
    #235811 quote
    RICOU
    Participant
    New

    Merci beacoup Roberto pour la réactivité

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

Fermeture d’un trade


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
RICOU @ricou Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by RICOU
1 year, 7 months ago.

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