backgroundcolor tra 2 linee

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #226567 quote
    EdisoneEdisone
    Participant
    Average

    Salve, non riesco ad utilizzare backgroundcolor tra le due linee generate dal codice.

    Grazie

     

    defparam drawonlastbaronly = true
    
    atr=ROUND((AverageTrueRange[20](close)[1]),3)
    
    TF = GetTimeFrame
    IF TF = 86400 THEN // Day
    upperlvl = floor(dlow(0)+atr,decimals)
    lowerlvl = floor(dhigh(0)-atr,decimals)
    drawsegment(barindex,upperlvl,barindex+3,upperlvl) style(dottedline,2)
    drawsegment(barindex,lowerlvl,barindex+3,lowerlvl) style(dottedline,2)
    drawtext("#upperlvl#",barindex+6,upperlvl, Dialog,Standard,10)
    drawtext("#lowerlvl#  #atr#" ,barindex+7,lowerlvl, Dialog,Standard ,10)
    ENDIF
    
    IF TF = 604800 THEN // Week
    upperlvl = floor(dlow(0)+atr,decimals)
    lowerlvl = floor(dhigh(0)-atr,decimals)
    drawsegment(barindex,upperlvl,barindex+3,upperlvl) style(dottedline,2)
    drawsegment(barindex,lowerlvl,barindex+3,lowerlvl) style(dottedline,2)
    drawtext("#upperlvl#",barindex+7,upperlvl, Dialog,Standard,10)
    drawtext("#lowerlvl#  #atr#" ,barindex+8,lowerlvl, Dialog,Standard,10)
    ENDIF
    return
    #226576 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Il BACKGROUNDCOLOR setta il colore dell’intera porzione di grafico della candela corrente, non una sola parte e non per candele arretrate.

    Fino alla v11 si poteva simulare stampando delle CANDELE o BARRE (senza ombre), larghe quanto la distanza. Non era perfetto, ma una buona approssimazione.

    Con la v12 è stata aggiunta l’istruzione COLORBETWEEN, però NON si può limitare alle utime barre ma vale per TUTTO il grafico (mentre le linee seguono defparam drawonlastbaronly = true):

    defparam drawonlastbaronly = true
    
    atr=ROUND((AverageTrueRange[20](close)[1]),3)
    
    TF = GetTimeFrame
    IF TF = 86400 THEN // Day
       upperlvl = floor(dlow(0)+atr,decimals)
       lowerlvl = floor(dhigh(0)-atr,decimals)
       drawsegment(barindex,upperlvl,barindex+3,upperlvl) style(dottedline,2)
       drawsegment(barindex,lowerlvl,barindex+3,lowerlvl) style(dottedline,2)
       drawtext("#upperlvl#",barindex+6,upperlvl, Dialog,Standard,10)
       drawtext("#lowerlvl#  #atr#" ,barindex+7,lowerlvl, Dialog,Standard ,10)
       ColorBetween (upperlvl,lowerlvl,255,0,0,50)
    ENDIF
    
    IF TF = 604800 THEN // Week
       upperlvl = floor(dlow(0)+atr,decimals)
       lowerlvl = floor(dhigh(0)-atr,decimals)
       drawsegment(barindex,upperlvl,barindex+3,upperlvl) style(dottedline,2)
       drawsegment(barindex,lowerlvl,barindex+3,lowerlvl) style(dottedline,2)
       drawtext("#upperlvl#",barindex+7,upperlvl, Dialog,Standard,10)
       drawtext("#lowerlvl#  #atr#" ,barindex+8,lowerlvl, Dialog,Standard,10)
       drawtext("#lowerlvl#  #atr#" ,barindex+7,lowerlvl, Dialog,Standard ,10)
       ColorBetween (upperlvl,lowerlvl,255,0,0,50)
    ENDIF
    return
    Edisone thanked this post
    x-2.jpg x-2.jpg
Viewing 2 posts - 1 through 2 (of 2 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

backgroundcolor tra 2 linee


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Edisone @edisone Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
2 years, 8 months ago.

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