Minimo massimo su grafico mensile

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #227468 quote
    pignolauspignolaus
    Participant
    Average

    Buongiorno,

    ho provato a formulare un indicatore ma senza successo. quindi chiedo cortesemente se fosse possibile costruire un indicatore che vada a tracciare su un grafico mensile, la linea del massimo e del minimo prezzo relativo all’anno precedente con le linee che vengono disegnate  verso destra fino al mese in corso. Ad esempio per oggi 06/02/2024 vorrei vedere le due linee del max e min relative all’anno 2023.

    Grazie mille in anticipo.

    #227479 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo:

    defparam drawonlastbaronly = true
    ONCE HH  = 0
    ONCE HHp = HH
    ONCE LL  = 999999
    ONCE LLp = LL
    //
    IF OpenYear <> OpenYear[1] THEN
       HHp   = HH
       LLp   = LL
       HH    = high
       LL    = low
       Barra = BarIndex
    ENDIF
    HH = max(HH,high)
    LL = min(LL,low)
    DrawSegment(Barra,HHp,BarIndex+1,HHp)
    DrawSegment(Barra,LLp,BarIndex+1,LLp)
    return

    puoi usarlo su qualunque grafico inferiore all’annuale (Settimanale, Giornaliero, 4 ore, ecc…), purché sul grafico ci siano un numero sufficiente di barre, ad esempio sul grafico orario occorrono almeno 15-16000 unità, sul 5 minuti 5 volte meno, su 1 minuto NON è possibile, perché il massimo numero di unità disponibili è 200000 e corrispondono a poco più di 6 mesi, mentre ti servono praticamente due anni, perché l’anno precedente inizia dall’1/1/2023, ma dovrai stamparlo sul grafico fino al 31/12/2024.

    Ad ogni modo sul mensile non avrai problemi.

    Ho fatto in modo che ti stampi sempre una barra oltre il mese corrente, così vedi meglio le linee. Se non lo desideri, togli +1 nell’istruzione DRAWSEGMENT, se invece ne vuoi vedere di più, sostituisci 1 con 2, 3, ecc…

    #227497 quote
    pignolauspignolaus
    Participant
    Average

    Grazie Roberto, l’ho provato e funziona perfettamente.

    Posso chiedere se fosse possibile anche fare visualizzare il valore delle due linee quindi Min e Max annuale sopra le stesse oppure sulla scala del prezzo?

    Grazie ancora.

    #227576 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo, ti ho anche cambiato la linea, dasegmento a rettangolo, così puoi farla più spessa, aumentando/diminuendo quel +10 e -10.

    Ho aggiunto anche i colori, che puoi cambiare secondo questa tabella https://www.prorealcode.com/documentation/coloured/:

    defparam drawonlastbaronly = true
    ONCE HH  = 0
    ONCE HHp = HH
    ONCE LL  = 999999
    ONCE LLp = LL
    //
    IF OpenYear <> OpenYear[1] THEN
       HHp   = HH
       LLp   = LL
       HH    = high
       LL    = low
       Barra = BarIndex
    ENDIF
    HH = max(HH,high)
    LL = min(LL,low)
    //DrawSegment(Barra,HHp,BarIndex+1,HHp)            coloured("Blue")
    DrawRectangle(Barra,HHP,BarIndex+1,HHP+10*PipSize) coloured("Cyan")    BorderColor("Cyan")
    DrawText("#HHp#",BarIndex + 3,HHp)                 coloured("Fuchsia")
    //DrawSegment(Barra,LLp,BarIndex+1,LLp)            coloured("Blue")
    DrawRectangle(Barra,LLP,BarIndex+1,LLP-10*PipSize) coloured("Cyan")    BorderColor("Cyan")
    DrawText("#LLp#",BarIndex + 3,LLp)                 coloured("Fuchsia")
    return
    x-2.jpg x-2.jpg
Viewing 4 posts - 1 through 4 (of 4 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

Minimo massimo su grafico mensile


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
pignolaus @pignolaus Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 02/06/2024
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...