Fermeture d’un trade

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

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    RICOURICOU
    Participant
    Junior

    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.
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

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 RICOURICOU
2 years, 2 months ago.

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