OPEN-SOURCE SCRIPT

Sharpe Ratio Screener

1 344
The original code was created by tim_amblard, and the modifications were made by Mr_Rakun for the purpose of adapting the script into a screener format.

The Sharpe ratio is a popular metric used to measure the risk-adjusted return of an asset or portfolio, which allows traders and investors to assess whether the returns they are receiving are worth the risk they are taking. In this script, the Sharpe ratio is calculated over a 180-day period (approximately 6 months), and several valuation zones are defined based on the ratio to help assess whether an asset is overvalued, undervalued, or critically undervalued.

Key Features:
1. Risk-Free Rate Input: The user can define the risk-free rate (usually the return of government bonds or a similar safe asset) for Sharpe ratio calculation.
2. Lookback Period (180 Days): The default lookback period is set to 180 days (approximately 6 months) to calculate the mean and standard deviation of the asset’s daily returns.
3. Valuation Zones:
• Overvalued Zone: If the Sharpe ratio is greater than 5.
• Undervalued Zone: If the Sharpe ratio is between -1 and 5.
• Critically Undervalued Zone: If the Sharpe ratio is below -3.
• Neutral Zone: If the Sharpe ratio does not meet any of the above conditions.
4. Table View: The script pulls a list of symbols from the user (e.g., cryptocurrency or stock tickers) and displays their latest price, Sharpe ratio, and whether they are in an overvalued, undervalued, or neutral zone in a table format.
5. Custom Symbol Input: The user can input a list of symbols (separated by commas) to track.
6. Daily Timeframe Check: The script warns the user to ensure they are using a daily timeframe, as this indicator is designed specifically for it.

How It Works:
• The script calculates the daily returns for each symbol over the specified lookback period.
• It then calculates the mean and standard deviation of the returns to derive the Sharpe ratio.
• The Sharpe ratio is annualized, and it’s compared to the defined thresholds to categorize the symbol into different valuation zones.
• A table is generated on the chart to show the symbols, their current prices, and their Sharpe ratios, with color-coded background to easily identify whether they are overvalued (red), undervalued (green), or critically undervalued (blue).

This tool is useful for screening multiple assets for their Sharpe ratio to find investment opportunities with optimal risk-adjusted returns.

Original code credit: This code was originally written by tim_amblard and modified by Mr_Rakun for use as a screener.

Türkçe Açıklama:

Orijinal kod tim_amblard tarafından yazılmıştır ve Mr_Rakun tarafından, bu script’in tarayıcı formatına dönüştürülmesi amacıyla değiştirilmiştir.

Sharpe oranı, bir varlığın veya portföyün risk düzeltilmiş getirisini ölçmek için yaygın olarak kullanılan bir metriktir. Bu metrik, yatırımcıların aldıkları risk karşılığında aldıkları getirinin ne kadar verimli olduğunu değerlendirmelerine olanak tanır. Bu script’te, Sharpe oranı 180 günlük bir periyot (yaklaşık 6 ay) boyunca hesaplanır ve oranı baz alarak varlıkların değerleme bölgeleri tanımlanır: aşırı değerli, değerli ve kritik şekilde değersiz.

Ana Özellikler:
1. Risk-Free Rate (Risk-Free Oranı) Girişi: Kullanıcı, Sharpe oranı hesaplaması için risk-free (risksiz) oranı (genellikle devlet tahvilleri veya benzeri güvenli bir varlık getirisi) tanımlayabilir.
2. Lookback (Geribildirim) Periyodu (180 Gün): Varsayılan geribildirim periyodu, varlığın günlük getirilerinin ortalama ve standart sapmalarını hesaplamak için 180 gün (yaklaşık 6 ay) olarak ayarlanmıştır.
3. Değerleme Bölgeleri:
• Aşırı Değerli Bölge: Sharpe oranı 5’ten büyükse.
• Değerli Bölge: Sharpe oranı -1 ile 5 arasında ise.
• Kritik Derecede Değersiz Bölge: Sharpe oranı -3’ten küçükse.
• Nötr Bölge: Sharpe oranı yukarıdaki hiçbir koşulu karşılamıyorsa.
4. Tablo Görünümü: Script, kullanıcıdan alınan semboller listesine göre (örneğin, kripto para veya hisse senedi sembolleri) her bir sembolün son fiyatını, Sharpe oranını ve değerleme bölgesini tablo şeklinde gösterir.
5. Özel Sembol Girişi: Kullanıcı, izlemek istediği semboller listesini (virgülle ayrılmış) girebilir.
6. Günlük Zaman Çerçevesi Kontrolü: Script, kullanıcının doğru sonuçlar almak için günlük zaman çerçevesinde işlem yapması gerektiğini hatırlatır.

Nasıl Çalışır:
• Script, her sembol için belirtilen geribildirim periyodu boyunca günlük getirileri hesaplar.
• Ardından, getirilerin ortalama ve standart sapmasını hesaplayarak Sharpe oranını çıkarır.
• Sharpe oranı yıllıklaştırılır ve tanımlanan eşiklerle karşılaştırılarak sembol, farklı değerleme bölgelerine kategorize edilir.
• Grafik üzerinde, semboller, mevcut fiyatları ve Sharpe oranları gösteren bir tablo oluşturulur. Bu tablo, hangi sembollerin aşırı değerli (kırmızı), değerli (yeşil) veya kritik derecede değersiz (mavi) olduğunu kolayca görmek için renk kodlu arka planlar kullanır.

Bu araç, yatırım fırsatlarını daha verimli bir şekilde değerlendirebilmek için risk düzeltilmiş getiri açısından optimal fırsatları bulmak için birden fazla varlığın Sharpe oranlarını taramak için kullanışlıdır.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.