Gap Analyzer [WMT] - Data for Gap Up and Gap DownGet data for gaps with Gap Analyzer
Change the gap mode in settings to switch between a Gap Up (default) or Gap Down
Change the threshold for the minimum (Gap Up) and maximum (Gap Down) gap
Change Data Years -> Years of the look back period to calculate the stats
Retrieve valuable information for past statistics on how the instrument behaved with the given gap
Definitions for Gap Up
Price can fade lower from the open or (Gap Up Fade)
Price can continue higher from the open (Gap Up Continuation)
Definitions for Gap Down
Price can continue lower from the open or (Gap Down Continuation)
Price can bounce higher from the open (Gap Down Bounce)
For each of those, we get:
"øO→H": average percentage movement from open to high of the day
"øO→L": average percentage movement from open to low of the day
"øO→C": Average percentage movement from open to close of the day
Statistic
Premium Linear Regression - The Quant ScienceThis script calculates the average deviation of the source data from the linear regression. When used with the indicator, it can plot the data line and display various pieces of information, including the maximum average dispersion around the linear regression.
The code includes various user configurations, allowing for the specification of the start and end dates of the period for which to calculate linear regression, the length of the period to use for the calculation, and the data source to use.
The indicator is designed for multi-timeframe use and to facilitate analysis for traders who use regression models in their analysis. It displays a green linear regression line when the price is above the line and a red line when the price is below. The indicator also highlights areas of dispersion around the regression using circles, with bullish areas shown in green and bearish areas shown in red.
Triangulation : Statistically Approved ReversalsA lot of calculation, but a simple and effective result displayed on the chart.
It automatically identifies a very favorable period for a price reversal, by analyzing the daily and intraday price action statistics from the maximum of the most recent bars from the historical data. No repainting. Alerts can be set.
The statistical study is done in real time for each instrument. The probabilities therefore vary over time and adapt to the latest information collected by the indicator.
The time range of the data study can be changed by simply changing the UT :
- 30m = 3.5 last months feed statistics
- 15m = 52 last days feed statistics
- 5m = 17 last days feed statistics (recommanded)
HOW TO USE
This indicator informs when we are in a time period strongly favorable to reversal.
==> Crossing probabilities of different kinds, in price and in time => Triangulation of top and bottom !
HOW It WORK :
fractal statistics on high and low formation.
hour's probabilities of making the high/low of the day are crossed with day's probabilities of making the high/low of the week.
First for the day, we study:
- value of the probability compared to the average probabilities
- value of the coefficient between the high probability and the low probability
which we then refine for the hour, with the same calculation.
Result: bright color for a day + hour with high probability, weak color if the probability is low but remains the only possible bias. Between these two possibilities, intermediate colors are possible - just like looking for shorts if the day is bullish, if it is a high probability hour!
This color is displayed in the background, only if we are forming the high of the day for tops, and the low of the day for bottoms - detected with a stochastic.
All probabilities are studied in real time for the current asset.
We will call this signal "killstats", for "killzones statistics"
fractal statistics on the probability of closure under specific predefined levels according to 36 cycles.
the probabilities of several cycles are studied, for example:
NY session versus London and Asian sessions, London session compared to its opening, NY session compared to its opening, "algorithmic cycles" ( 1h30), Opening of NY compared to its intersection with London..
Each cycle producing a probability of closing with respect to the opening price of each period. The periods are : (Etc/UTC)
15-18h / 15-16h / 9-13h / 14-17h / 18-22h / 10-12h / 9-10h30 / 10h30-12h / 12-13h30 / 13h30-15h / 15h-16h30 / 16h30-18h
The cycles can be superimposed, which allows to support or attenuate a signal for the key periods of the day: 9am-12pm, and 3pm-6pm. The period of the day covered by the study of cycles is 9h-22h.
Result : ==> a straight line with a half bell. Colors = almost transparent for 53% probability (low), and very intense for a high probability (75%). The line displayed corresponds to the opening price, which we are supposed to close within the time limit - before the end of the period, where the line stops.
If the price goes in the opposite direction to the one predicted by the statistics, then a background connects the price to the close level to be respected.
if direction and close is respected, nothing is displayed : there is no opportunity, no divergence between statistics and actual price moves.
By unchecking the "light mode", you can see each close level displayed on the chart, with the corresponding probability and the number of times the cycle was detected. The color varies from intense for a high probability (75%), to light for a low probability (53%)
We will call this signal "cyclic anomalies"
By default, as shown in the indicator presentation image, the "intersection only" option is checked: only the intersection between 1) killstats and 2) cyclic anomalies is displayed. (filter +-30% of killstats signals)
MORE INFORMATIONS
/!\ : during a backtest, it is necessary to refresh the studied data to benefit from the real time signals, and for that you have to use the replay mode. if "Backtesting informations?"is checked, labels are displayed on the graph to warn of the % distortion of the signals. I recommend using the replay mode every 250 candles, and every 1000 candles for premium accounts, to have real signals.
- Alerts can be set for killzone, or intersections ( As in presentation picture)
- The ideal use is in m5. It can trigger several times a day, sometimes in opposite directions, and sometimes not trigger for several days.
- Premium account have 20k candles data, and not 5k => signals may vary depending on your tradingview subscription.
Financial Data Spreadsheet [By MUQWISHI]The Financial Data Spreadsheet indicator displays tables in the form of a spreadsheet containing a set of selected financial performances of a company within the most recent reported period. Analyzing Financial data is one of the classic methods to evaluate whether the company’s stock price is overvalued or undervalued based on its income statement, balance sheet, and cash flow statement. This indicator might be practical to investors to collect needed data of a company to analyze and compare it with other companies on a TradingView chart or print it in spreadsheet form.
█ OVERVIEW
█ BEST PRACTICES
Due to strict limitations on calling request.financial() function, I tried to develop the table with the best ways to be more dynamic to move and the ability to join multiple tables into a spreadsheet. Users can add up to 20 instruments and 2 financial metrics per table. However, it’s possible to add many tables with other financial metrics, then connect them to the main table.
Credits: The idea of joining multiple tables inspired by @QuantNomad Screener for 40+ instruments
█ INDICATOR SETTINGS
1- Moving Table toward right-left up-down from its origin.
2- Hiding Column Title checkmark. Useful for adding a joined table underneath with additional instruments.
3- Hiding Instruments Title checkmark. Useful for adding a joined table on the right with other financial metrics.
4- Shade Alternate Rows checkmark. I believe it’ll make the table easier to read.
5- Selecting Financial Period. (Year, Quarter).
6- Entering a currency.
7- Choosing a financial ID for each column. There’re over 200 financial IDs. Source: What financial data is available in Pine? — TradingView
8- Optional to highlight values in between.
9- Entering the ticker’s symbol with the ability to activate/deactivate.
█ TIP
For best technical performance, use the indicator in a 1D timeframe.
Please let me know if you have any questions.
Thank you.
Multi-Polar WorldA new macro analysis tool for easily analyzing the multi-polar world's economic powerhouses / spheres of influence, making for an easy to use visual when comparing a number of statistics:
GDP, GDP per Capita, External Debt, Government Debt, Exports, Imports, Gold Reserves, Employed Persons, Military Expenditure, Population, Bank Lending Rate, Balance of Trade, Central Bank Balance Sheet, M2 Money Supply, and CPI . Includes option to provide the total for each pole, or view individually for more detailed comparison. Meant to be used when analyzing the macro-economic conditions/trends in conjunction with other "Big Picture" type indicators when adjusting your macro framework.
Fixed Quantum CDVWe took the original script Cumulative delta volume from LonesomeTheBlue, here is the link:
To understand the CDV you can watch traders reality master class about CDV.
This indicator show the ratio of vector color and the ratio of the cumulative delta volume from vector color.
First you select a date range on the chart. Then it calculate all candles in that region. Let's say there is 3 green vectors and 3 red vectors in the region, the ratio of vector color will be 50% for bull and 50% for bear vector. As for the CDV ratio, it will measure the total CDV inside green vector and total CDV inside red vector and make a ratio. But it is a little different.
I twisted the calculation for the ratio of CDV a little bit to make it more comprehensive in the table. Since it's the ratio of the CDV for the bull candles versus the bear candles, the CDV is almost always a positive number for the bull candles and almost always a negative number for the bear candle. So I calculated the bear CDV as a positive number. Formula: Bull_CDV_ratio = Bull_CDV / (Bull_CDV + Bear_CDV), Bear_CDV_ratio = -Bear_CDV / (Bull_CDV - Bear_CDV).
Note that when the bull CDV and bear CDV are both a positive number or both a negative number, the ratio percentage can be over 100% and under 0%. It means that we expect volatility.
Enjoy!
Daily Manual KILLZONESThis indicator is to be used with "KILLSTATS", our indicator allowing to backtest on hundreds of days at which time, and which day the top/low of the day and week is formed.
"Manual Killzone" allows to define our statistical killzones by day of the week manually: you define your own rules according to your interpretation of our Killstats indicator.
It integrates a daily price action filter according to the ICT concept:
It will only display bullish probabilities (green) defined if and only if we are in discount and out of the daily range 25/75%.
Same for bearish probabilities (red)
The blue color is to be applied in case of reversal with high contradictory probability (Example: to be used for Tuesday from 2pm to 3pm, if Tuesday is a day with high probability to form a top, but 2pm/15pm is the time with high probability to form a bottom AND a top. Indecision => blue)
WARNING : Calculated according to Etc/UTC time : put "0" in the Timezone parameter of killstats.
It is necessary to use the replay mode regularly during the backtesting to update the data!
KillstatsBacktest and identify at what times/days the high/low were formed. The periods are shown on the graph along with detailed statistics.
Exemple with "days : 600" and "13h : top 12%" : we understand that over 600 days, in 12% of the cases we have formed the top of the day at 13h.
up to 1000+ days studied to find favorable reversal time slots: killstats! The data presented can sometimes be... surprising.
Increasing/decreasing the timeframe on chart = increase/decrease the studied period.
A period of 1000 days ( UT : h1) allows to have solid but not exact statistics.
A period of 30 days allows to have current statistics but too little sample to know if the data is relevant.
I recommend looking for intersections of killstats over several periods: If over 1000 days AND 30 days, 3pm was a time with a high probability of forming a top, it is interesting to look for short positions between 3pm and 4pm.
The data is displayed in the form of a diagram whose visual allows to identify effective time slots.
Caution. Timeframe: h1 maximum for the study of the day's high/low to be correct - and daily maximum for the study of the week's high/low.
Caution2. Match the timezone with the input (by default set to GMT+1). So if you are at GMT+2, you must put "2" in timezone.
I recommend using this as part of an aggressive high frequency scalping strategy to make the most of your trading session - with the aim of quickly moving to TP1/BE and leaving your winning position open.
Strategy weekly results as numbers v1This script is based on an idea of monthly statistics that have been found across tradingview community scripts. This is an improved version with weekly results with the ability to define the size of every group (number of weeks within one group).
Initial setup of the strategy
1. Set the period to calculate the results between.
2. Set the statistic precision and group size.
3. Enable "Recalculate" → "On every tick" under the strategy "Properties" section.
The logic under the hood
1. Get the period between which to calculate the strategy.
2. Calculate the first day of the first week within the period.
3. Calculate the latest day of the latest week within the period.
4. Calculate the results of the selected period.
5. Group the values by the defined number of cells.
6. Calculate the summary of every group.
7. Render the table.
Please, be careful . To use this tool you will need to enable the "Recalculate" → "On every tick" option but it means that your strategy will be executed on every tick instead of bar close. It can cause unexpected results in your strategy behaviour.
[co.n.g.] ADR 5/10/14/20Average Daily Range (ADR) over 5/10/14/20 Days
What it is
One of the oldest measurements of price volatility that is being used in technical and statistical trading is the range of a specific period of past days to estimate probability of chances, risk and price movements, as seen f.e. in
Molodovsky, N. (1967). Building a Stock Market Measure—A Case Study. Financial Analysts Journal, 23:3, 43-46 , DOI: 10.2469/faj.v23.n3.43.
Problem
After having tried all available community scripts I've encountered various indifferences, especially since Pine v5.
First, the anchor period changed, when I've switched between regular and extended trading hours.
- This meant, that the anchor switched between the official open of the day and the first bar of a new day beginnig at 00:00 UTC (or the corresponding timezone).
Second, thus in some scripts also changed the calculated average range, including or excluding pre market and after hours.
And therefor third, in many cases the distance between open and ADR high/low was indiffferent, putting one closer and the other further away.
Why is that?
After having tried seven different modes of calulation - from ta. to array, it appeared that especially since Pine v5 the calulation is lagging when calling
the request.security function and is thus rendering the calculations indifferent.
Especially the open is lagging and plotting delayed, about 15 minutes on a M1-chart or about 45 minutes on a M15 chart, which made id difficult to spot open (test) drives
- as f.e. described in Dalton, J. F., Jones, E. T., & Dalton, R. B. (1990). Mind over markets: power trading with market generated information. 1st edition . Probus. -
and estimating extremely strong or weak open moves.
While switching between regular and extended intraday charts, the open was either calculated on the open as request of "D" (open of the regular session)
and "1440" (which means full intraday since 00:00 UTC or the corresponding timezone), leading to undesired anchoring.
After having tried about five different anchoring periods and comparing the adr to @TradingView 's stock screener, there was no proper calulation or plotting possible,
if not partially hardcoded (being the least desired, elegant or flexible method).
Visualizing the problem
As described in the picture:
@sherwind 's ADR is plotting entirely wrong! I couldn't even figure out (even the source is available) whre the problem is rooted.
@treypeng 's ADR is anchored properly, but unfortunately the calculation is wrong.
Originality
As evident in the attached picture - and you are able to compare this to @TradingView 's stock screener - in this script as well the ADR is calculated PROPERLY
as well as the anchoring is set PROPERLY within the first tick of the session.
As matter of fact, you don't have to examine different timeframes, charts or sessions simoultaneously to see the correct levels and
you're able to ease observations and focus on your trading.
Innovation
There is no innovative approach, as described above, simply because this statistical approach is around since the 1960's.
Considering coding, neither is, but it is properly calculated and anchored.
What this script does
Anchoring at the first tick of the new New York session
Plotting the actual - not the past nor future - average day range (gray lines in picture)
Plotting the actual - not the past nor future - 75% average day range ( silver lines in picture)
Vizualising ADR breakouts by colouring the backround green (long breakout) or read (short breakout)
Selection methods
Keeping it simple stupid, as of now:
Abiliy to chose between 5/10/14/20 days
Additional
Theory says, that we are staying within the ADR of 75% every day.
_
Alas, there are some exceptions.
If price is breaking out of the ADR, we are likely to move in this direction for the rest of the day.
If price has broken out of the ADR on the previous day, ist highly unlikely to expect another ADR breakout day,
which doesn't mean that there might not appear a strong or weak second day.
Notes
Designed for intraday stock trading of the U.S. market.
Best (and easiest) chances are to be spotted in special conditions.
//Cheers,
//Constantine
Dealar VIX Implied Range + Retracement LevelsThis Implied range Is derived by the VIX(1 sd annual +/- Implied move.)
This Indicator plots the daily Implied range, A lot of quantitative trading firms/ MM firms hedge their delta & gamma exposure around the Implied range(prop calc). I have added retracement levels as well, so you have more pivot levels.
Enjoy!
Full Volatility Statistics and Forecast
This is a tool designed to translate the data from the expected volatility of different assets, such as for example VIX, which measures the volatility of SP500 index.
Once get the data from the volatility asset we want to measure(for this test I have used VIX), we are going to translate it the required timeframe expected move by dividing the initial value into :
252 = if we want to use the daily timeframe, since there are ~252 aproximative daily trading days
52 = if we want to use the weekly timeframe, since there 52 trading weeks in a year
12 = if we want to use the monthly timeframe, since there are 12 months in a year
For this example I have used 252 with the daily timeframe.
In this scenario, we can see that we had 5711 total cnadles which we analysed, and in this case, we had 942 crosses, where the daily movement ended up either above or below the channel made from the opening daily candle value + expected movement from the volatility, giving as a total of 16.5% of occurances that volatility was higher than expected, and in 83.5% of the times, we can see that the price stayed within our channel.
At the same time, we can see that we had 6 max losses in a row ( OUT) AND 95 max wins in a row (IN), and at the same time in those moments when the volatility crosses happen we had a 0.51% avg movements when the top crossed happened, and 0.67% avg movements when the bot happened.
Lastly on the second part of the panel, we had E which means the expected movement of today, for example it has 61.056$ , so lets say price opened on 4083, our top is 4083 + 61 and our bot is 4083 - 61 ( giving us the daily channel). At continuation we can see that overall the avg bull candle os 0.714% and avg bear candle was 0.805% .
I hope this tool will help you with your future analysis and trades !
If you have any questions please let me know !
Relevant Populations GroupedUSPOP Same idea as my previous grouped GDP indicator but now population sizes. Goes to show how a small portion of the world is responsible for most of what we consider economic productivity.