selection d’un jour dans un mois

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #220235 quote
    denis aigdenis aig
    Participant
    Average

    Bonjour je souhaite sélectionner un jour dans un mois.

    dans ce code j’ai sélectionné le mois de janvier mais j’aimerais sélectionner aussi le jour d’entrée et le jour de sortie.

    pouvez-vous m’aider merci

    DEFPARAM CumulateOrders = False
     
    IF currentmonth = 1 THEN
    BUY 1 shares at market
    ENDIF
     
    IF  currentmonth = 2  THEN
    SELL at market
    ENDIF
    #220236 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Voilà:

    DEFPARAM CumulateOrders = False
    
    EntryDAY = 9
    ExitDAY  = 20
    
    IF currentmonth = 1 and ((day = EntryDay) OR (day > EntryDay and day[1] < EntryDay) )THEN
    //IF currentmonth = 1 and day = EntryDay THEN
       BUY 1 shares at market
    ENDIF
     
    IF currentmonth = 2 and ((day = ExitDay) OR (day > ExitDay and day[1] < ExitDay) )THEN
    //IF currentmonth = 2 and day = ExitDay THEN
       SELL at market
    ENDIF

    J’ai ajouté deux lignes pour chaque type d’opération (entrée et sortie). La première ligne est celle par défaut et elle fonctionne soit lorsque le jour souhaité est un jour de bourse ou non, dans ce dernier cas, elle entre (ou sort) une le jour de bourse suivant.
    Vous pouvez échanger les barres obliques de commentaire pour que le code entre et sorte le jour souhaité uniquement, de sorte que s’il ne s’agit pas d’un jour de bourse, ce mois sera ignoré.

    #221000 quote
    denis aigdenis aig
    Participant
    Average

    oh merci beaucoup Roberto Gozzi, je vais essayer merci 🙂

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

selection d’un jour dans un mois


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
denis aig @denis-aig Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by denis aigdenis aig
3 years, 1 month ago.

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 09/03/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...