barra specifica in base alla data

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

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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 FurlaniAlessandro Furlani
    Participant
    Senior

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
2 years, 11 months ago.

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