Overnight: ouvrir une position à la fermeture et la refermer à l’ouverture

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #115579 quote
    Molr
    Participant
    New

    Bonjour,

    J’essaie de créer mon premier programme, qqch de simple …

    Le but : ouvrir une position à la fermeture des marchés et la refermer à l’ouverture du lendemain

    BUY 1 CONTRACTS AT DClose(0) LIMIT
    SELL 1 CONTRACTS AT MARKET NextBarOpen
    

    Le problème : il y a des jours où PRT n’ouvre pas de position et je ne comprends pas pourquoi

    Pourriez-vous m’aider, svp ?

    #115888 quote
    Nicolas
    Keymaster
    Master

    Le code étant lu à la fermeture de bougie et l’ordre lancé à l’ouverture suivante, il faut pour cela utiliser une unité de temps plus petite que le journalier.

    En admettant que la fermeture de l’instrument est à 22:00, on ouvre une position à 21:55 :

     

    if time=215500 then 
     buy 1 contract at market 
    endif

    Le jour suivant, si on est au marché et dés la détection du changement de jour, on ferme la position :

    if onmarket and day<>day[1] then 
     sell at market 
    endif
    #116636 quote
    Molr
    Participant
    New

    Merci je teste dès que j’ai un peu de temps

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

Overnight: ouvrir une position à la fermeture et la refermer à l’ouverture


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
Molr @molr Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Molr
6 years, 2 months ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 12/29/2019
Status: Active
Attachments: No files
Logo Logo
Loading...