Script 1 seul trade par jour

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #248306 quote
    Sylvain Bernard
    Participant
    Junior

    Bonjour, pourrait-on me donner un code pour n’autoriser qu’un seul trade par journée (ou séance).

    De nombreux sujets ont été postés pour cette problématique mais la réponse n’est jamais claire.

    Merci d’avance, Grégory

    #248307 quote
    JS
    Participant
    Senior

    Bonjour,

    C’est une possibilité…

    //Max trades per day
    Once MaxTrades=1
    
    //Reset counter every day
    If IntraDayBarIndex=0 then
    TradeCount=0
    EndIf
    
    //Count trades
    If LongTriggered or ShortTriggered then
    TradeCount=TradeCount+1
    EndIf
    
    //Order conditions
    If myLongCond and TradeCount<MaxTrades then
    Buy 1 contract at Market
    EndIf
    
    If myShortCond and TradeCount<MaxTrades then
    SellShort 1 contract at Market
    EndIf
    
    Set Stop pLoss SL
    Set Target pProfit TP

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

Script 1 seul trade par jour


ProOrder : Trading Automatique & Backtests

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JS
8 months, 2 weeks ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 06/16/2025
Status: Active
Attachments: No files
Logo Logo
Loading...