Statistics
RSI and Golden Cross ScreenerIts an example of basic cyclic screener. Looks for conditions on RSI and for Golden crosses for N bars back on top40 crypto on Binance. Feel free to contact me via tg @davidkohen if you got any questions!
It's an improvement of an old QuantNomad's idea :)
Key Financials A simple table with up to 9 key financials on your chart.
Simple, easy and configurable.
Market Profile Visible RangeSup TV, 2 important points .
1) surprisingly, it's the first MP Visible Range script on TV;
2) This one doesn't use any bagging/binning*, instead each row represents the time spent on the actual minimal price steps (aka ticks).
The script will be further extended with usual market profile related functionally in future updates. At this point we have:
- Profile itself (each row represents how many bars touch the given price);
- Mode of the profile (called POC)**;
* Still it will be introduced in future when I will find / design the proper aggregating technique. It is vital for processing very wide price ranges (for example, 500 days on ES futures).
** The script correctly calculates POC by finding all the modes in the data & choosing the closest one to data's midrange.
For this kind of technical instrument finally it was more convenient to use Pine Script 5 (btw it's my first Pine 5).
Basically this script is a side-effect of another R&D I'm doing, the stuff is useful tho so let's go.
By choosing length we both specify the amount of data to be processed & the profile's location screen-wise. It's pretty cool and & useful, on my screen it's always almost touching the left side and still always visible.
The code is heavily commented in order to be understood fast, nothing fantastic, just a lil patience required this time.
Rationale
Market & volume profiles are well known concepts, lotta info available, the most important point of all that is that MP is just another way of visualizing data that lets you notice things you don't usually notice on sequential charts. From my side I can only add that it's better to use your own brain for thinking and reconsidering using volume profile in all the cases, especially on decentralized markets (unless you're aggregating ALL the volume data from everywhere, including options, OTC etc).
Here is it, for you
Feature scalerFeature scaler | Pine Utilities series, ready to be used in "study-on-study" fashion |
Includes min-max, normalization, standardization and unit length scaling.
One and only source: en.wikipedia.org
Endpoint inputs allow to set an interval of interest for min-max scaler.
Can be (and should be) applied to other studies, or to the chart itself. In this example, I applied min-max scaling to weighted linear regression's slope values.
Unfortunately, "All data" is still "experimental" and works only on charts where less than 5000 bars are available. max_bars_back() didn't help.
Sup TV
Valuation TableHey folks, I hope you are all doing well!
This is an indicator that you can use to help you to evaluate companies. There are a few things I added to the valuation table that I personally use and I will explain what they are.
I added Joel Greenblatt's ROC% because it takes Earnings before Interest and Taxes to reflect more closely what the company earns from its operations, while including the cost of depreciation/amortization of assets. A high double digit figure often means that the company has a defensible edge versus its competitors (e.g. a strong brand or a unique product). It's good for relative valuation (comparing two companies in the same industry).
I also added Donald Yacktman's forward rate of return. Yacktman defines forward rate of return as the normalized free cash flow yield plus real growth plus inflation . Unlike the Earnings Yield %, the Forward Rate of Return uses the normalized Free Cash Flow of the past seven years, and considers growth. The forward rate of return can be thought of as the return that investors buying the stock today can expect from it in the future. Yacktman’s Forward Rate of Return may or may not be a useful metric. However, it does present new ways to see and think about stocks we may want to buy.
I added a box called "real price" and that is from Peter Lynch's book, "One Up on Wall Street," where he talked about how the real price of the stock is really the current price - Net Cash Per Share.
I would also personally pair this script with TradingView's built in financial indicators that shows the revenue growth, net income, etc.
Note: the script only works on the weekly timeframe and it will take some time to load because it has a lot of data.
Heavy Weight Stocks for Bank NiftyHeavy Weight Stocks for Bank Nifty
Stocks which are part of Bank Nifty are displayed in the table.
If the %Change > 1 then bold green
If the %Change <1 and >0, then light green
If the %Change < -1 then bold red
If the %Change > -1 and <0 then light green
NSE:BANKNIFTY
NSE:HDFCBANK
NSE:ICICIBANK
NSE:AXISBANK
NSE:KOTAKBANK
NSE:SBIN
NSE:NIFTY
NSE:RELIANCE
NSE:HDFC
SuperTrend OptimizerHello!
This indicator attempts to optimize Supertrend parameters. To achieve this, 102 parameter combinations are tested concurrently - the top three performers are listed in descending order.
Parameters,
Factor: Changes to this parameter shifts the tested factor range. For instance, increasing the factor measure from 3.00 to 3.01 (+0.01) will remove 3.00 from the tested range - this setting controls the lower threshold of the range. The upper threshold, in all instances, is the lower Factor threshold + 3.3 (i.e. 3.0(lower) - 6.3(upper), 4.0(lower) - 7.3(upper), 2.5(lower) - 5.8(upper))
ATR period: Changes to this parameter shifts the tested ATR period range. For instance, increasing the ATR measure from 10 to 11 (+1) will remove 10 from the tested range - this setting controls the lower threshold of the range. The upper threshold, in all instances, is the lower threshold + 2 (i.e. 10(lower) - 12(upper), 11(lower) - 13(upper), 9(lower), - 11(upper))
The Factor parameter is modifiable to any positive decimal number; the ATR parameter is modifiable to any positive integer. Changing either parameter shifts the tested parameter combination range. Both parameters can be changed in the settings, to which you control the lower threshold of the range. If, for instance, you were to change the Factor measurement from 3.0 to 4.1 (+1.1) the 4.0 Factor measurement, and all Factor measures less than 4.0, will be excluded from the performance test.
Consequently, a Supertrend test will be performed with a Factor of 4.1 and an ATR period of 10 (default). This test repeats at 0.1 Factor intervals and 1.0 ATR intervals.
Therefore, assume you modify the Factor lower threshold to 3.1 and the ATR lower threshold to 10. The indicator will test three Supertrend systems with a Factor of 3.1 and an ATR period of 10.. then 11.. 12, then three systems with a Factor of 3.2 and an ATR period of 10.. then 11.. 12... until (lower Factor threshold + 3.3) and (lower ATR threshold + 2) are tested... which in this example is... a Factor of 6.4 and an ATR period of 12.
The tested Factor range and ATR range are displayed in a bottom right table alongside the top performing parameter combinations.
Of course, you can change the the lower thresholds, which means you can test numerous Supertrend parameter combinations! However, no greater than 102 parameter combinations will be tested simultaneously; the best performing Supertrend parameters are plotted on the chart automatically.
I will be working on this indicator more tomorrow! Let me know if you have questions or anything you would like included!
(I of course added something fun in the script. Be sure to try it with bar replay!)
StrengthA mathematically elegant, native & modern way how to measure velocity/ strength/ momentum. As you can see it looks like MACD, but !suddenly! has N times shorter code (disregard the functions), and only 1 parameter instead of 3. OMG HOW DID HE DO IT?!?
MACD: "Let's take one filter (1 parameter), than another filter (2 parameters), then let's take dem difference, then let's place another filter over the difference (3rd parameter + introduction of a nested calculation), and let's write a whole book about it, make thousands of multi-hours YouTube videos about it, and let's never mention about the amount of uncertainty being introduced by multiple parameters & introduction of the nested calculation."
Strength: "let's get real, let's drop a weighted linear regression & usual linear regression over the data of the same length, take dem slopes, then make the difference over these slopes, all good. And then share it with people w/o putting an ® sign".
Fyi, regressions were introduced centuries ago, maybe decades idk, the point is long time ago, and computational power enough to calculate what I'm saying is slightly more than required for macd.
Rationale.
Linearly weighted linear regression has steeper slope (W) than the usual linear regression slope (S) due to the fact that the recent datapoints got more weight. This alone is enough of a metric to measure velocity. But still I've recalled macd and decided to make smth like it cuz I knew it'll might make you happy. I realized that S can be used instead of smoothing the W, thus eliminating the nested calculation and keeping entropy & info loss in place. And see, what we get is natural, simple, makes sense and brings flex. I also wanna remind you that by applying regression we maximize the info gain by using all the data in the window, instead of taking difference between the first and the last datapoints.
This script is dedicated to my friend Fabien. Man, you were the light in the darkness in that company. You'll get your alien green Lambo if you'll really want it, no doubts on my side bout that.
Good hunting
Bond Yeild CurveBond Yeild Curve
A bond yeild curve is a line that plot the interest rate of bonds of each maturity dates.
The slope of the curve give the future of economy cycle.
if the slope could be normal (positive), flat or even inverted.
This indicator aquired data of bond yeild provided by TradingView.
How to use it.
Select the country of the bond / another country to compare.
Select the maturity of bond (this indicator set 2Y, 5Y, 10Y and 20Y as default).
You can toggle to 3 different data set; Yeild, Spread (10Y-2Y) and Yeild Curve.
In case that you select the "Yeild Curve", you can customize the desired past period to compare.
How we can get the benefit.
- If the current spread is greater than 1.0, it suppose that the economy of that country probably is ok.
- if the current spread is between 0 - 1.0, it suppose to be flatted and probably turn to invert and the economy cound be in a recession soon.
- if the current spread is below 0, it suppose to be inverted and economy is in recession.
when knowing the state of economy, it would help us to manage our investment.
When you select "Yeild"
When you select "Spread"
When you select "Yeild Curve"
I'm new for this.
if any idea, correction and suggestion, i do appreciate it.
VIX Cheat SheetHello!
This indicator - "VIX Cheat Sheet" - performs several calculations for $VIX against the asset on your chart. However, using $VIX as a risk proxy or volatility metric often fails beyond large-cap U.S equities. To remedy this, the VixFix indicator is included in the script; you can select whether the script performs calculations for an asset against $VIX or against VixFix (i.e. Forex, Crypto)
Measured are: $VIX correlation to an asset's price fluctuations, the average close-to-close gain/loss subsequent a $VIX/VixFix close above the upper Bollinger Band, the average 5-session gain/loss following the same occurrence in addition to the average 10-session gain/loss, all close-to-close, 5 session, and 10-session gains/losses are stored as tooltips for labels on the chart. The current close-to-close percentage gain/loss for $VIX and VixFix are displayed on the chart.
Displayed in the example image is a box incorporating $VIX price data alongside an upper Bollinger Band and lower Bollinger Band. The data isn't cast to its own price scale but is helpful for quick interpretation of $VIX fluctuations. You can select to plot VixFix data in the box in the user inputs table.
Displayed in the second example image is a semi-transparent blue box encompassing all price moves that occurred when $VIX measured above $40 for at least ten consecutive sessions. The largest percentage close-to-close loss is displayed below the box.
Also illustrated is a red label that appears when $VIX or VixFix closes above the upper Bollinger Band. The indicator will calculate and display the performance of the asset for the subsequent 10 sessions, to which the red label will disappear and all data stored as a tooltip in the blue labels stating "VIX Closed Above Upper Band" or "VixFix Closed Above Upper Band".
To reduce chart clutter, a label and line combination marking all $VIX closes above the upper Bollinger Band was not included. Instead, bar color changes were added. When "$VIX" is selected in the user inputs table the indicator will mark all sessions in which $VIX closed above the upper band as blue, in addition to plotting $VIX price data in the dynamic black box. When "VixFix" is selected, the indicator will mark all sessions where VixFix closed above the upper band as purple; the VixFix indicator will be plotted in the black box.
Be sure to hover over labels to access tooltip information; try the indicator with bar replay!
Volume Variation Index IndicatorThis tool is a quantitative tip for analysts who study volumes or create volume based trading strategies.
Like all our projects, we start with a statistical logic to which we add coding logic.
This indicator can save a huge amount of time in calculating the variation of volume between sessions .
How it work
The indicator calculates the difference between the volume of the last closing bar and the volume of the previous closing bar. It shows the difference between the trading volumes.
The session in which the trading volume is up are represented in green.
Red session represent trading volume down.
We have added a third function.
Through the User Interface the trader can activate or deactivate the variation average.
The indicator is able to calculate the average of the volume changes by representing it with a blue line.
To activate the average, simply set it to ON in the User Interface.
By default, the indicator calculates the average of the last 10 periods, but you are free to set this parameter in the User Interface.
Data access
To access the data, simply move the cursor. When you move the cursor over the green bars, the increase data will be displayed in green. By hovering the cursor over the red bars you will see the decrease data in red. By hovering the cursor over the average will show you the average data in blue.
The data is displayed in the top left corner of the indicator dashboard.
If you found this indicator helpful, please like our script.
WhaleCrew Crypto Open InterestUse Crypto Open Interest Data available on TradingView to your advantage.
Features
Auto-Detect Symbol (based on chart)
Preset Symbols (BTC, ETH, BNB, XRP, LUNA, ADA, SOL, AVAX and DOT)
Exchanges ( Binance and BitMex )
Inverse and USDT Pairs
Override Data Option to use any OI Data on TradingView
Customizable Candles
[TTI] All-time-high (ATH), (ATL), 52 week high and low Dots––––History & Credit
I wanted to show our community the idea that stocks that make All Time High are likely to continue making ATHs for some time. It goes contrary to the idea "buy cheap sell high". Actually, in the real market leaders the stocks that make 100+% return are just getting started on returns to few THOUSAND percent. I have used code from QuantNovad scrip in this one too. So thanks to him as well, since it speeded writing it from scratch!
–––––What it does
The script paints dots and shows stats.
The dots are 4 types:
🟢 = Every time a new ATH is achieved, a green dot paints above the bar
🟣 = Every time a new 52week High is achieved, a purple dot paints above the bar
🟡 = Every time a new ATL is achieved, a yellow dot paints below the bar
🟠 = Every time a new 52week Low is achieved, a orange dot paints below the bar
Stats =
Show in a box in the bottom right corner of the screen. How many times has this stock achieved:
👉 ATHs
👉 52WK High
👉 ATLs
👉 52WK LOW
–––––How to use it
This is really an illustrative script to get the idea of the methodology "buy high sell higher', that we teach as momentum traders.
Some notable examples to check are:
HOOD
MSFT
TSLA
AAPL
See the stock dynamics and understand that bottom fishing doesn't result in stocks making massive moves.
Average Quarterly and Annual Gain/Loss (Color Divided)Hello!
Simple script here!
(BE SURE TO TRY WITH BAR REPLAY)
This indicator measures the current quarterly gain/loss (Q1, Q2, Q3, Q4) and the average quarterly gain/loss.
The average percentage gain/loss for Q1, Q2, Q3, and Q4 are calculated and displayed on the chart; colors are adjustable.
By default, Q1 is measured as blue, Q2 as green, Q3 as red and Q4 as yellow.
Also measured is the average annual percentage gain/loss and the current year's running gain/loss.
Years are split by a dashed line, beneath which a label displays that year's percentage gain or loss, in addition to the average annual gain or loss.
Labels and lines update per bar!
A constantly updating line connects the high price of the first session for a quarter to the current high price. The line will delete and restart when a new quarter occurs.
Labels, lines, and line fills are color coded. So, any change to the quarterly/annual color scheme will change the color for all labels, lines, and line fills for that particular quarter!
Thanks for reading!
Interest Rates | USA / EU / UKThis script shows the Interest Rates of the USA, EU and UK.
USA = Red
EU = Blue
UK = White
PSAR Optimization ScriptHello!
User @henryph24 suggested I make this script!
This script calculates the cumulative and average gain/Loss of rising SAR following a price crossover of SAR.
The cumulative and average gain/Loss of falling SAR following a price crossunder is also measured.
Changes to the parameters of SAR will return the requisite calculations for evaluating performance.
Benchmark SAR can be used to compare performance against test SAR.
When changing the SAR parameters the script will recalculate and display the rising SAR and falling SAR performance of the modified parameters. The script works for any asset on any timeframe.
Essentially, this script allows you to optimize SAR parameters, and quickly ascertain what can/cannot work for an asset.
The script automatically plots the best performing SAR between a benchmark SAR (SAR #1) and a test SAR (SAR #2). Both benchmark SAR and test SAR works the same. The two are used to compare performance between different SAR parameters. If you would like the script not to plot the best performing SAR you can select "On" for the "Override SAR" input box. Doing so will plot the SAR parameters of your choice while still allowing you to compare the performance of benchmark SAR and test SAR.
There are tooltips available in the user input tab that explain the SAR parameters, in addition to what your modifications of the parameters will do, should you be unfamiliar with the indicator!
Enjoy!
Volatility/Volume ImpactWe often hear statements such as follow the big volume to project possible price movements. Or low volatility is good for trend. How much of it is statistically right for different markets. I wrote this small script to study the impact of Volatility and Volume on price movements.
Concept is as below:
Compare volume with a reference median value. You can also use moving average or other types for this comparison.
If volume is higher than median, increment positive value impact with change in close price. If volume is less than median, then increment negative value impact with change in close price.
With this we derive pvd and nvd which are measure of price change when volume is higher and lower respectively. pvd measures the price change when volume is higher than median whereas nvd measures price change when volume is lower than median.
Calculate correlation of pvd and nvd with close price to see what is impacting the price by higher extent.
Colors are applied to plots which have higher correlation to price movement. For example, if pvd has higher correlation to price movement, then pvd is coloured green whereas nvd is coloured silver. Similarly if nvd has higher correlation to price then nvd is coloured in red whereas pvd is coloured in silver.
Similar calculation also applied for volatility.
With this, you can observe how price change is correlated to high/low volume and volatility.
Let us see some examples on different markets.
Example 1: AMEX:SPY
From the chart snapshot below, it looks evident that SPY always thrive when there is low volatility and LOW VOLUME!!
Example 2: NASDAQ:TSLA
The picture will be different if you look at individual stocks. For Tesla, the price movement is more correlated to high volume (unlike SPY where low volume days define the trend)
Example 3: KUCOIN:BTCUSDT
Unlike stocks and indices, high volatility defined the trend for BTC for long time. It thrived when volatility is more. We can see that high volume is still major influencer in BTC price movements.
Settings are very simple and self explanatory.
Hint: You can also move the indicator to chart overlay for better visualisation of comparison with close price.
Performance Table From OpenThis indicator plots the percentage performance from the open of up to 20 different customizable tickers.
Enjoy!
Financial GrowthThis indicator will acquire the financial data provided by Tradview.
the data is compare between Quarter, Annual and TTM in term of percent of growth.
YoY, QoQ and CAGR is also available by this script (The minimum is 4).
in addition, ploting of data, label and table also available (you can check the mark to toggle on / off).
Data : Revenue, Net Income, EBITDA, EPS, DVPS, Free Cash Flow and Forward PE .
How to use it.
just select the financial data, period and size of data to compare.
you can check the box to toggle the plotting line, label and table.
Enjoy.
Position & Lot Size CalculatorBuilt with love "Position & Lot Size Calculator"
This indiator will help you to calculate your position size for managing the risk
Features :
1. Click-able Price Entry & SL (Easier Interface)
How to use it :
1. After add the indicator, set the Entry & SL Price with click price line in the chart
2. Set the risk and another parameter
Regards,
Hanabil
Days to expected ROICounts days to expected Return Of Investment from any given time.
Works only with "1 Day" resolution