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!
Forecasting
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.
GT 5.1 Strategy═════════════════════════════════════════════════════════════════════════
█ OVERVIEW
People often look an indicator in their technical analysis to enter a position. We may also need to look at the signals of one or more indicators to verify the signals given by some indicators. In this context, I developed a strategy to test whether it really works by choosing some of the indicators that capture trend changes with the same characteristics. Also, since the subject is to catch the trend change, I thought it would be right to include an indicator using the heikin ashi logic. By averaging and smoothing the market noise, Heiken Ashi makes it easier to detect the direction of the trend helps to see possible reversal points on the chart. However, it should be noted that Heiken Ashi is a lagging indicator.
I picked 5 different indicators (but their purpose are similar) and combined them to produce buy and sell signals based on your choice(not repaint). First of all let's get some information about our indicators. So you will understand me why i picked these indicators and what is the meaning of their signals.
1 — Coral Trend Indicator by LazyBear
Coral Trend Indicator is a linear combination of moving averages, all obtained by a triple or higher order exponential smoothing. The indicator comes with a trend indication which is based on the normalized slope of the plot. the usage of this indicator is simple. When the color of the line is green that means the market is in uptrend. But when the color is red that means the market is in downtrend.
As you see the original indicator it is simple to find is it in uptrend or downtrend.
So i added a code to find when the color of the line change. When it turns green to red my script giving sell signals, when it turns red to green it gives buy signals.
I hide the candles to show you more clearly what is happening when you choose only Coral Strategy. But sometimes it is not enough only using itself. Even if green dots turn to red it continues in uptrend. So we need a to look another indicator to approve our signal.
2 — SSL channel by ErwinBeckers
Known as the SSL , the Semaphore Signal Level channel is an indicator that combines moving averages to provide you with a clear visual signal of price movement dynamics. In short, it's designed to show you when a price trend is forming. This indicator creates a band by calculating the high and low values according to the determined period. Simply if you decide 10 as period, it calculates a 10-period moving average on the latest 10 highs. Calculate a 10-period moving average on the latest 10 lows. If the price falls below the low band, the downtrend begins, if the price closes above the high band, the uptrend begins. Lets look the original form of indicator and learn how it using.
If the red line is below and the green band is above, it means that we are in uptrend, and if it is on the opposite side, it means that we are in downtrend. Therefore, it would be logical to enter a position where the trend has changed. So i added a code to find when the crossover has occured.
As you see in my strategy, it gives you signals when the trend has changed. But sometimes it is not enough only using this indicator itself. So lets look 2 indicator together in one chart.
Look circle SSL is saying it is in downtrend but Coral is saying it has entered in uptrend. if we just look to coral signal it can misleads us. So it can be better to look another indicator for validating our signals.
3 — Heikin Ashi RSI Oscillator by JayRogers
The Heikin-Ashi technique is used by technical traders to identify a given trend more easily. Heikin-Ashi has a smoother look because it is essentially taking an average of the movement. There is a tendency with Heikin-Ashi for the candles to stay red during a downtrend and green during an uptrend, whereas normal candlesticks alternate color even if the price is moving dominantly in one direction. This indicator actually recalculates the RSI indicator with the logic of heikin ashi. Due to smoothing, the bars are formed with a slight lag, reflecting the trend rather than the exact price movement. So lets look the original version to understand more clearly. If red bars turn to green bars it means uptrend may begin, if green bars turn to red it means downtrend may begin.
As you see HARSI giving lots of signal some of them is really good but some of them are not very well. Because it gives so much signals Now i will change time period and lets look same chart again.
Now results are better because of heikin ashi's logic. it is not suitable for day traders, it gives more accurate result when using the time period is longer. But it can be useful to use this indicator in short time periods using with other indicators. So you may catch the trend changes more accurately.
4 — MACD DEMA by ToFFF
This indicator uses a double EMA and MACD algorithm to analyze the direction of the trend. Though it might seem a tough task to manage the trades with the help of MACD DEMA once you know how the proper way to interpret the signal lines, it will be an easy task.
This indicator also smoothens the signal lines with the time series algorithm which eventually makes the higher time frame important. So, expecting better results in the lower time frame can result in big losses as the data reading from the MACD DEMA will not be accurate. In order to understand the function of this indicator, you have to know the functions of the EMA also.
The exponential moving average tends to give more priority to the recent price changes. So, expecting better results when the volatility is very high is a very risky approach to trade the market. Moreover, the MACD has some lagging issues compared to the EMA, so it is super important to use a trading method that focuses on the higher time frame only. What does MACD 12 26 Close 9 mean? When the DEMA-9 crosses above the MACD(12,26), this is considered a bearish signal. It means the trend in the stock – its magnitude and/or momentum – is starting to shift course. When the MACD(12,26) crosses above the DEMA-9, this is considered a bullish signal. Lets see this indicator on Chart.
When the blue line crossover red line it is good time to buy. As you see from the chart i put arrows where the crossover are appeared.
When the red line crossover blue line it is good time to sell or exit from position.
5 — WaveTrend Oscillator by LazyBear
This is a technical indicator that creates high and low bands between two values. It then creates a trend indicator that draws waves with highs and lows within these boundaries. WaveTrend is a widely used indicator for finding direction of an asset.
Calculation period: number of candles used to calculate WaveTrend, defaults to 10. Averaging period: number of candles used to average WaveTrend, defaults to 21.
As you see in chart when the lines crossover occured my strategy gives buy or sell signals.
═════════════════════════════════════════════════════════════════════════
█ HOW TO USE
I hope you understand how the indicators I mentioned above work and what they are used for. Now, I will explain in detail how to use the strategy I have created.
When you enter the settings section, you will see 5 types of indicators. If you want to use the signals of the indicators, simply tick the box next to the indicators. Also, under each option there is an area where you can set the "lookback". This setting is a field that will make the signals overlap when you select more than one option. If you are going to trade with only one option, you should make sure that this field is 0. Otherwise, it may continue to generate as many signals as you choose.
Lets see in chart for easy understanding.
As you see chart, if i chose only HARSI with lookback 0 (HARSI and CORAL should be 1 minumum because of algorithm-we looking 1 bar before, others 0 because we are looking crossovers), it will give signals only when harsı bar's color changed. But when i changed Lookback as 7 it will be like this in chart.
Now i will choose 2 indicator with settings of their lookback 0.
As you see it will give signals when both of them occurs same time. But HARSI is an indicator giving very early signal so we can enter position 5-6 bars after the first bar color change. So i will change HARSI Lookback settings as 7. Lets look what happens when we use lookback option.
So it wil be useful to change lookback settings to find best signals in each time period and in each symbol. But it shouldnt be too high. Because you can be late to catch trend's starting.
this is an image of MACD and WAVE trend used and lookback option are both 6.
Now lets see an example with 3 options are chosen with lookback option 11-1-5
Now lets talk about indicators settings. After strategy options you will see each indicators settings, you can change their settings as you desired. So each indicators signal will be changed according to your adjustment.
I left strategy options with default settings. You can change it manually as if you want.
═════════════════════════════════════════════════════════════════════════
█ LIMITATIONS: Don't rely on non-standard charts results. For example Heikin Ashi is a technical analysis method used with the traditional candlestick chart.Heikin Ashi vs. Candlestick Chart: The decisive visual difference between Heikin Ashi and the traditional chart is that Heikin Ashi flattens the traditional candlestick chart using a modified formula.
The primary advantage of Heikin Ashi is that it makes the chart more reader-friendly and helps users identify and analyze trends .
Because Heikin Ashi provides averaged price information rather than real-time price and reacts slowly to volatility — not suitable for scalpers and high-frequency traders. I added HARSI indicator as a supportive signal because it is useful with using CORAL and SSL channel indicators. If you change your candle types to Heikin Ashi , your profit will change in good way but dont rely on it.
═════════════════════════════════════════════════════════════════════════
█ THANKS:
Special thanks to authors of the scripts that i used.
@LazyBear and @ErwinBeckers and @JayRogers and @ToFFF
═════════════════════════════════════════════════════════════════════════
█ DISCLAIMER
Any trade decisions you make are entirely your own responsibility.
Price Bubble Meter (Moving Average to Price Distance)This indicator measures Price Distance (in %) from any given Moving Average.
It will help you see if the price is over extended or in the fair price zone.
Trend Analysis
How much % higher is the current price compared to 200W SMA
What % has been the maximum price rise from 200W SMA
What % has been the lowest price fall from 200W SMA
DCA Opportunity Finder
How much % higher is the current price compared to 2 year SMA
What % has been the maximum price rise from 2 year SMA
What % has been the lowest price fall from 2 year SMA
Yes you can manually measure it all using a ruler, but aint no one got time for that foo.
Fib Percentage Previous Day CloseIntraday regulated markets move within their circuit range above or below which the market activity is halted.
These levels are protected by the MM to accumulate or distribute. These levels are mostly same for all markets i.e. 2%, 4% , 5%, 10% and 20% of previous day close, crossing which the market activity halts.
So, from here the expectation of turning or breaking increases.
This indicator automatically plots the levels and helps understanding the price behavior at these points. This in turn helps taking better RR trades.
Killzone MTA ConceptsThis indicator indicates the Pre-Forex Market Killzones studied by our mentors at MTA Concepts. High volatility areas where you can take advantage of a great advantage when trading intraday.
Killzone: A killzone is an area, a time interval where there is high volatility and coincides with market pre-openings.
We have divided the Killzones into 3:
-London Killzone
-New York Killzone
-Asia Killzone
- Closing of operations: Time interval to take into account for the closing of intraday operations.
This indicator is prepared for intraday traders