barra specifica in base alla data

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #222238 quote
    Alessandro Furlani
    Participant
    Average

    Come faccio a  individuare un barra specifica in base alla data che mi viene in input ?

    L’input è su grafico giornaliero, ad esempio ho un grafico che copre da 1 Agosto 2023 a oggi e voglio posizionarmi con il codice sulla barra del 5 Settembre, avendo in inputo la seguente sequenza DataBar = 05092023.

     

    Grazie

    #222241 quote
    robertogozzi
    Moderator
    Master

    Occorre andare a ritroso finché non trovi la data esatta:

    DEFPARAM DrawOnLastBarOnly = True
    //DataBar = 20230801
    FOR i = 0 TO BarIndex
       IF OpenDate[i] = DataBar THEN
          Offset = average[20,0](range[i])
          Break
       ENDIF
    NEXT
    IF i < BarIndex THEN
       DrawArrow(BarIndex[i],high[i] + Offset) coloured("Fuchsia",255)
    ENDIF
    RETURN
    Il-Mio-Indicatore7.itf x-1.jpg x-1.jpg
    #222252 quote
    Alessandro Furlani
    Participant
    Average

    Occorre andare a ritroso finché non trovi la data esatta:


    Ah, OK la stavo facendo con la While ma è uguale. A questo punto se voglio sapere  High o Low di quella barra mi basta scriver High[i], corretto ?

    #222280 quote
    robertogozzi
    Moderator
    Master

    Esatto, i è l’indice della candela.

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

barra specifica in base alla data


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Summary

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

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