Disegnare Box relativo al Supertrend

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #218556 quote
    StankoStanko
    Participant
    Senior

    Buonasera a tutti,

    vorrei chiedere cortesemente un aiuto per risolvere un problema che non riesco a risolvere:

    creare un Box prendendo in esame il Supertrend.

    In particolare se il Supertrend si “stabilizza” per almeno 5 candele vorrei disegnare un Box che abbia come base (o tetto) la linea del Supertend e come tetto (o base) il massimo (o minimo) della serie di candele in esame.

    Grazie.

     

    Allego esempio

    Box-con-il-Supertrend.png Box-con-il-Supertrend.png
    #218558 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Questo mi sembra vada bene:

    myST = SuperTrend[2,10]
    IF summation[5](myST = myST[1]) = 5 THEN
       Upper = max(myST,highest[5](high))
       Lower = min(myST,lowest[5](low))
       DrawRectangle(BarIndex-4,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0)
    ENDIF
    RETURN
    Stanko thanked this post
    x.jpg x.jpg
    #218560 quote
    StankoStanko
    Participant
    Senior

    Molte grazie Roberto.

    Se possibile vorrei chiederTi se puoi aggiornare il codice:

    se il Supertrend rimane “stabile” per più di 5 candele il Box dovrebbe proseguire fino a quando il Supertrend non cambia inclinazione.

    Il mio problema era questo cioè creare un ciclo che controllasse il Supertrend ad ogni candela.

    Grazie

    #218561 quote
    StankoStanko
    Participant
    Senior

    Scusa Roberto, ho provato a modificare il tuo codice ma non riesco a visualizzare il Box.

    Per cortesia riesci a correggerlo?

    Grazie.

     

    Allego il codice

    myST = SuperTrend[2,10]
    ONCE CONT = 1
    IF summation[CONT](myST = myST[CONT]) THEN
    IF CONT >= 5 then
    Upper = max(myST,highest[CONT](high))
    Lower = min(myST,lowest[CONT](low))
    DrawRectangle(barindex-CONT,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0)
    CONT = CONT + 1
    ELSE
    CONT = CONT + 1
    ENDIF
    ENDIF
    RETURN
    #218933 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ho riscritto il codice così:

    myST = SuperTrend[2,10]
    ONCE CONT = 1
    IF summation[CONT](myST = myST[CONT]) THEN
       IF CONT >= 5 then
          Upper = max(myST,highest[CONT](high))
          Lower = min(myST,lowest[CONT](low))
          DrawRectangle(barindex-CONT,Upper,BarIndex,Lower) coloured("Cyan",90) bordercolor("Red",0)
          CONT = 0
       ENDIF
       CONT = CONT + 1
    ENDIF
    RETURN

    prova se così va bene.

    Stanko thanked this post
    #218956 quote
    StankoStanko
    Participant
    Senior

    Ok grazie.

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

Disegnare Box relativo al Supertrend


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Stanko @stanko Participant
Summary

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

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