Trend & atr day & calcHi!
Why for what and how in this script?
At the time of publication the script consists of three modules, it may increase in the future.
1. Bottom left corner : daytime ATR module
(idea and basis of the author's script - ???)
- The size of the daily ATR based on 14 bars;
- intraday ATR progress;
- colour indication of the progress status, for easier visual perception (green < 70%, yellow 70-90 and red over 90% of ATR)
By evaluating the progress of the daily ATR, it is possible to suggest and expedient to enter/exit/hold a trade.
2. Top right: trend module
The trend is calculated based on Bill Williams' alligator indicator
- trend status on specified timeframes for the current ticker;
- colour indication for visual perception (green - growing trend, yellow - alligator is sleeping, red - downtrend)
Do not forget that the alligator is based on moving averages with the resulting consequences.
Its purpose is to assess the state of the trend on other ticker TFs, without additional actions (switching to another screen or TF)
3. In the bottom left corner - risk and position calculator
(based on an idea of the risk calculator by @andrei.bunulu)
It helps to determine the advisability of entering the trade and also what size position to enter into the trade, within money management strategy chosen.
- The calculator works in two directions: long deal and short deal (short deal calculation is enabled by check-box in settings)
- two calculation methods:
a. based on the set stop loss % (default is 0.3%), in this mode the stop and takeout level is automatically calculated (default is 1 / 3).
b. by entering the desired price levels (entry, stop and take profit points)
To make this work correctly please do not forget to choose the type of calculation (% or price) in the settings, and the currency symbol (for visual representation in the results).
The calculator can take into account the set commissions and spreads.
When hovering over the module - tooltips are displayed.
Each module can be enabled / disabled in the settings.
The size and arrangement of the modules is made for joint use with the script - "Abnormal Bar".
/// а по-русски это так ///
Привет!
Зачем для чего и как в этом скрипте?
На момент публикации скрипт состоит из трех модулей, возможно в будущем увеличится.
1. В левом нижнем углу : модуль дневного ATR
(идея и основа скрипт автора - ???)
- размер дневной ATR на основании 14 баров;
- прогресс ATR внутри дня;
- цветовая индикация состояния прогресса, для более простого визуального восприятия (зеленый < 70%, желтый 70-90 и красный более 90% ATR)
Оценивая прогресс дневного ATR, можно предположить и целесообразности входа / выхода / удержания из сделки.
2. В правом верхнем углу: модуль тренда
Тренд рассчитывается на основе индикатора - аллигатор Билла Вильямса
- состояние тренда на указанных таймфреймах для текущего тикера;
- цветовая индикация для визуального восприятия (зеленый - растущий тренд, желтый - аллигатор спит, красный - нисходящий тренд)
Не забываем, что аллигатор построен на основе скользящих средних с вытекающими последствиями.
Назначение - оценить состояние тренда на других ТФ тикера, без дополнительных действий (переключения на другой экран или ТФ)
3. В нижнем левом углу - калькулятор рисков и позиции
(на основе идеи калькулятора аuthor: @andrei.bunulu)
Помогает определить целесообразность входа в сделку, а также каким размером позиции входить в сделку, в рамках выбранной стратегии мани менеджмента.
- калькулятор работает в два направления: длинная и короткая сделка (расчет по короткой включается в настройках чек-боксом)
- два варианта расчета:
а. на основании установленного % стоп лосса (по-умолчанию 0,3%), при этом режиме происходит автоматический расчет уровня стопа и тейка (по умолчанию 1 / 3).
b. путем ввода данных желаемых уровней цены (точки входа, стопа и тейк профита)
Для корректной работы не забываем в настройках выбирать тип расчета (% или цена), а также символ валюты (для визуального отображения в итогах).
Калькулятор может учитывать установленный размер комиссий и спреда.
При наведении на модуль - отображаются подсказки.
Каждый модуль можно включить / выключить в настройках.
Размер и расположение модулей сделано для совместного использования со скриптом - "Abnormal Bar"
Portfolio management
NSE Sector PerformanceUse this indicator on daily timeframe
This indicator shows the performance of the top NSE Sectors for 4 time periods.
User has the flexibility to define the time periods (ex. Yearly Monthly Quarterly Weekly Daily
indicator shows the performance of the sector for those time periods along with 250d High/Low and distance from the High/Low
User input is provided to drill down into performance of the top stocks in those sectors.
Crypto and FX PSCA simple tool to calculate crypto position size and FX lot size.
How to use:
1. Use TradingView measurement tool or position tool to know how wide is your stop loss.
2. Set the equity and risk parameters.
2. For crypto, input the PERCENTAGE in stop loss;
For FX, input the PIPS.
3. Position size will be displayed in the panel.
Notes:
>Position size is in USDT for Cryptocurrencies
>Lot size for forex.
Forex contract size is your account type set by the broker:
Standard = 100,000 units = ~$10/pip
Mini = 10,000 units = ~$1/pip
Micro = 1,000 units = ~$0.10/pip
Nano = 100 units = ~$0. 01/pip
Credits:
trananhvu149
hanabil
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.
Top 40 constituents of S&P 500 IndexDisplays real-time candles of top 40 constituents of S&P 500 Index ( TVC:SPX ) for a given time frame, side-by-side. This gives an overall idea of breadth and depth of market movements in the time-frame.
Please note that, this is not a standard chart rendered bar-wise and may take time to load as it requests multiple securities. You could modify the contents, from settings, to include stocks from your portfolio or indices of different sectors.
AJ's Position Size Calculator for Forex and StocksThis position size/ stop loss and take profit calculator is designed to make entering positions more efficient. In the settings enter your account size and currency. Stop loss and profit levels can be calculated from the ATR or manually. To manually choose stop and profit price, choose manual from the SL or TP Value Type, then enter your price in the boxes below. Lot size or shares will be calculated and displayed on the table to the right of the chart. Position size calculation takes into account any currency exchange rates between your account currency and the quoted currency of the selected ticker. For forex lot sizes the exchange rate for the quoted currency relative to account currency is also built in to get an accurate position size. Enter your brokers leverage and your used margin will be displayed as well. The position size calculator is currently only configured for stocks and forex, I will try to add updates, in the future to other tickers like crypto , precious metals and crude oil CFD's. profit target and stop loss calculator should work for all symbols. I can't guarantee that the output of this calculator is correct. Use at your own risk!
Fed Net Liquidity Indicator (24-Oct-2022 update)This indicator is an implementation of the USD Liquidity Index originally proposed by Arthur Hayes based on the initial implementation of jlb05013, kudos to him!
I have incorporated subsequent additions (Standing Repo Facility and Central Bank Liquidity Swaps lines) and dealt with some recent changes in reporting units from TradingView.
This is a macro indicator that aims at tracking how much USD liquidity is available to chase financial assets:
- When the FED is expanding liquidity, financial asset prices tend to increase
- When the FED is contracting liquidity, financial asset prices tend to decrease
Here is the current calculation:
Net Liquidity =
(+) The Fed’s Balance Sheet (FRED:WALCL)
(-) NY Fed Total Amount of Accepted Reverse Repo Bids (FRED:RRPONTTLD)
(-) US Treasury General Account Balance Held at NY Fed (FRED:WTREGEN)
(+) NY Fed - Standing Repo Facility (FRED:RPONTSYD)
(+) NY Fed - Central Bank Liquidity Swaps (FRED:SWPT)
Rabi Pivot High LowIt is used to buy and sell in Stock Market NSE. It can also be used to Trail the SL to gain more profit or limit the loss.
Discipline is important in following the levels. If followed the levels properly, you will never be in loss in overall trade setup.
Dollar Cost Averaging (Portfolio)
You can use it in daily, weekly and monthly candles. It can be used on multiple assets(10). All assets must have data and make sure they all use the same currency. See style in settings for plot titles If you are interested in passive investing, I hope it helps.
------------------
Günlük, haftalık, aylık mumlarda kullabilirsiniz. Birden fazla varlıkta kullanılabilir. Çoklu kullanım için hepsinin verisi olmalı ve aynı para birimini kullanmalı. Ayarlardan stilde grafik başlıklarını bulabilirsiniz. Pasif yatırım ile ilgiyseniz umarım yardımcı olur.
Benjamin Graham Net-Net AnalyserA simple indicator that displayers as a table, telling you whether or not the stock you have selected has a current price that is less than 67% of the company's net current asset value per share (NCAVPS) at its last reporting period (FQ, FY, TTM).
Benjamin Graham uses this 67% rule to decide whether or not a stock is significantly undervalued, and studies have shown that investing in companies whose share prices are less than 67% of their NCAVPS can be highly profitable, and will beat markets in the long run.
Feel free to use as you please or repurpose the code for your own projects.
Interactive Lot/Position Calculator FTX/OKX DCA [RDM13-NOSTRA] Interactive script to calculate lot and position size when you use TradingView to trade on FTX or OKX. You can also use multi positions for DCA strategy.
After adding an indicator and making an initial interactive selection on the chart, you can modify the selection points by selecting the indicator and moving the points on the chart.
Risk Calculation Table - Amount BasedHello, this is my first script, and I believe that understanding the Risk and Reward is also the first essential step to become a successful trader.
Well maybe there are a lot of script like this but I think no one was suitable for me, so I learnt how to make one.
I think I need to explain some aspects about this script:
Input Section :
1. Entry = Entry Price.
2. SL = Stop Loss Price.
3. TP = Take Profit Price.
4. Amount = How much dollars you trade on this trade.
4. Ticker's Decimal = The number behind the decimal, to adjust this just type how much 0 you want behind the decimal.
Output Section :
1. You can adjust the lines plotted on the chart to automatically enter your entry, stop loss, and take profit price.
2. The table's appearance can be repositioned and resized.
3. The terms in the table, I think it's clear enough for everyone to understand.
If there are any critics or suggestions, I will appreciate it so much.
Greetings from Indonesia :)
Calculadora de Alavancagem Dinâmica
Este indicador deve ser utilizado para calcular a alavancagem necessária para travar as perdas em seus trades.
Defina a margem (capital em risco no trade), a porcentagem disposta a perder,
o preço de entrada, em seguida o preço de stop loss. É possível arrastar as linhas de preços desenhadas no gráfico para atualização dos preços dispostos no indicador.
O script mostrará um alvo a partir da relação risco/retorno definida pelas configurações.
Agradeço aos ensinamentos passados pelo Ghost Trader e por sua comunidade do Discord.
Agradecimento especial ao criador @LamboLimbo pela divulgação do seu script "Leverage Calculator".
NSE Paper Stocks IndexThis is the script to create a custom index of NSE paper stocks. in this example 11 stocks are selected
NNFX Exposure UtilityOVERVIEW
This tool allows the user to manually keep track of how much of their account is currently exposed to each currency, and keep that information handy and organized on the chart as a table.
It is specialized for NNFX traders who are trading all the pairs among the 9 major currency crosses: AUD, CAD, CHF, EUR, GBP, JPY, NZD, SGD, USD.
HOW DO I USE THIS INDICATOR?
Before you take a trade, you should open the indicator settings for this indicator and check off which currencies you are about to go long and short on. Here are 3 trades taken as examples:
If you go long on EUR/USD with 2% risk, your exposure is 2% long on EUR and 2% short on USD.
Then if you go short on GBP/SGD with 2% risk, your exposure is 2% short on GBP and 2% long on SGD.
But if you go long on SGD/JPY with 2% risk, your exposure would now be 4% long on SGD and 2% short on JPY. This is against your rules if you are trading the NNFX way. So this tool allows you to see when you are about to accidentally overexpose yourself to any currency pair.
Portfolio PerformanceThis indicators will help you to compute portfolio performance and display results with a stats table and a nice monthly chart.
In this script you can do following:
Compose portfolio with up to 15 instruments
Change Initial capital / date range / rebalancing period
Compare portfolio performance with a benchmark
Compute basic stats
Compute instruments contribution
Display monthly performance of portfolio and benchmark
Change style for almost everything you see on your chart
Hope it will be useful for you!
Thanks to @MUQWISHI for helping me coding it.
Disclaimer
Please remember that past performance may not be indicative of future results.
Due to various factors, including changing market conditions, the strategy may no longer perform as well as in historical backtesting.
This post and the script don’t provide any financial advice.
Sortino RatioFrom Wikipedia :
"The Sortino ratio measures the risk-adjusted return of an investment asset, portfolio, or strategy. It is a modification of the Sharpe ratio but penalizes only those returns falling below a user-specified target or required rate of return, while the Sharpe ratio penalizes both upside and downside volatility equally. Though both ratios measure an investment's risk-adjusted return, they do so in significantly different ways that will frequently lead to differing conclusions as to the true nature of the investment's return-generating efficiency.
The Sortino ratio is used as a way to compare the risk-adjusted performance of programs with differing risk and return profiles. In general, risk-adjusted returns seek to normalize the risk across programs and then see which has the higher return unit per risk."
MAP Money ManagementThis indicator lets you manage your risk as your assets in each position SO you can see the right way in money management and risk management as well
when you know how much you need to put in your positions you should see the volume of your trade and control your risk to be a winner in all ways and have the best win rate.
You can use it so easy and it is going to so helpful
good luck
Crypto Portfolio ManagementCrypto Portfolio Management
This is an indicator not like the other ones that you regularly see in tradingview. The main difference is that this indicator does not plot a value for each candle bar like you would see with RSI or MACD. Actually it is table and it just uses tradingview great database of assets to plot some valuebale information that can not be found elsewhere easily. These metrics are some basic one that is used by portfolio managers to decide what they want to hold in their portfolio. The basic idea is that you should hold assets in your basket that are less correlated to the benchmark.
Benchmark in traditional context refers to main market indices like S&P 500 of US market. But they already have a lot of tools available. My effort was for crypto investors who are trying to rebalance their portfolio every month or week to have some good metrics to make decision. Because of this I used Bitcoin as crypto market benchmark. So, everything is compared to bitcoin in this script. I’m gonna explain the terms that is used in the table’s columns below.
MAKE SURE YOU PUT YOUR CHART AT DAILY AND AT THE MAXIMUM AVAILABLE DATA EXCHANGE.
Y-Exp
This is yearly expected return of the asset. It is simply the mean of the yearly returns of the asset. (these calculations are not typical in Tradingview because mainly we calculate on each bar and give value at the same bar but here this value to change once a year). Remember that the higher this value is the better it is because historically the asset have shown good returns but there is a tip: Always check the available historical data in any asset that you are adding if you add an asset that has only 1 year of data available or you use an exchange data that recently added the coin you will get unsignificant results and the results can not be trusted. You should always selects coins and market (coins can be changed in setting) that have the largest data available.
Y-SDev
This is a little bit complicated than the previous. This is the standard deviation of the yearly returns. This is a classic measure of RISK in financial markets. The higher the value, the more risk is involved with the asset that you have added. If you added two assets that have same returns but different Standard deviations, the rational thinker should choose the asset with lower Standard deviation.
The standard deviation is a good place to start but there are some considerations to have -it is getting complicated and average user should not be involved with these terms and can ignore the next phrases- standard deviation and mean of the yearly returns are random variables, these variables have a theoretical probability density function and these functions are not gaussian normal distribution. Because of this in the professional usage these returns should be transformed to a normal distribution and have all these terms calculated there and then transform back to its own normal state and then be used for any serious investment decision. I think these calculations can be done on Tradingview but I need you support to do this in the form of like and share of my scripts and ideas.
M-Exp and M-SDev
These terms are like the previous ones but it is calculated on monthly returns. As it goes for yearly return, the monthly returns change once a monthly candle closes. So be patient to use this indicator.
I highly recommend not to make decisions on monthly data due to a lot of noise involved with this market but in long run it is ok. So go with yearly returns and wait at least for 3 years to see your results.
CorToBTC
Basically you want to buy something that is less correalted with the benchmark. this is the correlation of the asset to bitcoin.
Sharpe Ratio
This is one of the most used metric as a risk adjusted return measurment. you can google it for more information. The higher this value the better. remmeber with any invenstment it is important to understand risks associated with the assets that you are buying.
DownFromATH
This metric that I didn't see anywhere in the tradingview and is familiar in the platforms like coinmarketcap. this is a real calculation of precentage down from ATH (All Time High). it means how much percentage a coin is down from the maximum price that the asset has experienced until now.
***
Remember you can change all the asset except main asset. If you like this script to 500 I will update this continuously.
Correlation with Matrix TableCorrelation coefficient is a measure of the strength of the relationship between two values. It can be useful for market analysis, cryptocurrencies, forex and much more.
Since it "describes the degree to which two series tend to deviate from their moving average values" (1), first of all you have to set the length of these moving averages. You can also retrieve the values from another timeframe, and choose whether or not to ignore the gaps.
After selecting the reference ticker, which is not dependent from the chart you are on, you can choose up to eight other tickers to relate to it. The provided matrix table will then give you a deeper insight through all of the correlations between the chosen symbols.
Correlation values are scored on a scale from 1 to -1
A value of 1 means the correlation between the values is perfect.
A value of 0 means that there is no correlation at all.
A value of -1 indicates that the correlation is perfectly opposite.
For a better view at a glance, eight level colors are available and it is possible to modify them at will. You can even change level ranges by setting their threshold values. The background color of the matrix's cells will change accordingly to all of these choices.
The default threshold values, commonly used in statistics, are as follows:
None to weak correlation: 0 - 0.3
Weak to moderate correlation: 0.3 - 0.5
Moderate to high correlation: 0.5 - 0.7
High to perfect correlation: 0.7 - 1
Remember to be careful about spurious correlations, which are strong correlations without a real causal relationship.
(1) www.tradingview.com
Fed Funds Rate ProjectionsThis script makes projections via drawing boxes based upon changes in the fed funds rate (FRED:EFFR).
It works by turning the change in the fed funds rate into a user defined percentage (using a multiplier, by default a 1% rate of change implies a 10% change in the chart) and then drawing a box that distance away depending on the direction of the rate of change.
The size of the multiplier should depend on the duration of the asset which this is being applied to, for example, a long duration asset such as a high beta growth stock should use a larger multiplier.
R:R Trading System FrameworkFirst off, huge thanks to @fikira! He was able to adapt what I built to work much more efficiently, allowing for more strategies to be used simultaneously. Simply put, I could not have gotten to this point without you. Thanks for what you do for the TV community. Second, I am fairly new to pinescript writing, so I welcome criticism, thoughtful input and improvement suggestions. I would love to grow this concept into something even better, if possible. So please let me know if you have any ideas for improvement. However I do juggle a lot of different things outside of TV, so implementations may be delayed.
I have decided, at this time, not to add alerts. First, because I feel most people looking to adapt this framework can add their own pretty easily. Also, given how customized the framework is currently, while also attempting to account for all the possible ways in which people may want alerts to function after they customize it, it seems best to leave them out as it doesn't exactly fit the idea of a framework.
For best viewing, I recommend hovering over the script's name > ... > Visual order > Bring to front. Also I found hollow candles with mono-toned colors (like pictured) are more visually appealing for me personally. I HIGHLY RECOMMEND USING WITH BAR REPLAY TO BETTER UNDERSTAND THE FRAMEWORK'S FUNCTIONALITY.
▶️ WHAT THIS FRAMEWORK IS
- A huge collection of concepts and capabilities for those trying to better understand, learn, or teach pinescript.
- A system designed to showcase Risk:Reward concepts more holistically by providing all of the most popular components of retail trading to include backtesting, trade visual plotting, position tracking, market condition shifts, and useful info while positioned to help highlight changes in your risk:reward based decision-making processes.
- A system that can showcase individual strategies regardless of trade direction, allowing you to develop hedging strategies without having multiple indicators that do not correlate with each other.
- Designed around the idea that you trade less numbers of assets but manage your positions and risk based on multiple concurrently running strategies to manage your risk exposure and reward potential.
- An attempt to combine all the things you need to execute with an active trading management style.
- A framework that uses backtested results (in this case the number of averaged bars it takes to hit key levels) in real-time to inform your risk:reward decision-making while in-trade (in this case in your Trade Tracking Table using dynamic color to show how you might be early, on-time, or late compared to the average amount of backtested time it normally takes to hit that specific key level).
▶️ WHAT THIS FRAMEWORK IS NOT
- A complete trading product. DO NOT USE as-is. It is a FRAMEWORK for you to generate ideas of your own and fairly easily implement your own triggering conditions in the appropriate sections of the script.
▶️ USE CASES
- If you decide you like the Stop, Target, Trailing Stop, and Risk:Reward components as-is, then just understanding how to plug in your Entry and Bullish / Bearish conditions (Triangles) and adjust the input texts to match your custom naming will be all you need to make it your own!
- If you want to adapt certain components, then this system gives you a great starting point to adapt your different concepts and ideas from.
▶️ SYSTEM COMPONENTS
- Each of the system's components are described via tooltips both in the input menu and in the tables' cells.
- Each label on the chart displays the corresponding price at those triggered conditions on hover with tooltips.
- The Trailing Stop only becomes active once it is above the Entry Price for that trade, and brightens to show it is active. The STOP line (right of price) moves once it takes over for the Entry Stop representing the level of the Trailing Stop at that time for that trade.
- The Lines / Labels to the right of price will brighten once price is above for Longs or below for Shorts. The Trade Tracking Table cells will add ☑️ once price is above for Longs or below for Shorts.
- The brighter boxes on the chart show the trades that occurred based on your criteria and are color coded for all components of each trade type to ensure your references are consistent. (Defaults are TV built-in strategies)
- The lighter boxes on the chart show the highest and lowest price levels reached during those trades, to highlight areas where improvements can be made or additional considerations can be accounted for by either adjusting Entry triggers or Bullish / Bearish triggers.
- Default Green and Red Triangles (Bullish / Bearish) default to having the same triggering condition as the Entry it corresponds to. This is to highlight either a pyramiding concept, early exit, or you can change to account for other things occurring during your trades which could help you with Stop and Target management/considerations.
TradingView and many of its community members have done a lot for me, so this is my attempt to give back.