Asset Allocation CalculatorOverview
This script is a tool that automatically calculates asset allocation for your investment portfolio. Users can set the weight of multiple assets and monitor the portfolio value in real time based on price fluctuations.
Key Features
Supports input of asset allocation percentages
Dynamic allocation calculation based on real-time price data
Automatically calculates allocated amounts for each asset based on the total investment amount
User-friendly interface with intuitive visual feedback
Settings
Total Capital : Enter the total capital, including the value of assets.
Quantity rounding : Using the rounding function may cause the target allocation to exceed 100%.
Tickers, Weight, Holdings :
To retrieve accurate asset prices, specify both the exchange and the ticker.
If you want to include cash in your portfolio, use $.
Ensure that the total allocation sums to 100%.
Refer to the pre-filled example for the correct format.
Table Settings : You can adjust the table's position, height, font size, and background color.
How to Use
By buying or selling the quantity shown in the Buy column, you can continuously maintain your target allocation.
Hold - Current holdings
Buy - Quantity to buy or sell to reach the target allocation
Target - Quantity aimed for after buying or selling
Caution
It can only calculate for a single currency, so do not mix multiple currency markets.
자산 배분 계산기
소개
이 스크립트는 투자 포트폴리오의 자산 배분을 자동으로 계산해주는 도구입니다. 사용자는 여러 자산의 비중을 설정할 수 있으며, 가격 변동에 따라 포트폴리오 가치를 실시간으로 모니터링할 수 있습니다.
주요 기능
자산 배분 비율 입력 지원
실시간 가격 데이터를 기반으로 한 동적 배분 계산
총 투자 금액을 기준으로 각 자산에 할당된 금액 자동 계산
직관적인 시각적 피드백을 제공하는 사용자 친화적인 인터페이스
설정
Total Capital : 자산 가치를 포함한 총 자본금을 입력하세요.
Quantity rounding : 반올림 기능을 사용하면 목표 비중이 100%를 초과할 수 있습니다.
Tickers, Weight, Holdings :
정확한 자산 가격을 불러오기 위해 거래소와 티커를 함께 입력하세요.
포트폴리오에 현금을 포함하려면 '$'를 사용하세요.
비중 합계가 반드시 100%가 되도록 설정하세요.
예제 형식을 참고하여 올바르게 입력하세요.
한국(원화) 시장을 위한 입력 예시입니다.
KRX:360750, 17.5, 100
KRX:310960, 17.5, 120
KRX:148070, 25, 20
KRX:305080, 25, 10
KRX:139320, 10, 150
UPBIT:BTCKRW, 5, 0.002
$,0,5000000
Table Settings : 테이블의 위치, 높이, 글자 크기 및 배경색을 조정할 수 있습니다.
사용 방법
Buy 열에 표시된 수량만큼 매수 또는 매도하면 목표 비중을 지속적으로 유지할 수 있습니다.
Hold - 현재 보유 수량
Buy - 목표 비중을 맞추기 위해 매수 또는 매도해야 하는 수량
Target - 매수, 매도 후 목표로 하는 수량
주의
한 가지 통화로만 계산할 수 있으니 여러 통화 시장을 혼용하지 마세요.
Assetmanagement
Lead-Lag Market Detector [CryptoSea]The Lead-Lag Market Detector is an advanced tool designed to help traders identify leading and lagging assets within a chosen market. This indicator leverages correlation analysis to rank assets based on their influence, making it ideal for traders seeking to optimise their portfolio or spot key market trends.
Key Features
Dynamic Asset Ranking: Utilises real-time correlation calculations to rank assets by their influence on the market, helping traders identify market leaders and laggers.
Customisable Parameters: Includes adjustable lookback periods and correlation thresholds to adapt the analysis to different market conditions and trading styles.
Comprehensive Asset Coverage: Supports up to 30 assets, offering broad market insights across cryptocurrencies, stocks, or other markets.
Gradient-Enhanced Table Display: Presents results in a colour-coded table, where assets are ranked dynamically with influence scores, aiding in quick visual analysis.
In the example below, the ranking highlights how assets tend to move in groups. For instance, BTCUSDT, ETHUSDT, BNBUSDT, SOLUSDT, and LTCUSDT are highly correlated and moving together as a group. Similarly, another group of correlated assets includes XRPUSDT, FILUSDT, APEUSDT, XTZUSDT, THETAUSDT, and CAKEUSDT. This grouping of assets provides valuable insights for traders to diversify or spread exposure.
If you believe one asset in a group is likely to perform well, you can spread your exposure into other correlated assets within the same group to capitalise on their collective movement. Additionally, assets like AVAXUSDT and ZECUSDT, which appear less correlated or uncorrelated with the rest, may offer opportunities to act as potential hedges in your trading strategy.
How it Works
Correlation-Based Scoring: Calculates pairwise correlations between assets over a user-defined lookback period, identifying assets with high influence scores as market leaders.
Customisable Thresholds: Allows traders to define a correlation threshold, ensuring the analysis focuses only on significant relationships between assets.
Dynamic Score Calculation: Scores are updated dynamically based on the timeframe and input settings, providing real-time insights into market behaviour.
Colour-Enhanced Results: The table display uses gradients to visually distinguish between leading and lagging assets, simplifying data interpretation.
Application
Portfolio Optimisation: Identifies influential assets to help traders allocate their portfolio effectively and reduce exposure to lagging assets.
Market Trend Identification: Highlights leading assets that may signal broader market trends, aiding in strategic decision-making.
Customised Trading Strategies: Adapts to various trading styles through extensive input settings, ensuring the analysis meets the specific needs of each trader.
The Lead-Lag Market Detector by is an essential tool for traders aiming to uncover market leaders and laggers, navigate complex market dynamics, and optimise their trading strategies with precision and insight.
Cobra's CryptoMarket VisualizerCobra's Crypto Market Screener is designed to provide a comprehensive overview of the top 40 marketcap cryptocurrencies in a table\heatmap format. This indicator incorporates essential metrics such as Beta, Alpha, Sharpe Ratio, Sortino Ratio, Omega Ratio, Z-Score, and Average Daily Range (ADR). The table utilizes cell coloring resembling a heatmap, allowing for quick visual analysis and comparison of multiple cryptocurrencies.
The indicator also includes a shortened explanation tooltip of each metric when hovering over it's respected cell. I shall elaborate on each here for anyone interested.
Metric Descriptions:
1. Beta: measures the sensitivity of an asset's returns to the overall market returns. It indicates how much the asset's price is likely to move in relation to a benchmark index. A beta of 1 suggests the asset moves in line with the market, while a beta greater than 1 implies the asset is more volatile, and a beta less than 1 suggests lower volatility.
2. Alpha: is a measure of the excess return generated by an investment compared to its expected return, given its risk (as indicated by its beta). It assesses the performance of an investment after adjusting for market risk. Positive alpha indicates outperformance, while negative alpha suggests underperformance.
3. Sharpe Ratio: measures the risk-adjusted return of an investment or portfolio. It evaluates the excess return earned per unit of risk taken. A higher Sharpe ratio indicates better risk-adjusted performance, as it reflects a higher return for each unit of volatility or risk.
4. Sortino Ratio: is a risk-adjusted measure similar to the Sharpe ratio but focuses only on downside risk. It considers the excess return per unit of downside volatility. The Sortino ratio emphasizes the risk associated with below-target returns and is particularly useful for assessing investments with asymmetric risk profiles.
5. Omega Ratio: measures the ratio of the cumulative average positive returns to the cumulative average negative returns. It assesses the reward-to-risk ratio by considering both upside and downside performance. A higher Omega ratio indicates a higher reward relative to the risk taken.
6. Z-Score: is a statistical measure that represents the number of standard deviations a data point is from the mean of a dataset. In finance, the Z-score is commonly used to assess the financial health or risk of a company. It quantifies the distance of a company's financial ratios from the average and provides insight into its relative position.
7. Average Daily Range: ADR represents the average range of price movement of an asset during a trading day. It measures the average difference between the high and low prices over a specific period. Traders use ADR to gauge the potential price range within which an asset might fluctuate during a typical trading session.
Utility:
Comprehensive Overview: The indicator allows for monitoring up to 40 cryptocurrencies simultaneously, providing a consolidated view of essential metrics in a single table.
Efficient Comparison: The heatmap-like coloring of the cells enables easy visual comparison of different cryptocurrencies, helping identify relative strengths and weaknesses.
Risk Assessment: Metrics such as Beta, Alpha, Sharpe Ratio, Sortino Ratio, and Omega Ratio offer insights into the risk associated with each cryptocurrency, aiding risk assessment and portfolio management decisions.
Performance Evaluation: The Alpha, Sharpe Ratio, and Sortino Ratio provide measures of a cryptocurrency's performance adjusted for risk. This helps assess investment performance over time and across different assets.
Market Analysis: By considering the Z-Score and Average Daily Range (ADR), traders can evaluate the financial health and potential price volatility of cryptocurrencies, aiding in trade selection and risk management.
Features:
Reference period optimization, alpha and ADR in particular
Source calculation
Table sizing and positioning options to fit the user's screen size.
Tooltips
Important Notes -
1. The Sharpe, Sortino and Omega ratios cell coloring threshold might be subjective, I did the best I can to gauge the median value of each to provide more accurate coloring sentiment, it may change in the future.
The median values are : Sharpe -1, Sortino - 1.5, Omega - 20.
2. Limitations - Some cryptos have a Z-Score value of NaN due to their short lifetime, I tried to overcome this issue as with the rest of the metrics as best I can. Moreover, it limits the time horizon for replay mode to somewhere around Q3 of 2021 and that's with using the split option of the top half, to remain with the older cryptos.
3. For the beginner Pine enthusiasts, I recommend scimming through the script as it serves as a prime example of using key features, to name a few : Arrays, User Defined Functions, User Defined Types, For loops, Switches and Tables.
4. Beta and Alpha's benchmark instrument is BTC, due to cryptos volatility I saw no reason to use SPY or any other asset for that matter.
Portfolio Tracker For Stocks & CryptoThis is a portfolio tracker that will track individual, overall and daily profit/loss for up to 12 assets. You can set the size of your buys and price of your buys for accurate, up to date profit and loss data right on your chart. It works on all markets and timeframes.
HOW TO USE
Go into the indicator settings and you will see all of the available settings. The first is the ability to turn the tracker info table on or off from the chart, so it saves your portfolio info but let’s you remove it from the chart while trading. Second is the option to move the position of the info table to suit your preference.
Next we get into setting up your portfolio tickers, order size and price. Each ticker lets you set which stock/crypto you bought, then set how much you purchased and then what price you purchased them at.
Go through and set up all of your assets and then turn off any tickers that you don’t need. Once that is all done, your portfolio will be shown on the chart with all the data.
FEATURES
Top Section
The portfolio tracker has 2 sections. The top section shows each ticker in your portfolio individually with the following data:
- Ticker Name
- Weight of that asset compared to your total portfolio in %
- Current value of that position in $
- Profit or loss value from purchase price in %
- Todays change in value from yesterday’s close in %
The $ Value, PnL % and Today % will all change colors from green to red depending if they are in profit or not.
Bottom Section
The bottom section of the tracker will give you info for your portfolio as a whole. It has the following data:
- Total cost of your entire portfolio in $
- Current value of your entire portfolio in $
- Current profit or loss of your entire portfolio in $
- Current profit or loss of your entire portfolio in %
- Todays change of your entire portfolio value compared to yesterday’s close in %
The $ Value, PnL $, PnL % and Today % will all change colors from green to red depending if they are in profit or not.
Portfolio Tracker [Anan]█ OVERVIEW
A simple Portfolio Tracker to track your Profit/Loss for any ticker in any market (stock, futures, index, forex, crypto, fund, dr.).
You just need to input (Asset / Quantity / Avg. Buy/Sell Price) and the script will calculate everything.
Also, you can use it for paper trading, or even what-if cases..
█ FEATURES
- Up to 10 positions
- Track your position real-time price and 24H change %
- Calculate your position current value
- Calculate your position cost value
- Calculate Profit/Loss
- Calculate Profit/Loss %
- Change every color in the table as you like.