Durée minimum entre 2 prises de position

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #244833 quote
    rd0385rd0385
    Participant
    New

    Bonjour,

    J’aimerai écrire un bout de code permettant d’imposer un nombre de barre minimum entre deux prises de position à l’achat. Est-ce possible ?

    Merci

    #244834 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Bonjour. Vous pouvez compter le nombre de bougies pendant lesquelles vous êtes hors du marché avec cet extrait de code :

    if not onmarket then
    bars=1+bars
    else
    bars=0
    endif
    plbourse thanked this post
    #255339 quote
    fleglofleglo
    Participant
    Junior

    Bonjour, c’est très simple et essayé avant de “balancer”:

    1. D’abord, identifier le nombre de chandelles qui passent hors position: // à mettre avant vos conditions

    if time > “votre heure de début de trade” and not onmarket then
    entredeux = entredeux +1// cela s’appelle “flaguer” en jargon codage prt
    else
    entredeux = 0
    endif

    endif

    2. ensuite, dans vos conditions, vous rajoutez;

    if “vos conditions” and entredeux  >  “variable du nombre de chandelles que vous choisissez” and… or … etc. then

    buy X contracts..

    sellshort X contracts..

    etc.

    endif

    3. Toujours vérifier et visualiser avec la fonction graph en toute fin de trade:

    Graph entredeux coloured (0,0,0)//noir

    //  Au plaisir

    Iván González thanked this post
    #255342 quote
    plbourseplbourse
    Participant
    New

    Bonjour

    autre proposition, par exemple pour un intervalle de 10 bougies

    If highest[10](onmarket) = 0 then
    CondTrade = 1
    else
    CondTrade = 0
    endif
    
    // CondTrade est une condition pour prendre le Trade

    Bons Trades

    Iván González thanked this post
    #255343 quote
    LucasBestLucasBest
    Participant
    Senior
    CondTrade = highest[10](onmarket) = 0
    plbourse and Iván González thanked this post
Viewing 5 posts - 1 through 5 (of 5 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

Durée minimum entre 2 prises de position


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
rd0385 @rd0385 Participant
Summary

This topic contains 4 replies,
has 5 voices, and was last updated by LucasBestLucasBest
8 months, 2 weeks ago.

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