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