Bagaimanakah Prestasi dikira dalam Penyaring?

 Prestasi Penyaring dikira mengikut formula berikut:

//@version=4study("Screener Performance") fastSearchN(xs, x) => // xs - sorted, ascending    max_bars_back(xs, 366)    left  = 0    right = min(bar_index,366)    mid = 0    if xs < x        0    else        for i = 0 to 9            mid := ceil((left+right) / 2)            if left == right                break            else if xs[mid] < x                right := mid                continue            else if xs[mid] > x                left := mid                continue            else                break        mid week1 = 7week_ago = timenow - 1000*60*60*24*week1 countOfBarsWeekAgo = fastSearchN(time, week_ago) month1 = 30month_ago = timenow - 1000*60*60*24*month1 countOfBars1MonthAgo = fastSearchN(time, month_ago) month3 = 90months3_ago = timenow - 1000*60*60*24*month3 countOfBars3MonthAgo = fastSearchN(time, months3_ago) month6 = 180months6_ago = timenow - 1000*60*60*24*month6 countOfBars6MonthAgo = fastSearchN(time, months6_ago) weeks52 = 7*52weeks52_ago = timenow - 1000*60*60*24*weeks52 countOfBars52WeekAgo = fastSearchN(time, weeks52_ago)// performancerateOfreturn(v1, v2) => (v1 - v2) * 100 / abs(v2)rr(bb) =>    if bb == 0        na    else        max_bars_back(close, 366)        rof = rateOfreturn(close, close[bb])        rof plot(rr(countOfBarsWeekAgo), title="Perf.W")plot(rr(countOfBars1MonthAgo), title="Perf.1M")plot(rr(countOfBars3MonthAgo), title="Perf.3M")plot(rr(countOfBars6MonthAgo), title="Perf.6M")plot(rr(countOfBars52WeekAgo), title="Perf.Y")var lastYearClose = float(na)if year > year[1]    lastYearClose := close[1]plot(rateOfreturn(close, lastYearClose), title="Perf.YTD")//@version=4study("Screener Performance") fastSearchN(xs, x) => // xs - sorted, ascending    max_bars_back(xs, 366)    left  = 0    right = min(bar_index,366)    mid = 0    if xs < x        0    else        for i = 0 to 9            mid := ceil((left+right) / 2)            if left == right                break            else if xs[mid] < x                right := mid                continue            else if xs[mid] > x                left := mid                continue            else                break        mid week1 = 7week_ago = timenow - 1000*60*60*24*week1 countOfBarsWeekAgo = fastSearchN(time, week_ago) month1 = 30month_ago = timenow - 1000*60*60*24*month1 countOfBars1MonthAgo = fastSearchN(time, month_ago) month3 = 90months3_ago = timenow - 1000*60*60*24*month3 countOfBars3MonthAgo = fastSearchN(time, months3_ago) month6 = 180months6_ago = timenow - 1000*60*60*24*month6 countOfBars6MonthAgo = fastSearchN(time, months6_ago) weeks52 = 7*52weeks52_ago = timenow - 1000*60*60*24*weeks52 countOfBars52WeekAgo = fastSearchN(time, weeks52_ago)// performancerateOfreturn(v1, v2) => (v1 - v2) * 100 / abs(v2)rr(bb) =>    if bb == 0        na    else        max_bars_back(close, 366)        rof = rateOfreturn(close, close[bb])        rof plot(rr(countOfBarsWeekAgo), title="Perf.W")plot(rr(countOfBars1MonthAgo), title="Perf.1M")plot(rr(countOfBars3MonthAgo), title="Perf.3M")plot(rr(countOfBars6MonthAgo), title="Perf.6M")plot(rr(countOfBars52WeekAgo), title="Perf.Y")var lastYearClose = float(na)if year > year[1]    lastYearClose := close[1]plot(rateOfreturn(close, lastYearClose), title="Perf.YTD")
Java

Nota: nilai skrip ini adalah berbeza di sejarah dan masa nyata kerana timenow, rujuk https://www.tradingview.com/pine-script-docs/en/v4/essential/Indicator_repainting.html 

Untuk paparan visual, anda boleh menambahkan skrip kepada carta anda melalui Editor Pine dengan menggunakan rangka masa harian. Sebuah penunjuk akan muncul di carta di mana plot akan menunjukkan nila setiap jenis pretasi.