Investing - Correlation Table This correlation tables idea is nothing new, many sites provides it.
However, I couldn't find any simple correlation indicator on TradingView despite how simple this indicator is.
This indicator works as its called. Calculating the correlation between 2 projects (can be used in stocks as well) using the 'ta.correlation' feature built into pinescript.
When it comes to investing, we do not want our stocks / crypto project to be heavily correlated to each other.
If they are heavily correlated to each other, then there isn't much point in diversifying.
That being said, it can be useful for traders who trade multiple pairs.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
In this indicator, consist of 5 primary input and 15 secondary input (Symbol List).
Correlation Source:
This input options allow you to change how the correlation is calculated. By default, it uses 'close'.
Correlation Percentage(%):
This input options allows you configure how many (%) of correlation is considered as 'decoupled'.
This correlation will only move between -100% ~ 100%.
100% refers to it moving together.
-100% refers to it moving the opposite direction.
For example, Project A rises in Price, what is the possibility of Project B following:
A 100% correlation between Project A and Project B, refers to Project B will follow Project A movement.
A 50% correlation between Project A and Project B, refers to there is only 50% chance for Project B to follow Project A movement.
A -20% correlation between Project A and Project B, refers to there is a 20% chance of Project B moving the opposite direction of Project A
(Refers to the table on chart above to better understand what the numbers means. DOT/USD has a 100% correlation to DOT/USD. However. MXCUSDT has a -37.2% correlation to DOT/USD.)
Amounts Bars To Check:
This input options will check the amount of bars since the last bar in the chart.
If you want to know the correlation of the past 100 days in a daily chart, you will enter '100' into this options and it will check only the past 100 days.
Symbol List
This will allow you to input all the project symbol ticker ID to add into the correlation table.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Originally, I wish to use for loop to go through the symbol list to reduce the amount of code required. However, due to limitation of 'request.security' feature, I had to abandon that idea and use hard-coded for requesting security and use a while loop to identify the symbol correlation value in the array set then set the table value accordingly.
If there is any script writer could improve this or any unclear explanation, feel free to drop a comment below.
Portfolio management
Plots CAGR lines for a given set of ratesPlots CAGR lines for a given set of rates from a specified time. It will be helpful to see how the rate of growth of a security's price is changing over a period of time. It also calculates the current CAGR from the time specified. Works on D, W, M timeframes.
Risk:RewardThis Indicator displays Entry and Exits levels. The display is done under 3 modes:
- Risk/Reward mode (the one by default. It is set to a 1:1 ratio)
- Multiples TP Levels
- Custom Levels
Click to Set entry Price on chart
The displaying is static by default
to make it dynamic disable the "Use custom Entry ?" input.
Disclaimer: Scripts that I post publicly are experimental. They are not financial advices. Always backtest your ideas using your own methodologies.
Position Size Calc. (Minimalist)This is a simplified position size calculator in the form of a table.
The reason I published this script is because all other position size calculator scripts try to provide way too much when it should be much simpler, position in strange areas of the chart and leave unwanted chart pollution.
This is a bare-bones functional table that takes your risk level, entry, stop and take profit as inputs, and calculates your loss, profit and required position size for your chosen risk level as a result.
Inspired by a table type position size calculator made by DojiEmoji design/color-wise. Functionally different however.
I hope you find this script useful and include it on your trading journey.
Manual Stop Loss / Risk Management PanelHere is a panel where you enter the desired stop-loss price, the amount you would like to risk and it spits out what you should trade to only lose that amount if the stop-loss is hit.
Pyramiding Order Volume CalculatorThis is a script to calculate the order volume for the current symbol given your current portfolio value and how many orders you want to place. This is useful when using a strategy that places pyramiding orders and your bot won't automatically divide up your portfolio.
Grid Settings & MMThis script is designed to help you plan your grid trading or when averaging your position in the spot market.
The script has a small error (due to the simplification of the code), it does not take into account the size of the commission.
You can set any values on all parameters on any timeframe, except for the number of orders in the grid (from 2 to 5).
The usage algorithm is quite simple:
1. Connect the script
2. Install a Fibo grid on the chart - optional (settings at the bottom of the description)
3.On the selected pair, determine the HighPrice & LowPrice levels and insert their values
4.Evaluate grid data (levels, estimated profit ’%’, possible profit ‘$’...)
And it's all)
Block of variables for calculating grid and MM parameters
Variables used regularly
--- HighPrice and LowPrice - constant update when changing pairs
--- Deposit - deposit amount - periodically set the actual amount
Variables that do not require permanent changes
--- Grids - set the planned number of grids, default 5
--- Steps - the planned number of orders in the grid, by default 5
--- C_Order - coefficient of increasing the size of orders in the base coin, by default 1.2
--- C_Price - trading levels offset coefficient, default 1.1
--- FirstLevel - location of the first buy level, default 0.5
--- Back_HL - number of candles back, default 150
*** For C_Order and C_Price variables, the value 1 means the same order size and the same distance between buy levels.
The fibo grid is used for visualization, you can do without it, ! it is not tied to the script code !
You can calculate the levels of the Fibo grid using the formula:
(level price - minimum price) / (maximum price - minimum price)
For default values, grid levels are as follows:
1 ... 0.5
2...0.359
3 ... 0.211
4...0.0564
5...-0.1043
Short description:
in the upper right corner
--- indicator of the price movement for the last 150 candles, in % !!! there is no task here to "catch" the peak values - only a relative estimate.
in the upper left corner
--- total amount of the deposit
--- the planned number of grids
--- “cost” of one grid
--- the size of the estimated profit depending on the specified HighPrice & LowPrice
in the lower left corner
--- Buy - price levels for buy orders
--- Amount - the number of purchased coins in the corresponding order
--- Sell - levels of profit taking by the sum of market orders in the grid
--- $$$ - the sum of all orders in the grid, taking into account the last active order
--- TP - profit amount by the amount of orders in the grid
Custom IndexEnables users to create their own custom Stock Index with up to 29 tickers! Has included optionality to include/exclude certain sectors, plot sectors individually and measure in gold. Good for having a look at how your favorite tickers have performed (with your modification of course). Also has option to show Moving Averages for your convenience.
EPS Surprise (Working)Plots the EPS surprise between reported and estimate.
* This is a working version of the old EPS Surprise indicator here that seems to have been abandoned.
Forex Lot Size CalculatorTo use indicator you need to provide enter and stop prices(you can drag these lines also). Also you able to set your Account Size in USD, Risk in % and Commission you pay your broker per lot.
Indicator calculates all this information and provides you with Lot Size(with commission) you need to open a position and target prices for 2R and 3R(also includes commission).
Feel free to comment and request new features.
Diversified Investment EMA Cross Strategy SimulatorThis simulating indicator proves that even if you use a simple strategy, you can reduce your risk by diversifying your investments.
The strategy itself is simple.(only long)
Buy when 50 days EMA crosses over 200 days EMA.
Sell when 50 days EMA crosses under 200 days EMA.
Or, stop loss when the asset falls by 2% (eg).
Using this simple strategy on an asset is just a test of your luck.
However, this capital change graph shows that risk can be reduced by diversifying investment into eight assets rather than one asset.
Options
Total Assets Capital Change represents the sum of capital changes for 8 assets. The gray line is the initial capital.
Each Asset Capital Change represents all eight asset capital changes. In this case, the gray line is displayed as the initial capital divided by 8.
The rest of the options show a graph of capital change for each asset, showing when buys and sells occurred.
And set the start date, initial capital, stop loss %, and commission.
And select the 8 assets you want to invest in and you are ready to go. To effectively reduce risk, uncoupled assets would be better if possible.
The table in the lower right shows the selected asset and color.
Please enjoy the simulation.
NK Sir's SRTFirst of all I would like to thanks Nitish Sir for teaching us the concept of SRT, which proves to be an excellent tool for Investing.
In a year, there are around 248 to 252 trading days .
On dividing the same by 2 we get 124. Even 125 / 126 can be taken.
We get SRT value by dividing Nifty Spot with 124 SMA value & SRT is applicable on Nifty in a Day Chart.
This value ranges in between 0.6 (Low) to 1.38/1.4/1.45/1.5 (High).
Ideal Entry in a stock will be at 0.6, which is very rare. You tend to buy at 0.7/0.8/0.9/1.10.
Exit from a stock will be at 1.3 - 1.5.
However generally we get a value of 0.8/0.9 and we should start investing 20 % of our capital that we have planned to invest. For every 0.1 decrease in SRT Value, we should add 20% to the stock portfolio.
Start Booking Profit if SRT value above 1.35 & book 50 % of the portfolio when SRT value is 1.45.
For Traders, as an when SRT value comes to 0.8/ 0.9. Buy when Hilega Milega gives us a clear BUY signal on Monthly Time Frame.
Stock bought at SRT value of 0.6 tend to double in a year. It generally quite rare to see a SRT Value of 0.6.
Koalafied Risk ManagementTables and labels/lines showing trade levels and risk/reward. Use to manage trade risk compared to portfolio size.
Initial design optimised for tickers denominated against USD.
OmidCapitalCalWith this tool, traders are able to calculate position leverage based on risk percentage
// ------ Settings Inputs -----------------------------------------------------------------------------------------------------
// "Capital" -- enter your portfolio balance
// "Risk" -- enter the percent of your portfolio you are willing to lose if the stop loss is hit
// "Entry" -- enter the price at which you will enter the trade
// "Stop" -- enter the price at which your stop loss will be set
// "Target" -- enter the price at which your take profit will be set
// ----------------------------------------------------------------------------------------------------------------------------
// ------ Outputs -------------------------------------------------------------------------------------------------------------
// "Capital" -- displays the portfolio balance entered in settings
// "Risk" -- displays the % loss entered in settings and the corresponding amount of your portfolio
// "Entry" -- displays the entry price entered in settings
// "Stop" -- displays the stop loss price entered in settings
// "Stop %" -- displays the calculated percentage loss from the entry price
// "Target" -- displays the take profit price entered in settings
// "Target %" -- displays the calculated percentage profit from the entry price
// "Leverage" -- displays the calculated leverage based on your max loss and stop loss settings
My_PortfolioDisplays all time high/low/mean prices and average cost with lines; and the price changes relative to the average cost in percentages.
This does not calculate average cost. This is just a fast way of viewing the current situation of one's portfolio.
Parities invested in and average costs for them have to be manually entered in the settings or by editing the script.
Should work with all parities.
crypto Position Size CalculatorCrypto Position Size Calculator
this indicator helps you to figure out the position size your trade . and its only used for crypto
the indicator needs to fill the input section in order to give you the information table that includes position size .
The input section consists two section the first section you will give the trade info like entry , stop loss and take profit .
then the next section its about your account balance and risk per trade . then you can get your position size .
you can have also option where you can display your table like bottom right , bottom left or top right its your choice.
special thanks : Ahmed busury
special thanks : Aj group family
Top 40 constituents of Nifty50Displays real-time candles of top 40 constituents of Nifty50 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.
NSE:NIFTY
Relevant World GDP GroupedLooking at a basket of countries total GDP for comparing size of economy. Makes it easy to select your own groupings of countries for comparison. A country's GDP is the total of consumer spending (C) plus business investment (I) and government spending (G), plus net exports, which is total exports minus total imports (X – M). Alliances visualized was the original idea but wasn't quite sure for a lot of other countries where they stand so it is what it is; feel free to improve.
US/CA Bond Yield CurveEasy Viewing of 4 different duration bond yields for US and Canada. Bond prices and bond yields are excellent indicators of the economy as a whole, and of inflation in particular. A bond's yield is the discount rate that can be used to make the present value of all of the bond's cash flows equal to its price. Good as part of a macro set.
trailing_drawdown
Description:
Drawdown was a tool to measure historical risk, derived from measuring current wealth from its previous peak, casually from portfolio construction (weights allocation), will consider to having a minimum drawdown. In this indicator, the drawdown for individual assets is utilized to measure its value or percentage from its trailing peak (default to 1-yr period).
Drawdown:
drawdown = (price/peaks)-1
Feature:
Static: display drawdown as percentage
Dynamic: display drawdown as value
Asia Reversal ZoneThis indicator shows the most likely time Asia session reverses it direction.
Designed for US30 scalps 30-100 points.
Focus on price and time that is key.
Remove Plot line.
Also check out "Deluxo Kill zones" my other indicator.
-Enjoy
Worth of valueThis script represent the amount of the user's amount of the price rate, it also contains a tax calculation.
This is one of my first pine script, i would may look further to work on this script.