trend lines su indicatore

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #121057 quote
    chicco
    Participant
    Average

    Buongiorno,

    sono neofita sulla programmazione di indicatori con PRT.

    E’ possibile programmare uno strumento che tracci le trend line di un indicatore( ad esempio RSI) nella stessa maniera in cui lo fa ProReal Trend sul grafico dei prezzi?

    Grazie mille in anticipo

    Chiccone

    #121068 quote
    Nicolas
    Keymaster
    Master

    Stai parlando di una linea di tendenza obliqua?

    #121093 quote
    chicco
    Participant
    Average

    Si una trend line obliqua che unisca minimi o massimi dell’indicatore

    Grazie

    chiccone

    #121218 quote
    Nicolas
    Keymaster
    Master

    ok, ecco un esempio con un RSI: disegna una linea di tendenza sugli ultimi top e bottom, puoi controllare i periodi regolando l'impostazione "lookback".

    defparam drawonlastbaronly = true
    
    //---settings 
    lookback = 10
    showSR = 0
    //---
    
    i = rsi[14](close)
    
    //fractals
    cp = lookback
    if i[cp] >= highest[(cp)*2+1](i) then
    LLH = 1
    else
    LLH = 0
    endif
    
    if i[cp] <= lowest[(cp)*2+1](i)  then
    LLL = -1
    else
    LLL = 0
    endif
    
    if LLH = 1 then
    oldLTOPy = LTOPy[1]
    oldLTOPx = LTOPx[1]
    LTOPy = i[cp]//high[cp]
    LTOPx = barindex[cp]
    endif
    
    if LLL = -1 then
    oldLBOTy = LBOTy[1]
    oldLBOTx = LBOTx[1]
    LBOTy = i[cp]//low[cp]
    LBOTx = barindex[cp]
    endif
    
    //trend line
    DRAWLINE(oldLTOPx,oldLTOPy,LTOPx,LTOPy)coloured(112,169,161)
    DRAWLINE(oldLBOTx,oldLBOTy,LBOTx,LBOTy)coloured(211,78,36)
    
    //support/resistance
    if showSR then
    DRAWHLINE(LTOPy) COLOURED(207,215,199,100)
    DRAWHLINE(LBOTy) COLOURED(207,215,199,100)
    endif
    
    RETURN i
    
    RSI-trendlines.png RSI-trendlines.png
    #121225 quote
    chicco
    Participant
    Average

    Grazie mille

    #122117 quote
    chicco
    Participant
    Average

    Ciao Nicolas,

    scusa la domanda( forse potrà sembrare poco intelligente ma ha un suo perchè):

    se volessi disegnare le linee che uniscono solo i massimi decrescenti o i minimi crescenti, cambia qualcosa nella formula?

    Grazie

    Chiccone

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

trend lines su indicatore


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
chicco @chicco Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by chicco
6 years ago.

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