Bollinger %B su HA

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #98984 quote
    Hendrix
    Participant
    Senior

    Buongiorno,

    è possibile avere un indicatore che disegni le candele HA in verde se il valore dell’indicatore Bollinger % B con valori valori 20.2 è maggiore di 50 e in rosso se il valore è minore di 50 e sempre in viola se l’indicatore è maggiore di 100 e -100.

     

    Grazie

     

    Saluti

    #99062 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    //DEFPARAM CalculateOnLastBars = 1000
    // definizione delle candele HA
    if barindex > 1 then
       xClose  = (open+close+low+high)/4    //TotalPrice
       xOpen   = (xOpen[1]+xClose[1])/2
       haHigh  = Max(xOpen, xClose)
       haLow   = Min(xOpen, xClose)
       xHigh   = Max(High,haHigh)
       xLow    = Min(Low,haLow)
       //xRange  = abs(xClose - xOpen)
    else
       xClose  = (open+close+low+high)/4    //TotalPrice
       xOpen   = (Open[1]+Close[1])/2
       haHigh  = Max(xOpen, xClose)
       haLow   = Min(xOpen, xClose)
       xHigh   = Max(High,haHigh)
       xLow    = Min(Low,haLow)
       //xRange  = abs(xClose - xOpen)
    endif
    // Bollinger BB%
    p       = 20
    dev     = 2.0
    BollInf = Average[p,0](xclose) - (dev * std[p](xclose))
    BollSup = Average[p,0](xclose) + (dev * std[p](xclose))
    pB      = ((xclose - BollInf) / (BollSup - BollInf)) * 100
    //
    // colore VIOLA per difetto
    r = 186
    g = 85
    b = 211
    // Visibilità massima
    a = 255
    //
    IF pB <= 100 AND pB > 50 THEN
       r = 0
       g = 128                                //Verde
       b = 0
    ELSIF pB >= -100 AND pB <= 50 THEN
       r = 255                                //Rosso
       g = 0
       b = 0
    ENDIF
    DRAWCANDLE(xOpen,xHigh,xLow,xClose) coloured(r,g,b,a)
    return
    x-13.jpg x-13.jpg
    #102639 quote
    Hendrix
    Participant
    Senior

    Buongiorno,

    è possibile settare con gli stessi parametri anche sulle candele normali di prezzo l’indicatore?

     

    Grazie

     

    Saluti

    #102641 quote
    Nicolas
    Keymaster
    Master

    Puoi farlo da solo aggiungendo l’indicatore sul prezzo 🙄

    #102644 quote
    Hendrix
    Participant
    Senior

    Ci sono sempre le Heikin Ashi sullo sfondo che danno fastidio!

     

    Saluti

    #102645 quote
    robertogozzi
    Moderator
    Master

    Se vuoi usare l’indicatore per le normali candele togli le linee 1-19, poi togli le “x” dai riferimenti a CLOSE, OPEN, HIGH, LOW.

    #102646 quote
    Hendrix
    Participant
    Senior

    Grazie Roberto come sempre per l’aiuto dato !

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

Bollinger %B su HA


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Hendrix @hendrix Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by Hendrix
6 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 05/21/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...