كيف يتم حساب الأداء في منصة الفلترة Screener ؟

يتم حساب بيانات أداء منصة الفلترة باستخدام الصيغة:

//@version=5
indicator(title="Screener Performance")
fastSearchN(_xs, x, maxbarsback) =>  // xs - sorted, ascending
	xs = _xs
	if bar_index == 0
		xs += xs[maxbarsback] * 0  // max_bars_back
	left = 0
	right = math.min(bar_index, maxbarsback)
	mid = 0
	if xs < x
		0
	else
		for i = 0 to 9 by 1
			mid := math.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
years5 = 365 * 4 + 366
years5_ago = timenow - 1000 * 60 * 60 * 24 * years5
countOfBars5YearAgo = fastSearchN(time, years5_ago, years5)
weeks52 = 7 * 52
weeks52_ago = timenow - 1000 * 60 * 60 * 24 * weeks52
countOfBars52WeekAgo = fastSearchN(time, weeks52_ago, weeks52)
month6 = 180
months6_ago = timenow - 1000 * 60 * 60 * 24 * month6
countOfBars6MonthAgo = fastSearchN(time, months6_ago, month6)
month3 = 90
months3_ago = timenow - 1000 * 60 * 60 * 24 * month3
countOfBars3MonthAgo = fastSearchN(time, months3_ago, month3)
month1 = 30
month_ago = timenow - 1000 * 60 * 60 * 24 * month1
month_ago_this_bar = time - 1000 * 60 * 60 * 24 * month1
countOfBars1MonthAgo = fastSearchN(time, month_ago, month1)
countOfBars1MonthAgoThisBar = fastSearchN(time, month_ago_this_bar, month1)
week1 = 7
week_ago = timenow - 1000 * 60 * 60 * 24 * week1
week_ago_this_bar = time - 1000 * 60 * 60 * 24 * week1
countOfBarsWeekAgo = fastSearchN(time, week_ago, week1)
countOfBarsWeekAgoThisBar = fastSearchN(time, week_ago_this_bar, week1)

// performance
rateOfreturn(v1, v2) =>
	(v1 - v2) * 100 / math.abs(v2)
rr(_bb, maxbarsback) =>
	bb = _bb
	if bar_index == 0
		bb += math.round(open[maxbarsback] * 0)  // max_bars_back
	if bb == 0
		na
	else
		rof = rateOfreturn(close, open[bb])
		rof
plot(rr(countOfBarsWeekAgo, week1), title="Perf.W")
plot(rr(countOfBars1MonthAgo, month1), title="Perf.1M")
plot(rr(countOfBars3MonthAgo, month3), title="Perf.3M")
plot(rr(countOfBars6MonthAgo, month6), title="Perf.6M")
plot(rr(countOfBars52WeekAgo, weeks52), title="Perf.Y")
plot(rr(countOfBars5YearAgo, years5), title="Perf.5Y")
var lastYearOpen = open
if year > year[1]
	lastYearOpen := open[1]
plot(rateOfreturn(close, lastYearOpen), title="Perf.YTD")
J

 ملاحظة: تختلف قيم هذا البرنامج النصي في التاريخ والوقت الفعلي بسبب الوقت ، انظر

https://www.tradingview.com/pine-script-docs/en/v4/essential/Indicator_repainting.html

بالنسبة للعرض المرئي، يمكنك إضافة هذا البرنامج النصي إلى الرسم البياني الخاص بك من خلال محرر Pine باستخدام الإطار الزمني اليومي للمخطط. سيظهر مؤشر على الرسم البياني ، ستُظهر مخططاته القيم لكل نوع من أنواع الأداء.

التغيير٪ مقابل الأداء٪: 

لنفترض أن اليوم هو الثلاثاء. التغيير الأسبوعي يحسب الفرق بين الإغلاق الحالي (الثلاثاء) والإغلاق من الأسبوع الماضي (سعر الإغلاق ليوم الجمعة السابقة). الأداء الأسبوعي يحسب الفرق بين الإغلاق الحالي (الثلاثاء) والإغلاق من أسبوع مضى بالضبط (الثلاثاء السابق).