Tracciare linee del T.F. Weekly nel Daily

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

    Salve, chiedo gentilmente aiuto, non riesco a tracciare le linee del T.F. Weekly (con ATR Weekly) nel grafico Daily.

    GRAZIE

    defparam drawonlastbaronly = true
    
    //timeframe(daily)
    atr=ROUND((AverageTrueRange[14](close)[1]),3)
    
    //Timeframe(default)
    TF = GetTimeFrame
    IF TF = 86400 THEN // Day
    upperlvl = floor(dlow(0)+atr,decimals)
    lowerlvl = floor(dhigh(0)-atr,decimals)
    drawsegment(barindex+1,upperlvl,barindex+4,upperlvl) style(line,3) COLOURED(255,0,255,255)
    drawsegment(barindex+1,lowerlvl,barindex+4,lowerlvl) style(line,3) COLOURED(255,0,255,255)
    ENDIF
    
    IF TF = 604800 THEN // Week
    upperlvl = floor(dlow(0)+atr,decimals)
    lowerlvl = floor(dhigh(0)-atr,decimals)
    drawsegment(barindex+1,upperlvl,barindex+4,upperlvl) style(line,3) COLOURED(255,0,255,255)
    drawsegment(barindex+1,lowerlvl,barindex+4,lowerlvl) style(line,3) COLOURED(255,0,255,255)
    ENDIF
    
    return
    
    #227199 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Questo ti stampa i dati con l’Atr Weekly ed i prezzi Daily, e puoi usarlo su ogni TF dal Daily in giù (Daily, 4 ore, 1 ora,…. 1 minuto,…):

    defparam drawonlastbaronly = true
    
    timeframe(Weekly)
    atr=ROUND((AverageTrueRange[14](close)[1]),3)
    
    Timeframe(Daily)
    upperlvl = floor(low+atr,1)
    lowerlvl = floor(high-atr,1)
    
    Timeframe(default)
    drawsegment(barindex+1,upperlvl,barindex+4,upperlvl) style(line,3) COLOURED(255,0,255,255)
    drawsegment(barindex+1,lowerlvl,barindex+4,lowerlvl) style(line,3) COLOURED(255,0,255,255)
    
    return
    #232769 quote
    EdisoneEdisone
    Participant
    Average

    Ciao riprendo la discussione, l’ultimo codice postato non mi funziona nei time frame inferiori al daily es. 30 minuti.

    Allego nuovo codice, il problema è che non calcola il valore di ATRD riferito al t.f. daily!

    Grazie

     

    defparam drawonlastbaronly = true
    
    TIMEFRAME(Daily)
    ATRD = (AverageTrueRange[14](close)[1])
    
    Timeframe(default)
    upperlvl = (Dlow(0)+ ATRD) 
    lowerlvl = (Dhigh(0)-ATRD)
    drawsegment(barindex+1,upperlvl,barindex+4,upperlvl) style(line,2) COLOURED(255,0,255,255)
    drawsegment(barindex+1,lowerlvl,barindex+4,lowerlvl) style(line,3) COLOURED(255,0,255,255)
    
    DRAWTEXT("ATR =#ATRD#" ,barindex+8,Dlow(0),SansSerif,Bold,12)
    
    return
    #232773 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Questo è il mio ultimo codice, con alcune variazioni in modo che funzioni anche con i timeframe intraday (purché sul grafico ci sia un numeri di unità sufficienti a fare i calcoli del settimanale). Io l’ho provato sia sul Daily che su 4 ore, 1 ora e 15 minuti (quest’ultimo necessita di circa 10K unità per funzionare).

    Una delle variazioni che ho fatto è stata quella di togliere il numero dei decimali per gli arrotondamenti:

    defparam drawonlastbaronly = true
    
    timeframe(Weekly,UpdateOnClose)
    atr=ROUND((AverageTrueRange[14](close)[1]))
    
    Timeframe(default)
    upperlvl = floor(low+atr,1)
    lowerlvl = floor(high-atr,1)
    
    drawsegment(barindex+1,upperlvl,barindex+4,upperlvl) style(line,3) COLOURED(255,0,255,255)
    drawsegment(barindex+1,lowerlvl,barindex+4,lowerlvl) style(line,3) COLOURED(255,0,255,255)
    
    return

    Quanto al tuo ultimo codice, mettendo 24h al posto di Daily, con l’aggiunta di updateonclose, si ottiene un valore che diifferisce di solo qualche decimale:

    defparam drawonlastbaronly = true
    
    TIMEFRAME(24h,updateonclose)
    ATRD = AverageTrueRange[14](close)[1]
    
    Timeframe(default)
    
    upperlvl = (Dlow(0)+ ATRD)
    lowerlvl = (Dhigh(0)-ATRD)
    drawsegment(barindex+1,upperlvl,barindex+4,upperlvl) style(line,2) COLOURED(255,0,255,255)
    drawsegment(barindex+1,lowerlvl,barindex+4,lowerlvl) style(line,3) COLOURED(255,0,255,255)
    
    DRAWTEXT("ATR =#ATRD#" ,barindex+8,Dlow(0),SansSerif,Bold,12)
    
    return

    non conosco il motivo di tali differenze, anche se lievi e del perché non funzioni con DAILY, credo sia opportuno che tu chieda all’assistenza PRT, premendo Ctrl+M dalla piattaforma o telefonandogli.

    Edisone thanked this post
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

Tracciare linee del T.F. Weekly nel Daily


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Edisone @edisone Participant
Summary

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

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