Pivot Lines Trading view code conversion

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #204235 quote
    nitinvijayranenitinvijayrane
    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)
    Capture-2.png Capture-2.png
    #204263 quote
    NicolasNicolas
    Keymaster
    Legend

    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.
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

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 NicolasNicolas
3 years, 10 months ago.

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