Disegnare linee orizzontali dinamiche

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #215763 quote
    CarburoCarburo
    Participant
    Junior
    Buongiorno, il sintetico codice che segue disegna due linee orizzontali in corrispondenza del massimo e del minimo dell’apertura (fascia oraria tra le 9 e le 10).  I due livelli vengono disegnati anche per le sessioni precedenti e le linee di ogni sessione sono collegate a quelle della sessione precedente con linee diagonali.
    Per imparare come disegnare le linee alleggerendo il grafico, vorrei capire come fare per far partire le due linee, quella superiore e quella inferiore, rispettivamente dal massimo e dal minimo fatti tra le 9-10, e far terminare le linee a un orario specifico, per esempio le 21.00, oppure a chiusura giornaliera del mercato.

    Chiedo scusa per la probabile banalità della domanda e per non riuscire a inserire il codice in modo appropriato.

    Grazie mille.
    if time<090000 then
    sup=high
    inf=low
    elsif time>=090000 and time<=100000 then
    sup=max(high,sup)
    inf=min(low,inf)
    delta=(sup-inf)
    else
    HE=sup
    LE=inf
    endif

    return HE as “H-Edge”, LE as “L-Edge”

    #215769 quote
    CarburoCarburo
    Participant
    Junior

    …ovvimente i due come del comando return sono da intendere as.

    Scusate.

    #215803 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Questo stampa i dati solo dalle 10 alle 18, però vedi sempre lo scalino:

    if time<090000 then
       sup=high
       inf=low
    elsif time>=090000 and time<=100000 then
       sup=max(high,sup)
       inf=min(low,inf)
       delta=(sup-inf)
    else
       HE=sup
       LE=inf
    endif
    t = 0
    IF Time >= 100000 AND Time <= 180000 THEN
       t = 255
    ENDIF
    return HE as "H-Edge" coloured("Blue",t), LE as "L-Edge" coloured("Red",t)

    perché con RETURN non si può evitare.

    Questa versione usa, invece, i comandi grafici, quindi lo scalino NON si vede:

    once Barra  = 0
    ONCE Inizio = 0
    if time<090000 then
       sup=high
       inf=low
    elsif time>=090000 and time<=100000 then
       Barra = Barindex
       IF Barra <> Barra[1] THEN
          Inizio = Barra
       ENDIF
       sup=max(high,sup)
       inf=min(low,inf)
       delta=(sup-inf)
    else
       HE=sup
       LE=inf
    endif
    IF Time > 100000 AND Time <= 180000 THEN
       DrawSegment(Inizio,HE,BarIndex,HE) coloured("Blue",255) style(line,2)
       DrawSegment(Inizio,LE,BarIndex,LE) coloured("Red",255)  style(line,2)
    ENDIF
    return
    Carburo thanked this post
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

Disegnare linee orizzontali dinamiche


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Carburo @carburo Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 06/07/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...