Q-TrendQ-Trend is an multipurpose indicatorm that can be used for swing- and trend-trading equally on any timeframe (non-volatile markets are better for this thing).
Settings:
Trend period - used to calculate trend line in the special moments(will explain below);
ATR Multiplier - changes sensitivity. The higher the multiplier = the more sensitive it is.
Also option to smooth source data (helps get cleaner signals, as always).
How to use?
Signals are given on the chart. Also ou can use trend line as S/R line.
The idea behind:
Terms:
SRС = Source
TL = trend line;
MP = ATR multiplier;
ATR = ATR :)
TL = (highest of source P-bars back + lowest of source P-bars back) / 2
Epsilon = MP * ATR
I was thinking for a week about combining volatility and relation between highest and lowest price point. That why I called indicator Q-Trend = Quantitative Trend , as I was trying to think about price in a mathematical way.
Okay, time to go philosophical:
1) TL is shows good price trend, but as it is slow enough and not enough informative, we need add additional conditions to produce signals.
2) Okay, so what can we add as conditions? We need to take volatility into account, as it is crucial in the moments of market uncertainty. So let's use ATR (Average True Range) somehow. My idea is that if SRC breaks TL + ATR , then it means that there will be upmove and we update our TL . Analogically for SRC breaking TL - ATR (breaks are crosses of TL +- ATR lines) .
Conclusion:
- if SRC breaks TL + ATR , it is a BUY signal and update of trend line;
- if SRC breaks TL - ATR , it is a SELL signal and update of trend line;
I think that such indicator already exisits on TradingView, as I've already saw something similar, but long ago, so please don't report, if such thing already exists.
But if not, then I hope, that you will gain some profits with Q-Trend :)
I will continue my work on this thing, so stay tuned.
Trade with your own risks and have your profits!
Wish you all the best!
- Tarasenko Fyodor
Forecasting
VOLQ Sigma TableThis indicator replaces the implied volatility of VOLQ with the daily volatility and reflects that value into the price on the NDX chart to create the VOLQ standard deviation table.
It will only be useful for stocks related to the Nasdaq Index.
For example, NDX, QQQ or so.
And we want to predict the range of weekly fluctuations by plotting those values as a line in the future.
It is expressed as High 2σ by adding the standard deviation 2 sigma value of the VOLQ value from last week's closing price.
It is expressed as High 1σ by adding the standard deviation 1 sigma value of the VOLQ value from last week's closing price.
It is expressed as Low 1σ by subtracting the standard deviation 1 sigma value of the VOLQ value from the closing price of the previous week.
It is expressed as Low 2σ by subtracting the standard deviation 2 sigma value of the VOLQ value from last week's closing price.
1day predicts daily fluctuations.
2day predicts 2-day fluctuations.
3day predicts 3-day fluctuations.
4day predicts 4-day fluctuations.
5day predicts 5-day fluctuations.
In the settings you can select the start date to display the VOLQ line via input.
-----------------------------
What motivated me to create this indicator?
From my point of view, the reason for classifying vix volq historical volatility (realized volatility) is that the most important point is that VIXX and VolQ are calculated from implied volatility. It can be standardized as one-month volatility. There are many strike prices, but exchanges use the implied volatility of options traded on their own exchanges.
Because historical volatility depends on how the period is set, to compare with VIXX, we compare it with a month, that is, 20 business days. One-month implied volatility means (actually different depending on the strike price), because option traders expect that the one-month volatility will be this much, and it is the volatility created by volatility trading.
So we see it as the volatility expected by derivatives traders, especially volatility traders.
I'm trying to infer what the market thinks will fluctuate this much from the numbers generated there.
ILM Seasonality Big Moves - TableUse this script on Daily Timeframe.
This script calculates Daily Moves ( Intraday / Close basis ) and buckets them into 1% / 2% / 3% moves
Also calculates MAX DD for the financial year from Peak to Trough
Helps in identifying volatility of the instrument and high drawdowns due to volatility
Pinbar by BirdCoinIt is the most customizable Pinbars indicator that you can find.
The indicator autonomously detects the Pinbars to which filters can be placed. The available adjustments are:
- The spread of the Pinbars
- The wick and the body ratio of the Pinbars
- The volume of the Pinbars
- Number of the previous candles that the Pinbars hunted
Happy trading!
~ Birdcoin
Spider Lines For Bitcoin (Daily And Weekly)I haven't seen any indicator do this, so I decided to publish this to form automatic Spider Charts without actually going through the effort of drawing them!
This script charts dotted lines (spider lines) all over, depicting support and resistance levels.
It works by connecting some candles from the 2018 bear market to the candle from 1st July 2019, followed by extending the lines to the right, making support and resistance levels for the future. The script works only for the daily and weekly charts for Bitcoin.
The levels are accurate to a good extent.
If the lines don't load, zoom out until the 2018 bear market top and it should load then.
Have fun with this indicator!
Seasonality Table - Tabular FormThis indicator displays the seasonality data for any instrument (index/stock/futures/currency) in a tabular data.
User can change the start of the year for analysis from the inputs.
Year is represented in rows and Month is represented in cols.
This indicator uses Monthly Data feed to calculate the % change
Summary data for the month is displayed as the last row
Relative Market Status by @WilliamBeliniWhat is the impact for Volume to the Prices?
To respond this question, I formulate the hipótesis if a little Volume change a lot the Price, it's a reversion signal, and if a lot of Volume change a little the price, it´s because the price is established.
This is one of 3 indicators created to improve this hipótesis, named:
1. Relative Volume Prices Index by @WilliamBelini (RVPI)
2. Relative Market Status by @WilliamBelini (RMS)
3. Trade Trigger RVPI by @WilliamBelini (TTR)
- The first show you the effect from volume to the prices, meas the sensibility of the variation;
- The second show you the feeling of the market by cicles, based at the cumulative average sensibility from the RVPI indicator;
- The third show you a trigger to trading positions, with the analysis of the historical RVPI data, based on the normal distribution of the futures price variation, by previos RVPI values and some rules created based on data behaviors identified.
To the end of this work, I can comprove the hipótesis, with simulations trading based from the TTR.
How we can´t monetize our work here, on TradingView platform, I´m disponibilize 2 of 3 indicators for you here free. If you want to have the third, discover how to contact with me (@ ;), and for me will be a pleasure to help you.
Relative Volume Prices Index by @WilliamBeliniWhat is the impact for Volume to the Prices?
To respond this question, I formulate the hipótesis if a little Volume change a lot the Price, it's a reversion signal, and if a lot of Volume change a little the price, it´s because the price is established.
This is one of 3 indicators created to improve this hipótesis, named:
1. Relative Volume Prices Index by @WilliamBelini (RVPI)
2. Relative Market Status by @WilliamBelini (RMS)
3. Trade Trigger RVPI by @WilliamBelini (TTR)
- The first show you the effect from volume to the prices, meas the sensibility of the variation;
- The second show you the feeling of the market by cicles, based at the cumulative average sensibility from the RVPI indicator;
- The third show you a trigger to trading positions, with the analysis of the historical RVPI data, based on the normal distribution of the futures price variation, by previos RVPI values and some rules created based on data behaviors identified.
To the end of this work, I can comprove the hipótesis, with simulations trading based from the TTR.
How we can´t monetize our work here, on TradingView platform, I´m disponibilize 2 of 3 indicators for you here free. If you want to have the third, discover how to contact with me (@ ;), and for me will be a pleasure to help you.
Capital Asset Pricing Model (CAPM) [Loxx]Capital Asset Pricing Model (CAPM) demonstrates how to calculate the Cost of Equity for an underlying asset using Pine Script. This script will only work on the monthly timeframe. While you can change the default inputs, you should study what CAPM is and how this works before doing so. This indicator pulls various types of data from SPY from various timeframes to calculate risk-free rates, market premiums, and log returns. Alpha and Beta are computed using the regression between underlying asset and SPY. This indicator only calculates on the most recent data. If you wish to change this, you'll have to save the script and make adjustments. A few examples where CAPM is used:
Used as the mu factor Geometric Brownian Motion models for options pricing and forecasting price ranges and decay
Calculating the Weighted Average Cost of Capital
Asset pricing
Efficient frontier
Risk and diversification
Security market line
Discounted Cashflow Analysis
Investment bankers use CAPM to value deals
Account firms use CAPM to verify asset prices and assumptions
Real estate firms use variations of CAPM to value properties
... and more
Details of the calculations used here
Rm is calculated using yearly simple returns data from SPY, typically this is just hard coded as 10%.
Rf is pulled from US 10 year bond yields
Beta and Alpha are pulled form monthly returns data of the asset and SPY
In the past, typically this data is purchased from investments banks whose research arms produce values for beta, alpha, risk free rate, and risk premiums. In 2022 ,you can find free estimates for each parameter but these values might not reflect the most current data or research.
History
The CAPM was introduced by Jack Treynor (1961, 1962), William F. Sharpe (1964), John Lintner (1965) and Jan Mossin (1966) independently, building on the earlier work of Harry Markowitz on diversification and modern portfolio theory. Sharpe, Markowitz and Merton Miller jointly received the 1990 Nobel Memorial Prize in Economics for this contribution to the field of financial economics. Fischer Black (1972) developed another version of CAPM, called Black CAPM or zero-beta CAPM, that does not assume the existence of a riskless asset. This version was more robust against empirical testing and was influential in the widespread adoption of the CAPM.
Usage
The CAPM is used to calculate the amount of return that investors need to realize to compensate for a particular level of risk. It subtracts the risk-free rate from the expected rate and weighs it with a factor – beta – to get the risk premium. It then adds the risk premium to the risk-free rate of return to get the rate of return an investor expects as compensation for the risk. The CAPM formula is expressed as follows:
r = Rf + beta (Rm – Rf) + Alpha
Therefore,
Alpha = R – Rf – beta (Rm-Rf)
Where:
R represents the portfolio return
Rf represents the risk-free rate of return
Beta represents the systematic risk of a portfolio
Rm represents the market return, per a benchmark
For example, assuming that the actual return of the fund is 30, the risk-free rate is 8%, beta is 1.1, and the benchmark index return is 20%, alpha is calculated as:
Alpha = (0.30-0.08) – 1.1 (0.20-0.08) = 0.088 or 8.8%
The result shows that the investment in this example outperformed the benchmark index by 8.8%.
The alpha of a portfolio is the excess return it produces compared to a benchmark index. Investors in mutual funds or ETFs often look for a fund with a high alpha in hopes of getting a superior return on investment (ROI).
The alpha ratio is often used along with the beta coefficient, which is a measure of the volatility of an investment. The two ratios are both used in the Capital Assets Pricing Model (CAPM) to analyze a portfolio of investments and assess its theoretical performance.
To see CAPM in action in terms of calculate WACC, see here for an example: finbox.com
Further reading
en.wikipedia.org
Position Tool█ OVERVIEW
This script is an interactive measurement tool that can be used to evaluate or keep track of trades. Like the long and short position drawing tools, it calculates a risk reward ratio and a risk-adjusted position size from the entry, stop and take profit levels, but it also does much more:
• It can be used to configure long or short trades.
• All monetary values can be expressed in any number of currencies.
• The value of tick/pip movement (which varies with the position's size) is displayed in the currency you have selected.
• The CAGR ( Compound Annual Growth Rate ) for the trade can be displayed.
• It does live tracking of the position.
• You can configure alerts on entries and exits.
█ HOW TO USE IT
Load the indicator on an active chart (see here if you don't know how).
When you first load this script on a chart, you will enter an interactive selection mode where the script asks you to pick three points in price and time on your chart by clicking on the chart. Directions will appear in a blue box at the bottom of the screen with each click of the mouse. The first selection is the entry point for the trade you are considering, which takes into account both the time and level you choose, the next are the take profit and stop levels. Once you have selected all three points, the script will draw trade zones and labels containing the trade metrics. The script determines if the trade is a long or short from the position of the take profit and stop loss levels in relation to the entry price. If the take profit level is above the entry price, the stop must be below and vice versa, otherwise an error occurs.
You can change levels by dragging the handles that appear when you select the indicator, or by entering new values in the script's settings. The only way to re-enter interactive mode is to re-add the indicator to your chart.
Once you place the position tool on a chart, it will appear at the same levels on all symbols you use. If your scale is not set to "Scale price chart only", the position tool's levels will be taken into account when scaling the chart, which can cause the symbol's bars to be compressed. If your scale is set to "Scale price chart only", the position tool will still be there, but it will not impact the scale of the chart's bars, so you won't see it if it sits outside the symbol's price scale.
If you select the position tool on your chart and delete it, this will also delete the indicator from the chart. You will need to re-add it if you want to draw another position tool. You can add multiple instances of the indicator if you need a position tool on more than one of your charts.
█ FEATURES
Display
The position tool displays the following information for entries:
• The entry's price level with an '@' sign before it.
• Open or Closed P&L : For an open trade, the "Open P&L" displays the difference in money value between the entry level and the chart's current price.
For a closed trade, the "Closed P&L" displays the realized P&L on the trade.
• Quantity : The trade size, which takes into account the risk tolerance you set in the script's settings.
• RR : The reward to risk ratio expresses the relationship of the distance between the entry and the take profit level vs the entry and the stop level.
Example: A $100 stop with a $100 target will have a ratio of 1:1, whereas a $200 target with the same stop will have a 2:1 ratio.
• Per tick/pip : Represents the money value of a tick or pip movement.
• CAGR : The Compound Annual Growth Rate will be displayed on the main order label on trades that exceed one day in duration.
This value is calculated the same way as in our CAGR Custom Range indicator.
If the trade duration is less than one day, the metric will not be present in the display.
The stop and take profit levels display:
• Their price level with an '@' sign before it.
• Their distance from the entry in money value, percentage and ticks/pips.
• The projected end money value of the position if the level is reached. These values are calculated based on the trade size and the currency.
Currency adjustments
This indicator modifies the trade label's colors and values based on the final Profit and Loss (P&L), which considers the dynamic exchange rate between base and conversion currencies in its calculations when the conversion currency is a specified value other than the default. Depending on the cross rate between the base and account currencies, this process can yield a negative P&L on an otherwise successful simulated trade.
For instance, if your account is in currency XYZ, you might buy 10 Apple shares at $150 each, with the XYZ to USD exchange rate being 2:1. This purchase would cost you 3000 units of XYZ. Suppose that later on, the shares appreciate to $170 each, and you decide to sell. One might expect this trade to result in profit. However, if the exchange rate has now equalized to 1:1, the return on selling the shares, calculated in XYZ, would only be 1700 units, resulting in a loss of 1300 units XYZ.
The indicator will mark the P&L and the target labels in red in such cases, regardless of whether the market price reached the profit target, as the trade produced a net loss due to reduced funds after currency conversion. Conversely, an otherwise unsuccessful position can result in a net profit in the account currency due to conversion rate fluctuations. The final losses or gains appear in the label metrics, and the corresponding color coding reflects the trade's success or failure.
Settings
The settings in the "Trade sizing" section are used to calculate the position size and the monetary value of trades. Two types of risk can be chosen from the menu; a percentage based risk calculation, or a fixed money value. The risk is used to calculate the quantity of units to purchase to achieve that level of risk exposure. Example: An account size of $1000 and 10% risk will have a projected end amount of $900 if the stop loss is hit. The quantity is a product of this relationship; a projected number of units to allow for the equivalent of $100 of risk exposure over the change in price from the entry to the stop value.
The "Trade levels" allow you to manually set the entry, take profit and stop levels of an existing position tool on your chart.
You can control the appearance of the tool and the values it displays in the settings following these first two sections.
Alerts
Three alerts that will trigger when you configure an alert on this indicator. The first will send an alert when the entry price is breached by price action if that price has not already been breached in the previous price history. This is dependant on the entry location you select when placing the indicator on the chart. The other two alerts will trigger when either the stop loss or the take profit level is breached to signal that a trade exit has occurred.
█ NOTES FOR Pine Script™ CODERS
• Interactive inputs are implemented for input.time() and input.price() . These specialized input functions allow users to interact with a script.
You can create one interactive input for both time and price values by using the same `inline` argument in a pair of input.time() and input.price() function calls.
• We use the `cagr()` function from our ta library.
• The script uses the runtime.error() function to throw an error if the stop and limit prices are not placed on opposing sides of the entry price.
• We use the `currency` parameter in a request.security() call to convert currencies.
Look first. Then leap.
DB Change Forecast ProDB Change Forecast Pro
What does the indicator do?
The DB Change Forecast Pro is a unique indicator that uses price change on HLC3 to detect buy and sell periods along with plotting a linear regression price channel with oversold and undersold zones. It also has a linear regression change forecast mode to optionally project market direction.
Change is calculated by taking a two-bar change of HLC3 and dividing that by the price or, optionally, a fixed divisor.
A fast-moving change cloud is then calculated and displayed as the "regular version" plot (shown in light gray). When the cloud bottom is above low, a buy zone is detected. When the cloud top is below the high, a sell zone is detected.
The linear regression price channel is calculated similarly but using a much slower change rate. The linear regression price channel shows reasonable high, low and HLC3 ranges. At the bar's opening, the channel will be more compact and come fairly accurate about 1/4 into the bar timeframe.
The change forecasted price is projected on the right side of the current bar to indicate the current timeframe direction. Please note this forecasting feature is shown in orange when it's early in the timeframe and gray when the timeframe is more likely to produce an accurate direction forecast for the upcoming bar.
You can use these projected dashed lines to see possible market movements for the Current bar and possible market direction for the next bar. Kindly note these projects change; they should be used to understand possible extreme highs/lows for the current bar or market direction.
The indicator includes an optional change forecast projection feature hidden by default. It will project the market forecast channel with an offset of 1. The forecast is defaulted to an offset of 1 to show market direction. However, you can modify to zero the offset to show the current bar forecast and forecast history.
How should this indicator be used?
First, very important,
1. Settings > Set Symbol to Desired
2. Settings > Set High Timeframe to "Chart"
3. Settings > Ensure "Use price as divisor" is checked.
It's recommended to use this indicator in higher timeframes. Buy and sell signals are displayed in real-time. However, waiting until 1/4 to 1/2 into the current bar is recommended before taking action, and change can happen.
The buy/sell signals (zones) provide recommendations on playing a long vs. a short. When in a buy sone, only play longs. When in a sell zone, only play shorts.
Then use the linear regression price channel oversold and undersold zones to optionally open and close positions within the buy/sell zones.
For example, consider opening a long in a buy zone when the linear regression price channel shows undersold. Then consider closing the long when the price moves into the linear regression oversold or higher. Then repeat as long as it's in the buy zone. Then vice versa for sell zones and shorting.
At basic design, buy in the buy zone, sell or short in the sell zone. If you are up for higher trading frequencies, use the linear regression price channel as described in the example above.
Please note, as, with all indicators, you may need to adjust to fit the indicator to your symbol and desired timeframe.
This is only an example of use. Please use this indicator as your own risk and after doing your due diligence.
Does the indicator include any alerts?
Yes,
"DB CFHLC3: Signal BUY" - Is triggered when a buy signal is fired.
"DB CFHLC3: Signal SELL" - Is triggered when a sell signal is fired.
"DB CFHLC3: Zone BUY" - Is triggered when a buy zone is detected.
"DB CFHLC3: Zeon SELL" - Is triggered when a sell zone is detected.
"DB CFHLC3: Oversold SELL" - Is triggered when the price exceeds the oversold level.
"DB CFHLC3: Undersold BUY" - Is triggered when the price goes below the undersold level.
Any other tips?
Once you have configured the indicator for your symbol and chart timeframe. Meaning the plots are displayed over the price. Check out larger timeframes such as W, 2W, 3W, 4W, M, and 4M. It works wonderfully for showing market lows and highs for long-term investing too!
Another, tip is to combine it with your favorite indicator, such as TTM Squeeze or MACD for confirmation purposes. You may be surprised how fast the indicator shows market direction changes on higher timeframes.
You can just as easily use a high timeframe such as D, 2D, or 3D for day trading due to how the linear price channel works.
Why am I not selling this indicator?
I would like to bless the TradingView community, and I enjoy publishing custom indicators.
If you enjoy this indicator, please consider leaving a thumbs up or a comment for others to know about your experience or recommendations.
Enjoy!
RSI Trend Veracity (RSI TV)The RSI only plots itself between a high and a low value. It does not show its bullish/bearish sentiment.
The RSI TV shows the sentiment and helps anticipate the RSI trend but not the price trend.
When the Trend Veracity Line is in green, there is bullish sentiment. When it is in red, there is bearish sentiment.
The closer the lines get to their extremities, the more the current trend of the RSI is exhausted.
It works quite well even in choppy markets. See notes in the picture for more details.
Adaptive Rebound Line Bands (ARL Bands)These bands consist of 4 ARLs (See: Adaptive Rebound Line ('ARL'/AR Line)) that help accurately spot price rebounds.
It is excellent for 15 minute scalping and price-action trading.
See notes in the picture above for more details.
Note: "Top Deviation" is the deviation of the top 'ARL', "High Deviation" is for the high 'ARL', etc.
Chart CAGR█ OVERVIEW
This simple script displays in the lower-right corner of the chart the Growth Rate and the Compound Annual Growth Rate (CAGR) between the open of the chart's first visible bar and the close of its last bar. As you zoom/scroll the chart, calculations will adjust to the chart's bars. You can change the location and colors of the displayed text in the script's settings.
If you need to calculate the CAGR between any two points on the chart, see our CAGR Custom Range indicator.
█ FOR Pine Script™ CODERS
Like our Chart VWAP publication, this script calculates on the range of visible bars utilizing the new Pine Script™ functions announced here and the VisibleChart library by PineCoders . It also uses the `cagr()` function from our ta library, which was recently augmented with many new functions.
Look first. Then leap.
Recession And Bull Run WarningThis script uses 2 moving averages of Unemployment and projects a possible recession period or bull run period.
A Red Dot means a recession could've started or is coming soon - markets could possibly fall for the next few months.
A Green Dot means a bull run could begin following a recessionary period - markets could possibly rally for the next few months.
Using Unemployment to define recessionary periods has been highly accurate and has very often predicted many downturns and bull runs way before they occurred, as history suggests of course.
Have fun with this indicator!
Performance Tablethis scrip is modified of Performance Table () of TradingView user @BeeHolder = Thank u very much.
-
@BeeHolder formula is based on daily basis,
but my calculation is based on respective day, week and month.
-
The formula of the calculation is (Current Close - Previous Close) * 100 / Previous Close, where Past value is:
1D = close 1 day before
5D = close 5 day before
1W - close 1 week before
4W = close 4 week before
1M - close 1 month before
3M - close 3 month before
6M - close 6 month before
12M - close 12 month before
52W - close 52 week before
Also table position cane be set.
thank you all
-
thuyliemforever EMA Scalper - Buy/Sellthuyliemforever EMA Scalper - Buy/Sell
Indicator that help you make decision buy or sell.
[blackcat] L3 Candle Skew 3821 TraderLevel 3
Background
By modeling skew to produce long and short entry points.
Function
The concept of skew comes from physics and statistics, and is used in market technical analysis to reflect the expectation of future stock price distribution. Because the return distribution of stocks in the trend market has skew (Skew), it is reasonable to judge the trend continuity according to the historical and current skew. It is precisely because the stock price rises that there is a skew. The greater the strength of the rise, the greater the angle of inclination and the greater the skew. The degree of this upward or downward slope in the statistical distribution of stock prices is defined as skew. Through the size of skew, we can know the direction, inertia and extent of the stock's rise or fall, and find stocks with a high probability of quick profit. The technical indicator introduced today is a simplified but effective stock price skew model used to generate buying and selling points.
The principle of this technical indicator is based on the success rate test results of different moving averages corresponding to different skews as follows:
10 trading cycles profit 5% success rate (%)
5 period moving average 10 period moving average 20 period moving average 30 period moving average 60 period moving average
skew>=0 51.36 52.26 52.65 52.55 52.08
skew>=0.5 55.44 58.06 60.56 62.37 65.66
skew>=1 59.72 63.06 67.07 69.78 70.62
skew>=1.5 63.01 67.08 71.61 72.9 70.61
skew>=2 65.53 70.22 74.18 73.76 70.12
skew>=2.5 67.89 72.93 75.32 73.66 68.92
skew>=3 70.07 75.32 75.69 72.54 67.45
skew>=3.5 71.85 77.05 75.32 73.63 63.82
skew>=4 73.6 78.06 74.19 68.96 59.91
skew>=4.5 76.04 78.56 72.85 69.55 49.24
skew>=5 77.44 78.88 71.58 67.28 51.69
skew>=5.5 78.97 78.39 70.33 64.31 49.7
skew>=6 79.68 78.07 68.82 61.65 53.57
Table 1
As can be seen from the above table, with the increase of the 5-period and 10-period moving average skew values, the success rate is increasing, but after the 20- and 30-period moving average skew values increase to an upper bound, it shows a downward trend. When the skew of the 20-period and 30-period moving averages is greater than 0.5, the 10-period profit of 5% is above 60%, and when it is greater than 1.5, the success rate can reach above 70%. The larger the 5-period moving average skew, the higher the success rate, but often because the short-term skew is too large, the stock price has risen rapidly to a high level, and chasing up is risky, which is not suitable for the investment habits of most people, so prudent investors may like to do swings. Investors may wish to pay more attention to the skew of the 20-period and 30-period moving averages. Based on the above analysis, as a short-term trading enthusiast, I need to choose the 5-period and 10-period moving average skew, and consider the medium-term trend as a compromise, and I also need to consider the 20-period moving average skew. Finally, according to the principle of personal preference, I chose 3 groups of periods based on Fibonacci magic numbers: 3 periods, 8 periods, 21 periods, and skews that take into account both short-term and mid-line trends. So, I named this indicator number 3821 as a distinction.
002084 1D from TradingView
BTCUSDT 1H from TradingView
Tesla 1D from TradingView
Candlestick Pattern Criteria and Analysis Indicator█ OVERVIEW
Define, then locate the presence of a candle that fits a specific criteria. Run a basic calculation on what happens after such a candle occurs.
Here, I’m not giving you an edge, but I’m giving you a clear way to find one.
IMPORTANT NOTE: PLEASE READ:
THE INDICATOR WILL ALWAYS INITIALLY LOAD WITH A RUNTIME ERROR. WHEN INITIALLY LOADED THERE NO CRITERIA SELECTED.
If you do not select a criteria or run a search for a criteria that doesn’t exist, you will get a runtime error. If you want to force the chart to load anyway, enable the debug panel at the bottom of the settings menu.
Who this is for:
- People who want to engage in TradingView for tedious and challenging data analysis related to candlestick measurement and occurrence rate and signal bar relationships with subsequent bars. People who don’t know but want to figure out what a strong bullish bar or a strong bearish bar is.
Who this is not for:
- People who want to be told by an indicator what is good or bad or buy or sell. Also, not for people that don’t have any clear idea on what they think is a strong bullish bar or a strong bearish bar and aren’t willing to put in the work.
Recommendation: Use on the candle resolution that accurately reflects your typical holding period. If you typically hold a trade for 3 weeks, use 3W candles. If you hold a trade for 3 minutes, use 3m candles.
Tldr; Read the tool tips and everything above this line. Let me know any issues that arise or questions you have.
█ CONCEPTS
Many trading styles indicate that a certain candle construct implies a bearish or bullish future for price. That said, it is also common to add to that idea that the context matters. Of course, this is how you end up with all manner of candlestick patterns accounting for thousands of pages of literature. No matter the context though, we can distill a discretionary trader's decision to take a trade based on one very basic premise: “A trader decides to take a trade on the basis of the rightmost candle's construction and what he/she believes that candle construct implies about the future price.” This indicator vets that trader’s theory in the most basic way possible. It finds the instances of any candle construction and takes a look at what happens on the next bar. This current bar is our “Signal Bar.”
█ GUIDE
I said that we vet the theory in the most basic way possible. But, in truth, this indicator is very complex as a result of there being thousands of ways to define a ‘strong’ candle. And you get to define things on a very granular level with this indicator.
Features:
1. Candle Highlighting
When the user’s criteria is met, the candle is highlighted on the chart.
The following candle is highlighted based on whether it breaks out, breaks down, or is an inside bar.
2. User-Defined Criteria
Criteria that you define include:
Candle Type: Bull bars, Bear bars, or both
Candle Attributes
Average Size based on Standard Deviation or Average of all potential bars in price history
Search within a specific price range
Search within a specific time range
Clarify time range using defined sessions and with or without weekends
3. Strike Lines on Candle
Often you want to know how price reacts when it gets back to a certain candle. Also it might be true that candle types cluster in a price region. This can be identified visually by adding lines that extend right on candles that fit the criteria.
4. User-Defined Context
Labeled “Alternative Criteria,” this facet of the script allows the user to take the context provided from another indicator and import it into the indicator to use as a overriding criteria. To account for the fact that the external indicator must be imported as a float value, true (criteria of external indicator is met) must be imported as 1 and false (criteria of external indicator is not met) as 0. Basically a binary Boolean. This can be used to create context, such as in the case of a traditional fractal, or can be used to pair with other signals.
If you know how to code in Pinescript, you can save a copy and simply add your own code to the section indicated in the code and set your bull and bear variables accordingly and the code should compile just fine with no further editing needed.
Included with the script to maximize out-of-the-box functionality, there is preloaded as alternative criteria a code snippet. The criteria is met on the bull side when the current candle close breaks out above the prior candle high. The bear criteria is met when the close breaks below the prior candle. When Alternate Criteria is run by itself, this is the only criteria set and bars are highlighted when it is true. You can qualify these candles by adding additional attributes that you think would fit well.
Using Alternative Criteria, you are essentially setting a filter for the rest of the criteria.
5. Extensive Read Out in the Data Window (right side bar pop out window).
As you can see in the thumbnail, there is pasted a copy of the Data Window Dialogue. I am doubtful I can get the thumbnail to load up perfectly aligned. Its hard to get all these data points in here. It may be better suited for a table at this point. Let me know what you think.
The primary, but not exclusive, purpose of what is in the Data Window is to talk about how often your criteria happens and what happens on the next bar. There are a lot of pieces to this.
Red = Values pertaining to the size of the current bar only
Blue = Values pertaining or related to the total number of signals
Green = Values pertaining to the signal bars themselves, including their measurements
Purple = Values pertaining to bullish bars that happen after the signal bar
Fuchsia = Values pertaining to bearish bars that happen after the signal bar
Lime = Last four rows which are your percentage occurrence vs total signals percentages
The best way I can explain how to understand parts you don’t understand otherwise in the data window is search the title of the row in the code using ‘ctrl+f’ and look at it and see if it makes more sense.
█ [b}Available Candle Attributes
Candle attributes can be used in any combination. They include:
[*}Bodies
[*}High/Low Range
[*}Upper Wick
[*}Lower Wick
[*}Average Size
[*}Alternative Criteria
Criteria will evaluate each attribute independently. If none is set for a particular attribute it is bypassed.
Criteria Quantity can be in Ticks, Points, or Percentage. For percentage keep in mind if using anything involving the candle range will not work well with percentage.
Criteria Operators are “Greater Than,” “Less Than,” and “Threshold.” Threshold means within a range of two numbers.
█ Problems with this methodology and opportunities for future development:
#1 This kind of work is hard.
If you know what you’re doing you might be able to find success changing out the inputs for loops and logging results in arrays or matrices, but to manually go through and test various criteria is a lot of work. However, it is rewarding. At the time of publication in early Oct 2022, you will quickly find that you get MUCH more follow through on bear bars than bull bars. That should be obvious because we’re in the middle of a bear market, but you can still work with the parameters and contextual inputs to determine what maximizes your probability. I’ve found configurations that yield 70% probability across the full series of bars. That’s an edge. That means that 70% of the time, when this criteria is met, the next bar puts you in profit.
#2 The script is VERY heavy.
Takes an eternity to load. But, give it a break, it’s doing a heck of a lot! There is 10 unique arrays in here and a loop that is a bit heavy but gives us the debug window.
#3 If you don’t have a clear idea its hard to know where to start.
There are a lot of levers to pull on in this script. Knowing which ones are useful and meaningful is very challenging. Combine that with long load times… its not great.
#4 Your brain is the only thing that can optimize your results because the criteria come from your mind.
Machine learning would be much more useful here, but for now, you are the machine. Learn.
#5 You can’t save your settings.
So, when you find a good combo, you’ll have to write it down elsewhere for future reference. It would be nice if we could save templates on custom indicators like we can on some of the built in drawing tools, but I’ve had no success in that. So, I recommend screenshotting your settings and saving them in Notion.so or some other solid record keeping database. Then you can go back and retrieve those settings.
#6 no way to export these results into conditions that can be copy/pasted into another script.
Copy/Paste of labels or tables would be the best feature ever at this point. Because you could take the criteria and put it in a label, copy it and drop it into another strategy script or something. But… men can dream.
█ Opportunities to PineCoders Learn:
1. In this script I’m importing libraries, showing some of my libraries functionality. Hopefully that gives you some ideas on how to use them too.
The price displacement library (which I love!)
Creative and conventional ways of using debug()
how to display arrays and matrices on charts
I didn’t call in the library that holds the backtesting function. But, also demonstrating, you can always pull the library up and just copy/paste the function out of there and into your script. That’s fine to do a lot of the time.
2. I am using REALLY complicated logic in this script (at least for me). I included extensive descriptions of this ? : logic in the text of the script. I also did my best to bracket () my logic groups to demonstrate how they fit together, both for you and my future self.
3. The breakout, built-in, “alternative criteria” is actually a small bit of genius built in there if you want to take the time to understand that block of code and think about some of the larger implications of the method deployed.
As always, a big thank you to TradingView and the Pinescript community, the Pinescript pros who have mentored me, and all of you who I am privileged to help in their Pinescripting journey.
"Those who stay will become champions" - Bo Schembechler
SMA 10/20/50 by Bull Bear Investing BabyThis script basically is a combination of 3 different simple moving averages line to determine the trend of the assets
The colour indicating which moving averages are as per following:
1) Green- 10MA
2) Red- 20MA
3) Blue- 50MA
When the moving averages are aligned as per following, the trend is indicating towards an uptrend:
---> 10ma > 20ma > 50ma
Likewise when the moving averages are aligned as per following, the trend is indicating towards a downtrend:
---> 10ma < 20ma < 50ma
Calculate target by Range [Wyckoff,PnF]First of all, I would like to thank the author @LonesomeTheBlue.
This indicator developed on the source code "Point and Figure (PnF)" by author @LonesomeTheBlue.
This indicator calculate the range (Cause) of Phase accumulation or distribution to calculate the taget (Effect) based on the Wyckoff Method.
Formula for calculate move value target : Col * BoxSize * Reversal
Col -> Number of Column (PnF) in the range (Cause)
BoxSize -> Value in one Box (PnF)
Reversal -> Reversal (PnF)
Faytterro Estimator StrategyWhat is "Faytterro Estimator Strategy"?
"Faytterro Estimator Strategy" is strategy of faytterro estimator. if you want to know more about faytterro estimator:
What it does?
It trades according to the signals given by faytterro estimator and some additional restrictions.
How it does it?
Using the faytterro estimator and the following variables, it gives buy and sell signals in different sizes at ideal points.
How to use it?
The "source" part is used to change the source of faytterro estimator.
The "length" is the length of the fayterro estimator.
"Minimum entry-close gap" is the minimum distance between two transactions opened in opposite directions. For example, if you opened long at 20 500 and "Minimum entry-close gap" is 400, you will not receive a sell signal before the price goes above 20900.
If "minimum entry-entry gap" is the minimum difference between two transactions opened in the same direction. For example, if you open long at 20500 level and the "minimum entry-entry gap" is 400, you will not receive a "buy" signal before the price goes below the 20100 level.
"strong entry size" determines the size of strong signals. The size of ordinary signals is always 1.
note: default values for btc/usdt 1 hour timeframe.
Fourier Spectrometer of Price w/ Extrapolation Forecast [Loxx]Fourier Spectrometer of Price w/ Extrapolation Forecast is a forecasting indicator that forecasts the sinusoidal frequency of input price. This method uses Linear Regression with a Fast Fourier Transform function for the forecast and is different from previous forecasting methods I've posted. Dotted lines are the forecast frequencies. You can change the UI colors and line widths. This comes with 8 frequencies out of the box. Instead of drawing sinusoidal manually on your charts, you can use this instead. This will render better results than eyeballing the Sine Wave that folks use for trading. this is the real math that automates that process.
Each signal line can be shown as a linear superposition of periodic (sinusoidal) components with different periods (frequencies) and amplitudes. Roughly, the indicator shows those components. It strongly depends on the probing window and changes (recalculates) after each tick; e.g., you can see the set of frequencies showing whether the signal is fast or slow-changing, etc. Sometimes only a small number of leading / strongest components (e.g., 3) can extrapolate the signal quite well.
Related Indicators
Fourier Extrapolator of 'Caterpillar' SSA of Price
Real-Fast Fourier Transform of Price w/ Linear Regression
Fourier Extrapolator of Price w/ Projection Forecast
Itakura-Saito Autoregressive Extrapolation of Price
Helme-Nikias Weighted Burg AR-SE Extra. of Price
***The period parameter doesn't correspond to how many bars back the drawing begins. Lines re rendered according to skipping mechanism due to TradingView limitations.