massimi e minimi candela delle 14:00 + massimi e minimi premercato

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #207504 quote
    EnricoEnrico
    Participant
    New

    Buon giorno avrei bisogno di un indicatore che mi traccia due linee ( una di massimi e una di minimi) della candela delle 14:00 e altre due linee ( di massimi e minimi) del periodo che va dalle 14:00 alle 15:29.

    Se è possibile senza effetto scaletta. Grazie.

    #207514 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo:

    DEFPARAM DrawOnLastBarOnly = True
    IF OpenTime = 140000 THEN
       HH1  = high
       LL1  = low
       HH2  = high
       LL2  = low
       Bar1 = BarIndex
       Bar2 = BarIndex
    ENDIF
    IF (OpenTime > 140000) AND (OpenTime <= 152900) THEN
       HH1 = max(HH2,high)
       LL2 = min(LL2,low)
    ENDIF
    DrawSegment(Bar1,HH1,BarIndex,HH1)    coloured("DodgerBlue")
    DrawSegment(Bar1,LL1,BarIndex,LL1)    coloured("DodgerBlue")
    IF HH2 <> HH1 THEN
       DrawSegment(Bar2,HH2,BarIndex,HH2) coloured("MediumOrchid")
    ENDIF
    IF LL2 <> LL1 THEN
       DrawSegment(Bar2,LL2,BarIndex,LL2) coloured("MediumOrchid")
    ENDIF
    RETURN
    #207524 quote
    EnricoEnrico
    Participant
    New

    Massimi e minimi della candela delle 14:00 li disegna,

    però disegna solo i minimi del periodo dalle 14:00 alle 15:29 e mi servono anche i massimi.

    In più mi servirebbe che l’indicatore disegna le linee solo fino le 22:00 e anche nello storico per fare backtest. Grazie.

    #207571 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Si, c’era un errore alla riga 11.

    Adesso stampa correttamente Massimi e Minimi. Ovviamente quelli tra le 14 e le 15:29 li stampa solo quando sono diversi da quelli delle 14 (i colori non possono sovrapporsi).

    Con la riga 1 commentata ti stampa anche i dati precedenti. Se vuoi visulaizzare solo l’ultime righe togli i commenti:

    //DEFPARAM DrawOnLastBarOnly = True
    IF OpenTime = 140000 THEN
       HH1  = high
       LL1  = low
       HH2  = high
       LL2  = low
       Bar1 = BarIndex
       Bar2 = BarIndex
    ENDIF
    IF (OpenTime > 140000) AND (OpenTime <= 152900) THEN
       HH2 = max(HH2,high)
       LL2 = min(LL2,low)
    ENDIF
    IF OpenTime >= 140000 THEN
       IF OpenTime <= 220000 THEN
          DrawSegment(Bar1,HH1,BarIndex,HH1)    coloured("DodgerBlue")
          DrawSegment(Bar1,LL1,BarIndex,LL1)    coloured("DodgerBlue")
          IF HH2 <> HH1 THEN
             DrawSegment(Bar2,HH2,BarIndex,HH2) coloured("MediumOrchid")
          ENDIF
          IF LL2 <> LL1 THEN
             DrawSegment(Bar2,LL2,BarIndex,LL2) coloured("MediumOrchid")
          ENDIF
       ENDIF
    ENDIF
    RETURN
    #207581 quote
    EnricoEnrico
    Participant
    New

    Ottimo!

    Grazie mille!

Viewing 5 posts - 1 through 5 (of 5 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

massimi e minimi candela delle 14:00 + massimi e minimi premercato


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Enrico @ocirne Participant
Summary

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

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