Trend levels Indicator conversion

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #242180 quote
    eugenio
    Participant
    New

    I need to convert from the traidingview platform to Probuilder. I’m attaching the script in word.

    #242187 quote
    robertogozzi
    Moderator
    Master

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.

    I moved it from the Spanish forum.

    Thanks 🙂

    #242374 quote
    Iván González
    Moderator
    Master
    //---------------------------------------------------//
    //PRC TrendLevels
    //version = 0
    //10.01.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //---------------------------------------------------//
    // inputs
    //---------------------------------------------------//
    length=30
    atr=averagetruerange[14](close)
    //---------------------------------------------------//
    // Highest and Lowest values
    //---------------------------------------------------//
    hi=highest[length](high)
    lo=lowest[length](low)
    //---------------------------------------------------//
    // Trend direction calculation
    //---------------------------------------------------//
    if hi=high then
    trend=1
    elsif lo=low then
    trend=-1
    endif
    //---------------------------------------------------//
    // Indicator calculation
    //---------------------------------------------------//
    if trend <> trend[1] then
    bars=1
    a=0
    if trend=1 then
    drawarrowUp(barindex,low-atr)coloured("lime")
    elsif trend=-1 then
    drawarrowdown(barindex,high+atr)coloured("fuchsia")
    endif
    else
    bars=bars+1
    a=255
    endif
    
    if bars>0 then
    h1=highest[bars](high)
    l1=lowest[bars](low)
    m1=(h1+l1)/2
    endif
    //---------------------------------------------------//
    // Last levels
    //---------------------------------------------------//
    if islastbarupdate then
    drawsegment(barindex,h1,barindex+10,h1)coloured("lime",a)
    drawsegment(barindex,l1,barindex+10,l1)coloured("fuchsia",a)
    drawsegment(barindex,m1,barindex+10,m1)coloured("grey",a)style(dottedline3)
    drawtext("#h1#",barindex+10,h1+0.5*atr)coloured("lime",a)
    drawtext("#l1#",barindex+10,l1+0.5*atr)coloured("fuchsia",a)
    drawtext("#m1#",barindex+10,m1+0.5*atr)coloured("grey",a)
    endif
    //---------------------------------------------------//
    return h1 coloured("lime",a), l1 coloured("fuchsia",a), m1 coloured("grey",a)style(dottedline3)
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Trend levels Indicator conversion


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Iván González
1 year ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/05/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...