Arrêt durant le week-end

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #49048 quote
    clasch
    Participant
    Senior

    Bonjour,

    J’aimerais que mon système clôt automatiquement une éventuelle position ouverte le VE à 23h00 et que le système reprend “du service” dans la nuit de dimanche à lundi à 00h02.

    Comment coder ceci sur mon sytème ?

    Je crois que les heures de 23h00 et 00h02 sont exactes ?

    Merci beaucoup pour votre aide !

    #49058 quote
    Nicolas
    Keymaster
    Master

    Il faut simplement faire des tests avec les jours et heures: (toutes les instructions liées aux dates et au temps sont ici: Date and time).

    if onmarket and dayofweek=5 and hour=23 and minute=0 then 
     sell at market 
     exitshort at market 
    endif

    Pour que le système travail à partir du Lundi uniquement il faut créer une condition booléenne et inclure toute le code de la stratégie à l’intérieur :

    if dayofweek>=1 and dayofweek<=5 and hour<23 then 
     //inclure le code de la stratégie 
    endif
    
    #49074 quote
    clasch
    Participant
    Senior

    Merci beaucoup !

    Bonne journée,

    clasch

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

Arrêt durant le week-end


Support ProOrder

New Reply
Author
author-avatar
clasch @clasch Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by clasch
8 years, 3 months ago.

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