stopper un trade sous condition

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

    Bonjour,

    je n’arrive pas a écrire le code qui ferait :

    si après une prise de position longue, à un moment donné il y a 3 bougies rouges consécutives, le trade est stoppé

    et

    si après une prise de position courte, à un moment donné il y a 3 bougies vertes consécutives, le trade est stoppé

    Par avance merci,

    #225953 quote
    robertogozzi
    Moderator
    Master

    Voilà:

    Bullish = close > open
    Bearish = close < open
    Bull3   = (summation[3](Bullish) = 3)
    Bear3   = (summation[3](Bearish) = 3)
    IF LongOnMarket AND Bear3 THEN
       SELL AT MARKET
    ENDIF
    IF ShortOnMarket AND Bull3 THEN
       EXITSHORT AT MARKET
    ENDIF
    #226080 quote
    RICOU
    Participant
    New

    Merci beaucoup

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

stopper un trade sous condition


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
2 years, 1 month ago.

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