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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #115579 quote
    MolrMolr
    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
    NicolasNicolas
    Keymaster
    Legend

    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
    MolrMolr
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 MolrMolr
6 years, 10 months ago.

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