Conversion indicateur Zone Shift

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #253358 quote
    GigiGigi
    Participant
    Senior

    Bonjour,

    ci joint un indicateur Tradingview à convertir. Par avance, merci.

    ZONE-SHIFT.docx
    #253365 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Voici:

    // ------------------------------------------------------
    //PRC_Zone Shift [ChartPrime]
    //version = 1
    //06.11.2025
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    // ------------------------------------------------------
    // inputs
    // ------------------------------------------------------
    per = 100 // Length 60-200 / minval = 60, maxval = 200
    if per >200 then
    length=200
    elsif per <60 then
    length=60
    else
    length=per
    endif
    colorCandles=1
    atr=averagetruerange[14](close)
    // ------------------------------------------------------
    // Indicator calculations
    // ------------------------------------------------------
    once trend = 0
    once trendStart = 0
    once lastRetest = 0
    
    ema= average[length,1](close)
    hma= average[max(20,length-40),8](close)
    dist=average[200](high-low)
    mid = (ema+hma)/2
    itop = mid+dist
    ibot = mid-dist
    
    if low > itop and low[1] < itop[1] and not trend then
    trend=1
    trendStart=low
    r=0
    g=255
    b=0
    endif
    
    if high < ibot and high[1] > ibot[1] and trend then
    trend=0
    trendStart=high
    r=255
    g=0
    b=0
    endif
    
    // Retest TrendStart Level
    
    if (close > trendStart and close[1] < trendStart[1] or low > trendStart and low[1] <trendStart[1]) and trend and barindex-lastRetest>5 then
    lastRetest=barindex
    drawtext("⯁",barindex,low-0.2*atr)coloured("green",150)
    endif
    
    if (close[1]>trendStart and close<trendStart[1] or high[1]>trendStart and high<trendStart[1]) and not trend and barindex-lastRetest>5 then
    lastRetest=barindex
    drawtext("⯁",barindex,high+0.2*atr)coloured("red",150)
    endif
    // ------------------------------------------------------
    // PLOT
    // ------------------------------------------------------
    if colorcandles then
    drawcandle(open,high,low,close)coloured(r,g,b)
    endif
    // ------------------------------------------------------
    return mid as "Middle"style(dottedline), itop as "Top" coloured("blue"), ibot as "Bottom"coloured("blue")
    
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

TradingView to ProRealTime Translation Center

New Reply
Author
author-avatar
Gigi @gigi Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
10 months, 2 weeks ago.

Topic Details
Forum: TradingView to ProRealTime Translation Center Forum
Started: 11/06/2025
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...