Pivot Lines Trading view code conversion

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #204235 quote
    nitinvijayrane
    Participant
    New
    Hi Guys
    Need some help here, I have Trading view Pine script code which I need converting. I was able to get somewhere close but there is definately something I am missing which is making things little difficult.
    Pine Script
    indicator(“Pivot Lines”, overlay = true)
    source = close
    value = 14
    var plv = 0.0
    var phv = 0.0
    pl= ta.pivotlow(low,value,value)
    ph=ta.pivothigh(high,value,value)
    if(pl!=plv)
        plv:=pl
    if(ph!=phv)
        phv:=ph
    plot(phv, color=color.blue)
    plot(plv, color=color.red)
    #204263 quote
    Nicolas
    Keymaster
    Master

    That’s a Fractal with a custom period, here you go:

    cp = 14
    
    if high[cp] >= highest[2*cp+1](high) then
    LH = 1
    else
    LH=0
    endif
    
    if low[cp] <= lowest[2*cp+1](low)  then
    LL= -1
    else
    LL=0
    endif
    
    if LH=1 then
    hil = high[cp]
    endif
    
    if LL  = -1 then
    LOL=low[cp]
    endif
    
    return hil,lol
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Pivot Lines Trading view code conversion


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
3 years, 2 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/15/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...