bilancio giornaliero di un determinato giorno

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #98585 quote
    remembersremembers
    Participant
    Senior

    Salve, come da topic sto riscontrando un problema nella realizzazione di un indicatore che aggiorni il bilancio (apertura e chiusura di barra) solo di un determinado giorno (d). Inserendo i valori da 0 a 3 (dom-mer). L’indicatore si comporta bene mentre con il valore 4 l’indicatore mi aggiorna sia il giovedì che il venerdì e inserendo il valore 5 (venerdì) l’indicatore sballa….

    // d va da 0 a 5 dom-ven
    a = d + 1
    if (a > 6) then
    valued = 0
    else
    valued = a
    endif
    
    if dayofweek = valued then
    diff = close[0] - open[0]
    bilancio = bilancio + diff
    endif
    
    return bilancio

    Non è ottimizzato perchè sto andando a tentativi….

    #98586 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Usa OpenDayOfWeek invece di DayOfWeek.

    Il primo ti dice il giorno in cui la barra ha aperto, il secondo quello in cui ha chiuso.

    Il secondo, con la barra Giornaliera, oppure l’ultima intraday,  del Giovedì ti segnala che è Venerdì (giorno in cui chiude). Il Venerdì continua a segnalarti Venerdì perché il sabato il trading è chiuso.

    #98632 quote
    remembersremembers
    Participant
    Senior

    Perfetto! Senza usare +1 -1 etc… giusto la d e l’if OpenDayOfWeek e l’aggiornamento bilancio

    thanks

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

bilancio giornaliero di un determinato giorno


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
remembers @remembers Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 05/16/2019
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...