Vente à la close

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #255062 quote
    paulPRT
    Participant
    New

    Hello,

    je souhaite créer une stratégie qui achète si les deux dernières bougies étaient rouges et qui va vendre à la cloture de la bougie.

    Comment faire ?

    #255066 quote
    Iván González
    Moderator
    Master

    Vous ne pourrez pas le faire à la clôture du marché. Le code suivant en donne un exemple (l'entrée et la sortie se font à l'ouverture du marché, sur la barre suivante).

    candleRed=close<open
    
    if candleRed and candleRed[1] and not longonmarket then
       buy 1 contract at market // Next bar open
    else
       sell at market // Next bar open
    endif

    Pour se rapprocher au maximum de la clôture du marché, il faudrait descendre d'une échelle de temps et ajuster sur la dernière bougie de clôture.

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

Vente à la close


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
paulPRT @paulprt Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
1 month, 3 weeks ago.

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