Anticiper d'une bougie l'éxécution de ce code simple

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35442 quote
    Toto le Heros
    Participant
    Veteran

    Bonjour,

    Voici un code très simple de ma composition. Achat sur réintégration RSI.

    Le code achète lorsque RSI cloture en cassant à la hausse la valeur 20.

    Cependant, l’ordre d’achat n’est pas pris immédiatement à l’ouverture de la bougie suivante ; mais une bougie plus tard…

    Peut-on accélérer ? (en gardant la contrainte de nécessité de clôture)

    D’avance merci.

    Thomas

    // Définition des paramètres du code
    DEFPARAM CumulateOrders = False // Cumul des positions désactivé
    
    DEFPARAM FLATBEFORE = 090000
    DEFPARAM FLATAFTER = 220000
    
    // Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position avant l'heure spécifiée
    timeEnterBefore = time >= 090500
    
    // Empêche le système de placer des ordres pour entrer sur le marché ou augmenter la taille d'une position après l'heure spécifiée
    timeEnterAfter = time < 171000
    
    // Empêche le système de placer de nouveaux ordres sur les jours de la semaine spécifiés
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    //VALEUR SEUIL
    ref=20
    
    //1ER PASSAGE
    Once a1=0
    
    //VARIABLE D'ECARTEMENT DU RSI
    m=20
    
    //CONDITIONS D'ENTREE EN POSITION ACHAT
    if rsi[9](close) crosses under ref and a1=0 then
    a1=1
    endif
    if a1=1 then
    if rsi[9](close) crosses over ref and onmarket=0  AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry then
    buy 1 contract at market
    a1=2
    endif
    endif
    if a1=2 then
    if rsi[9](close) crosses over ref+m then
    a1=0
    endif
    endif
    
    // Stops et objectifs
    SET STOP pLOSS 10
    SET TARGET pPROFIT 1
    #35465 quote
    Toto le Heros
    Participant
    Veteran

    Résolu. Merci.

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

Anticiper d'une bougie l'éxécution de ce code simple


Support ProOrder

New Reply
Author
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Toto le Heros
8 years, 8 months ago.

Topic Details
Forum: Support ProOrder
Language: French
Started: 05/13/2017
Status: Active
Attachments: No files
Logo Logo
Loading...