Aide code récupération données relative aux chandelier

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

    Bonjour à tous,
    Ceci est mon premier message sur le forum.
    J’utilise actuellement le code ci-dessous pour récupérer un chandelier de 5 minutes spécifique à une date donnée dans ProRealTime. Cependant, j’aimerais le personnaliser pour récupérer tous les chandeliers de 5 minutes d’une journée spécifique, mais uniquement ceux compris entre 9h et 18h. Les informations que je souhaite obtenir pour chaque chandelier incluent : l’ouverture, la clôture, le plus haut, le plus bas, le volume, et l’heure du chandelier.

    Problème actuel : Ce code récupère et affiche actuellement un seul chandelier, mais je souhaite obtenir tous les chandeliers entre 9h et 18h pour une journée donnée. Comment puis-je le modifier pour itérer sur tous les chandeliers dans cette plage horaire et afficher les informations souhaitées ?

    Merci d’avance pour votre aide !

    Voici le code que j’utilise actuellement que j’ai d’ailleurs récupérer ici et tenter d’améliorer :

    defparam drawonlastbaronly=true

    // —-settings——
    Start=20240731
    Alpha=50
    X=1
    Y=1
    NbTotal=50 // Total des chandeliers disponibles
    NbAffiche=1 // Nombre de chandeliers à afficher simultanément
    Offset=0 // Offset de défilement
    // ——————

    NbDeCinqMinutes = NbAffiche // Nombre de chandeliers de 5 minutes à analyser
    timeframe(5 minutes)
    if opendate=start then
    d1=Openday
    mm1=Openmonth
    y1=OpenYear
    startbar=barindex
    dernier=close
    ouverture=open
    PlusHaut=high
    plusBas=low
    for j=1 to NbTotal do
    $d2[j]=Openday[j-1]
    $v[j]=volume[j-1]
    $var[j]=(round((close[j-1] – open[j-1]) / open[j-1] * 100, 2)) // Calcul de la variation en pourcentage
    next
    endif
    timeframe(default)

    startIndex = Offset
    endIndex = min(NbTotal, startIndex + NbAffiche)

    dist = 0
    distStep = 60
    dist1 = 10
    dist2 = 30
    d2 = 1
    der = 0

    for i = startIndex TO endIndex-1 do
    der = close[i]
    ouv = open[i]
    hh = high[i]
    ll = low[i]
    vol = volume[i]
    var = (close[i] – open[i]) / open[i] * 100

    if var < 0 then
    r = 250
    b = 0
    g = 0
    else
    r = 0
    b = 110
    g = 10
    endif

    dist = dist + distStep

    DRAWTEXT(der, 50+x, y+dist,Dialog,Bold,18) anchor(bottomleft)
    DRAWTEXT(ouv, 250+x, y+dist,Dialog,Bold,18) anchor(bottomleft)
    DRAWTEXT(hh, 450+x, y+dist,Dialog,Bold,18) anchor(bottomleft)
    DRAWTEXT(ll, 650+x, y+dist,Dialog,Bold,18) anchor(bottomleft)
    DRAWTEXT(vol, 850+x, y+dist,Dialog,Bold,18) anchor(bottomleft)
    DRAWTEXT(var, 1000+x, y+dist,Dialog,Bold,18) anchor(bottomleft)coloured(r,b,g,250)
    DRAWTEXT(Openday[i], x-150, y+dist,Dialog,Bold,18) anchor(bottomleft)
    drawrectangle(X-205, Y+dist1, 1105+X, 20+Y+dist2+dist)anchor(bottomleft)coloured(100,150,10,alpha)bordercolor(200,150,10,250)
    next

    return

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

    Vous pouvez utiliser l'extrait suivant pour stocker les données de chaque bougie pour le jour sélectionné :

    if opendate=start and time>090000 and time<=180000 then
    $open[n+1]=open
    $close[n+1]=close
    $high[n+1]=high
    $low[n+1]=low
    $volume[n+1]=volume
    $bartime[n+1]=time
    $barindex[n+1]=barindex
    n=n+1
    endif
    #236133 quote
    bob793bob793
    Participant
    New

    Je vous remercie pour votre retour, testé et ok
    Bonne journée

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

Aide code récupération données relative aux chandelier


ProOrder : Trading Automatique & Backtests

New Reply
Author
author-avatar
bob793 @bob793 Participant
Summary

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

Topic Details
Forum: ProOrder : Trading Automatique & Backtests
Language: French
Started: 07/31/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...