Apertura Mese Corrente In TF Daily

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #206926 quote
    byT77
    Participant
    New

    Salve a tutti, in primis Auguri di Buon Anno.

    Necessito di un piccolo aiuto.

    Come posso identificare il prezzo dell’apertura appartenente alla prima candela del mese corrente?

    Ringrazio anticipatamente

    #206995 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    ONCE Flip         = 0
    ONCE AperturaMese = open
    IF OpenMonth <> OpenMonth[1] THEN
       AperturaMese = open
    ENDIF
    Scarto    = (BarIndex MOD 6) / 3
    Flip      = abs(Flip - 1)
    Distanza  = average[100,0](range)
    Scarto    = range * Scarto
    Prezzo    = high + Distanza + Scarto
    IF Flip = 0 THEN
       Prezzo = low - Distanza - Scarto
    ENDIF
    DrawText("#AperturaMese#",BarIndex,Prezzo,dialog,bold,10) coloured("Green")
    RETURN

    Grazie e Felice 2023 anche a te! 🙂

    #207003 quote
    byT77
    Participant
    New

    Grazie mille.

    Gentile come sempre.

    Buon proseguimento

    #207006 quote
    byT77
    Participant
    New

    Mi perdoni,

    Avrei un piccolo problema.

    Vorrei creare un segmento che abbia come punto di origine, l’apertura del mese. Ho provato con:

    If OL then //OL sta per apertura mese
    drawsegment(barindex,AperturaMese,barindex+30,AperturaMese)coloured(30,144,255)style(dottedline,2)
    endif

    L’esito è come nell’immagine allegata.

    Come posso correggere questo errore?

    Grazie mille

    IM01.jpg IM01.jpg
    #207010 quote
    byT77
    Participant
    New

    Così è più chiara

    IM01-1.jpg IM01-1.jpg
    #207061 quote
    robertogozzi
    Moderator
    Master

    Per favore NON duplicare it tuoi post. Poni la tua domanda solo una volta e solo in un forum. Tutti i doppi post verranno comunque eliminati, quindi pubblicare più volte la stessa domanda ti farà perdere tempo e non ti farà avere una risposta più velocemente. Il doppio post crea solo confusione nei forum.

    Grazie 🙂

    #207064 quote
    byT77
    Participant
    New

    Chiedo Venia,

    Sara mia premura rispettare le regole del forum.

    Resto in vigile attesa per il gentile supporto.

     

    Grazie

    #207092 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    DEFPARAM DrawOnLastBarOnly = True //per vedere anche le linee precedenti, commentare tutta la riga (o rimuoverla)
    ONCE BarreFuture  = 0             //se <0 sposta la linea all'indietro, se >0 la estende verso il futuro
    ONCE AperturaMese = open
    ONCE Barra        = 0
    IF OpenMonth <> OpenMonth[1] THEN
       AperturaMese = open
       Barra        = BarIndex
    ENDIF
    DrawSegment(Barra,AperturaMese,BarIndex + BarreFuture,AperturaMese) style(DottedLine,3) coloured("Cyan") //Spessore tra 1 e 5
    RETURN
    #207108 quote
    byT77
    Participant
    New

    Grazie mille Roberto.

     

    Buon proseguimento

    #207198 quote
    byT77
    Participant
    New

    Gentile Roberto,

    Vorrei che il segmento disegnato avendo come punto di origine AperturaMese, abbia una dimensione di 30 barre Giornaliere. Vuol dire che, con un time frame inferiore, io non mi ritrovi con 30 barre a 4h.

    Grazie in anticipo

    #207211 quote
    robertogozzi
    Moderator
    Master

    Com’è adesso stampa fino alla fine del mese, poi ricomincia con un nuovo segmento, indipendentemente dal timeframe.

    Se vuoi vedere TUTTA la lunghezza del segmento fino a fine mese:

    DEFPARAM DrawOnLastBarOnly = True //per vedere anche le linee precedenti, commentare tutta la riga (o rimuoverla)
    ONCE AperturaMese = open
    ONCE FineMese     = (OpenYear * 10000) + (OpenMonth * 100) + 31
    ONCE Barra        = 0
    IF OpenMonth <> OpenMonth[1] THEN
       AperturaMese = open
       Barra        = BarIndex
       FineMese     = (OpenYear * 10000) + (OpenMonth * 100) + 31
    ENDIF
    DrawSegment(Barra,AperturaMese,DateToBarIndex(FineMese),AperturaMese) style(DottedLine,3) coloured("Cyan") //Spessore tra 1 e 5
    RETURN
    #207226 quote
    byT77
    Participant
    New

    Perfetto.

     

    Grazie e gentile come sempre.

    #207230 quote
    byT77
    Participant
    New

    Gent. Roberto,

    Un altro piccolo favore.

    Come può vedere nelle immagini allegate, vorrei risolvere un piccolo problema.

    Seguendo le indicazioni da lei descritte in precedenza, il mio indicatore lavora alla perfezione.

    Vorrei aggiungere nel codice, una variante che fissi la distanza dalla fine del mese a un testo o un valore, così da lasciare invariate alcune indicazioni, se il time frame è inferiore al DAILY.

    Grazie

    TF1D.jpg TF1D.jpg TF4H.jpg TF4H.jpg
    #207253 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    DEFPARAM DrawOnLastBarOnly = True //per vedere anche le linee precedenti, commentare tutta la riga (o rimuoverla)
    ONCE AperturaMese = open
    ONCE FineMese     = (OpenYear * 10000) + (OpenMonth * 100) + 31
    ONCE Barra        = 0
    IF OpenMonth <> OpenMonth[1] THEN
       AperturaMese = open
       Barra        = BarIndex
       FineMese     = (OpenYear * 10000) + (OpenMonth * 100) + 31
       Anno         = OpenYear
       Mese         = OpenMonth + 1
       IF Mese = 13 THEN
          Mese = 1
          Anni = Anno + 1
       ENDIF
       DopoFineMese = (Anno * 10000) + (Mese * 100) + 5
    ENDIF
    DrawSegment(Barra,AperturaMese,DateToBarIndex(FineMese),AperturaMese) style(DottedLine,3) coloured("Cyan") //Spessore tra 1 e 5
    DrawText("ABCDEFGHI.....",DateToBarIndex(DopoFineMese),AperturaMese,Dialog,Bold,15) coloured("Red")
    RETURN
    #207254 quote
    byT77
    Participant
    New

    Grazie mille.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.

Apertura Mese Corrente In TF Daily


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
byT77 @byt77 Participant
Summary

This topic contains 14 replies,
has 2 voices, and was last updated by byT77
3 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 01/06/2023
Status: Active
Attachments: 4 files
Logo Logo
Loading...