HOW-TO use Adaptive Sideways FilterMy ASF (Adaptive Sideways Filter) is a sophisticated indicator used to identify sideways markets. Its goal is to filter market noise and false signals, accurately identifying the sideways phase of the market.
ASF uses an intelligent method to determine sideways markets. It adjusts its parameters based on market volatility and trends to adapt to different market conditions. When market volatility is low, ASF reduces its sensitivity to avoid mistaking it for a sideways market. On the other hand, when there is high market volatility, ASF increases its sensitivity to capture market trends more effectively.
ASF calculates based on market price fluctuations and trends. It uses a series of Average True Range (ATR) values to measure market volatility and adjust its parameters accordingly. ASF also relies on an indicator called "Directional Index" to measure the trend of the market and adjust its parameters based on changes in the Directional Index.
By using this adaptive approach, ASF can provide more accurate signals for sideways markets under different conditions. It helps traders avoid trading during sideways periods, reducing ineffective trades and losses. At the same time, ASF can also help traders capture better trading opportunities when there are trending movements in the market.
However, please remember that ASF is just an indicator and cannot guarantee 100% accuracy or success. Traders still need to combine other technical analysis tools with their own trading strategies for comprehensive judgment and decision-making when using ASF.
Here's how you can use this indicator: The purpose of ASF is to identify horizontal price fluctuation cycles and plot them on charts. This tool is valuable for traders looking for range-trading opportunities. The code of this indicator was written by me using TradingView's proprietary programming language Pine Script version 5 which provides enhanced functionality and flexibility compared with previous versions like Pine Script 4 or lower versions like Pine Script 3 or below versions like Pine Script 2 or earlier versions like Pine Script 1 etc.. However, it is not supported by software like Tongda Xian, Thun Hua Shun etc. Many friends have messaged me saying that the code I posted doesn't work in Tongda Xian or Thun Hua Shun, which makes me feel frustrated. Well, all I can say is: The revolution has not yet succeeded; comrades still need to work hard.
Firstly, several user-defined input parameters are defined. These parameters include the moving average length used to calculate thresholds, the threshold value that determines the width of sideways ranges, and the smoothing length applied to source data. By adjusting these parameters, traders can fine-tune the sensitivity of the indicator to suit their own trading strategies. One key feature of this indicator is incorporating Average True Range (ATR) concept into it to determine the width of sideways ranges. ATR is a widely used technical indicator for measuring market volatility. By multiplying ATR values by a user-specified threshold, this indicator calculates upper and lower channels defining price sideways movements. This indicator is used on main charts and overlaps with closing prices while indicating upward movement with green coloration and downward movement with red coloration as well as sideways movement with blue coloration through line colors,K-line colors,and background colors.The chart's colors and K-lines dynamically change based on closing prices' relative positions compared with upper and lower channels.If price lies above upper channel,the color will be green indicating potential overbought condition.If price lies below lower channel,the color will be red indicating potential oversold condition.When price lies within channels,the color will be blue indicating sideways movement.In addition,this indicator provides visual cues through coloring K-lines and adding background colors further highlighting periods of horizontal price fluctuations.
By using ASF indicators,traders can gain valuable insights into market behavior and make wise trading decisions helping identify potential range-trading opportunitiesand adjust strategies accordingly.In summary,"Adaptive Sideways Filter"indicatoris a powerful tool understood by those who understand it,used to identify horizontal price fluctuations and discover potential range-trading opportunities.Through its customizable parameters,integrated average smoothing data,and utilization of ATR,this indicator provides traders with a comprehensive view of market dynamics,enabling them to make wiser trading decisions.
As I believe this value is very valuable for my personal trading system,it is currently released in the TradingView community and can be used for free,but the code is not open source. Anyway, as a code blogger,I will still explain the logic of this indicator. Friends with sufficient comprehension can create it themselves.
One key feature of this indicator is integrating smoothed Heikin-Ashi (HA) candlestick chart data.The code includes a function called "heikinashi_tv" which generates smoothed OHLC (Open, High, Low, Close) data from traditional candlestick chart data.Smoothed charts reduce market noise and provide clearer views of price trends.By combining smoothed data,the ASF indicator aims to improve stability and accuracy in its analysis.
The code also includes a function called "cumavg" to calculate the cumulative average of given source data over a specified length. This function is used to calculate the source data for the indicator.
The main logic implemented by this indicator is as follows:
1. Use the "heikinashi_tv" function to generate smoothed OHLC data from traditional candlestick chart data. This ensures that the indicator is more stable under smoothed data.
2. Apply the "cumavg" function to the smoothed closing price with the specified smoothing length to calculate the source data.
3. Calculate Average True Range (ATR) based on the specified length.
4. Calculate upper and lower bands by adding and subtracting threshold multiplied by ATR value from moving average line of source data.
5. Determine colors for plotting and histogram based on position of closing price relative to upper and lower bands. If price is above upper band, color is green indicating potential overbought condition; if price is below lower band, color is red indicating potential oversold condition; if price moves between bands, color is blue indicating sideways movement.
6. Dynamically plot closing prices on chart using line style.
7. Color K-line based on same color scheme.
8. Add background color to further highlight periods of sideways movement in prices
Blackcat1402
HOW-TO use Volatility-Based Average Stop LossVolatility-Based Average Stop Loss (VBASL) is a trading strategy that sets stop loss levels based on market volatility to help traders maintain stable profits in their trades.
The benefit of this stop loss strategy is that it can adjust the stop loss level according to market volatility. When the market volatility is high, the stop loss level will be adjusted more loosely to avoid being triggered by short-term market fluctuations. Conversely, when the market volatility is low, the stop loss level will be adjusted more tightly to protect traders' profits.
The purpose of this strategy is to maintain stable profits in trading. By adjusting the stop loss level based on market volatility, traders can better control risks and avoid exiting trades too early during large market fluctuations or holding positions excessively during small market fluctuations. This way, traders can better capture market trends and gain more profits when trends continue.
Therefore, VBASL strategy helps traders maintain stable profits in their trades by adjusting the stop loss level based on market volatility. This strategy can assist traders in better risk management and gaining more profits when there are continuous trends in the market. To find out VBASL price, you first need to calculate Average True Range (ATR), which measures market volatility. Then multiply ATR by a factor chosen by you to determine the position of your stop-loss level.
Formula for VBASL:
`VBASL = Close - (ATR * Factor)`
Where:
- `Close`: Current closing price.
- `ATR`: Average True Range of prices.
- `Factor`: The factor chosen by you for adjusting the stop-loss level.
VBASL indicator helps set appropriate levels for your stops depending on how well or poorly markets perform. When markets are highly volatile, your stops should be larger so as not to get stopped out due to bigger price swings; conversely, when markets are less volatile, tighter stops would suffice.
By using VBASL indicator, you can avoid excessive losses while considering market conditions flexibly. Just remember that VBASL is just a tool and should be used in conjunction with other technical analysis techniques and risk management strategies.
However, how to use the VBASL indicator specifically may depend on your trading platform or personal preferences! This quantitative strategy is not universally applicable; its performance may vary greatly for different trading pairs and timeframes. Therefore, it requires manual discernment to determine which patterns are suitable for you. I have published this strategy framework on the TradingView community under the name: L3 Volatility-Based Average Stop Loss Strategy, which can be found and loaded from the public indicators library of TradingView.
The L3 Volatility-Based Average Stop Loss Strategy I have shared uses trailing stop loss indicators and volatility-based stops to determine entry and exit points.
The strategy parameters are as follows:
- ATR Length: The length used to calculate Average True Range (ATR) indicator for measuring volatility.
- ATR Multiplier: Applied to ATR to calculate trailing stop loss levels.
- Stop Loss Multiplier: Applied to ATR to calculate stop loss levels.
The strategy calculates ATR using the specified length. Then, it calculates trailing stop loss levels by subtracting or adding ATR multiplied by the ATR multiplier from high or low points respectively.
Stop loss levels are calculated by subtracting or adding ATR multiplied by the stop-loss multiplier from closing prices.
The entry conditions of the strategy are as follows:
- Enter Long Position: When closing price crosses above bullish level of trailing stop loss.
- Enter Short Position: When closing price crosses below bearish level of trailing stop loss.
The exit conditions of the strategy are as follows:
- Exit Long Position: When low price crosses below bullish position's stop-loss level.
- Exit Short Position: When high price crosses above bearish position's stop-loss level.
The strategy executes entry and exit orders accordingly. When the enterLong condition is true, it enters a long position and exits when the exitLong condition is true. Similarly, when the enterShort condition is true, it enters a short position and exits when the exitShort condition is true.
HOW-TO make a Fibonacci + KAMA combo?According to the principle of Kaufman's Adaptive Moving Average (KAMA), it is a type of moving average line that is designed for markets with high volatility. It can automatically adjust its period based on market conditions to improve accuracy and responsiveness. Compared to traditional moving average lines, KAMA can provide better buy and sell signals, helping traders better grasp market trends.
The use of Fibonacci magic numbers (3, 8, 13) has some special mathematical properties that can match the changing trend of KAMA moving averages. Combining them with KAMA can enhance its performance and accuracy. This combination method is widely used in market analysis and has been proven to be an effective trading strategy.
The fused moving average not only smoothes price fluctuations but also responds quickly to market changes, providing reliable entry and exit points and signals. Due to the flexibility and accuracy of KAMA, combining it with Fibonacci magic numbers can provide a powerful tool for traders to better control risks and achieve higher returns.
In summary, combining Fibonacci magic numbers 3, 8, 13 with KAMA moving averages is a trading strategy worth trying. The successful implementation of this strategy requires a thorough understanding and analysis of market trends and dynamics. Once mastered, traders can participate in the market more confidently, gaining better trading experiences and profits.
To integrate the magic numbers into KAMA, the first step is to understand the basic principles of KAMA in order to find suitable entry points for the magic numbers. The most significant feature of KAMA is its adaptive adjustment of moving average parameters based on market volatility. Its design purpose is to provide more accurate signals for different market environments.
Traditional moving averages may perform differently in different market environments. In highly volatile markets, shorter-term moving averages may be more suitable as they react faster to price changes. In low-volatility markets, longer-term moving averages may be preferable as they filter out noise more effectively.
KAMA adapts its moving average parameters based on market volatility to better suit different market environments. It uses an indicator called "efficiency ratio" to measure market volatility and adjusts the moving average parameters according to the value of the efficiency ratio.
Specifically, the calculation process of KAMA is as follows:
1. Calculate price volatility, usually using true range or price range.
2. Calculate the efficiency ratio, which is the ratio between fast exponential moving average (EMA) and slow EMA.
3. Adjust the moving average parameters based on the value of the efficiency ratio to adapt to current market volatility. Higher efficiency ratios result in shorter-term moving averages, while lower ratios result in longer-term moving averages.
4. Calculate KAMA values based on adjusted parameters.
The advantage of KAMA lies in its ability to adaptively adjust moving average parameters based on market volatility, providing more accurate signals. It helps traders capture market trends better and avoid generating false signals in noisy markets. However, KAMA also has limitations such as sensitivity to parameters and lagging effects, so it needs confirmation and validation through other indicators and technical analysis tools when used.
Based on the above description, there are several ways to improve KAMA performance:
1. Increase length: Increasing KAMA length can make it smoother by considering more historical data that reduces short-term price fluctuations' impact.
2. Adjust fast and slow lengths: Making KAMA smoother by increasing fast length and decreasing slow length results in a smoother KAMA line.
3. Use smoothing factor: The smoothing factor can be used to adjust smoothness level of KAMA; higher values make it smoother typically ranging from 0-1.
4.Combine with other smoothing indicators: Combining KAMA with other smoothing indicators like exponential moving averages (EMA) or simple moving averages (SMA) further smoothes outKAMAlinesand provides more reliable signals.
5.Filter noise: Using filters or other technical analysis tools to filter out price noise can make KAMA smoother. For example, using the trend line of Arnold's moving average (ALMA) can filter out short-term price fluctuations.
It should be noted that excessive smoothing may lead to lagging effects, slowing down KAMA's response to price changes. Therefore, when adjusting the smoothness level of KAMA, it is necessary to balance between smoothness and sensitivity and adjust according to specific trading strategies and market conditions. It is also recommended to conduct sufficient backtesting and validation before actual trading to ensure that the smoothed KAMA provides accurate and reliable signals.
HOW-TO Achieve Stable Profitability?After spending 5 years in the TradingView community, I occasionally encounter friends asking "which factor is more important for achieving stable profitability? Win rate or profit factor?" Today, I will briefly share my personal opinion for reference only. Generally, it is best to refer to those big shots who have gained huge wealth (of course, if these big shots are willing to share with you). As for myself, I am still exploring on this road, so what I say may not be correct.
To achieve stable profitability, both win rate and profit factor are important factors. Win rate refers to the percentage of profitable trades in trading, while profit factor indicates the ratio between each profit and loss.
A high win rate means that more trades will end in profit, which can increase the account balance. However, relying solely on a high win rate cannot guarantee stable profitability. Even with a high win rate, if small profits are gained each time but large losses are suffered, long-term stable profits cannot be ensured.
On the other hand, a lower but reasonable and controllable win rate combined with a higher profit factor may be more conducive to achieving stable profitability. In this case, although some trades are lost (low win rate), overall positive returns can be generated by letting winners continue to grow and limiting losers (high profit factor).
Therefore, considering these two factors in technical analysis is very important. Weighing them according to different market environments and personal preferences and adopting appropriate strategies to balance win rate and profit factor will help achieve long-term stable income.
When it comes to specific quantitative strategies, the main goal of optimization and improvement is to increase the effectiveness of signals and reduce win rate while increasing profit factor. The following are some areas for improvement:
1. Optimize long and short entry signals:
- Add more technical indicators or conditions to filter signals, such as adding better moving averages, improved relative strength indicators (RSI), etc.
- Use indicators of multiple time periods (MTF) to confirm signals, such as using long-term and short-term moving averages to confirm trends, and processing data from small periods with data from large periods. However, there are some drawbacks and difficulties here, as much information is lost due to the reduced sampling rate.
- Use price momentum indicators (such as MACD) to confirm signal direction and strength.
2. Improve Pyramiding logic:
- Add stricter conditions to limit the number and timing of Pyramiding to avoid overtrading. Overtrading is similar to indulgence. It feels good at the time, but its harm will be highlighted over time.
- Use dynamic Pyramiding strategies, such as Pyramiding based on volatility indicators or price trends.
3. Optimize long and short take profit signals:
- Use more reasonable take profit strategies, such as fixed percentage take profit based on volatility or dynamic take profit based on price trends.
- Consider using multiple target prices to set multiple take profit points to partially profit when prices rise. Each take profit is the end of a buy/sell transaction and must be re-initiated. Do not expect to make a big profit in one transaction (of course, you can, but the premise is to ask yourself whether your determination and mentality are strong enough). The basic principle of multiple take profits and re-opening positions is the principle of compound interest, which accumulates slowly. Don't underestimate the small profits accumulated over time, the results will surprise you.
4. Optimize long and short stop loss signals:
- Use more reasonable stop loss strategies, such as fixed percentage stop loss based on volatility or dynamic stop loss based on price trends.
- Use multiple stop loss points to set batch stop loss to reduce losses when prices fall.
5. Backtesting and optimization: There are many pitfalls in backtesting, and you need to know which ones can be used and which ones cannot.
- Use historical data to backtest, evaluate, and optimize improved strategies.
- Consider using optimization tools or algorithms to automatically find the best parameter combinations.
Again, I have limited ability, and the above suggestions are for reference only. Specific optimization strategies need to be adjusted and optimized according to specific markets and trading strategies. It is recommended to conduct sufficient backtesting and verification before actual trading to ensure the effectiveness and stability of the strategy. Also, luck is a factor in trading that you cannot ignore, and having good luck is also important. If a pie falls from the sky, you must catch it, but don't wait for it to happen and think that it is your own "ability," or you will fall into the trap and temptation of the market.
Secondly, let's talk about the basic principle of "profit and loss are from the same source", which means that in a period of time, the profit and loss of trading strategies are caused by the same set of rules and logic. In other words, profits and losses are derived from the same trading decisions and execution processes. After all, trading strategies, decisions, and executions are consistent systems. It ensures that profits and losses are caused by the same rules and logic. Of course, knowing this is not useful. The key is how to use this principle to observe and judge, so as to make the selection of trading strategies more reliable and predictable. "Profit and loss from the same source" actually provides a method for quantitative traders to evaluate and improve trading strategies. By analyzing the reasons for profit and loss from the same source, you can find the strengths and weaknesses of the strategy and carry out corresponding optimization and improvement.
Finally, after spending a long time in the community, I believe you can also see some people showing off their performance once in a while. For example, posting a picture of making 4 times the profit in one contract, which makes many people envious. However, after experiencing many trades in the market, the old traders who have seen a lot will not be excited at all. Because many people have experienced many trades and know the basic principle of "profit and loss from the same source": If someone can make 4 times the profit at once, it is either due to luck or strategy loopholes. When he blows up his account next time, you will not see him posting pictures to sell his misery, especially some KOLs. Truly stable profitable strategies are steady and can roll, not roll out. They roll snowballs, which also shape a mentality. This mentality can refer to the WeChat official account of Beijing Trader: From losing 70 to rolling to 60 million, there are almost no times when the entire position rises. Each big profit is only 1-2%, and a loss of 0.8% is called a blood loss! Whether it is a stock market crash or a receding tide, it always feels difficult for him to lose money! Then he only has one way to go, and that is to make money!
The "Art of War: Formation" from 2500 years ago once mentioned "Those who are good at war win without fighting, have no wisdom, no courage, no merit." Its original meaning is that people who are truly good at using soldiers do not rely on clever decisions or brave achievements, but on careful and steady operation to win. In fact, isn't it the same for trading? For achieving stable profitability in trading, this sentence provides some important inspiration, including careful planning and execution, long-term vision and persistent strategy, meticulous analysis and comprehensive consideration, and avoiding overconfidence and risky behavior. These principles and thoughts can help traders establish stable trading strategies and disciplines, improve trading success rates and profit potential.
HOW-TO visulize votatility clearly?Hey there! Let's get into the details about dynamic rate indicators, how they work, their importance, usage, and benefits in trading.
Dynamic rate indicators are essential in trading as they help traders assess the volatility and risk level of the market, so they can make the right trading strategies and risk management measures.
When it comes to the importance of dynamic rate indicators, they provide critical information about market volatility, which is super important for traders. Traders can use this information to understand the risk level of the market, determine market stability and instability, and adjust trading strategies based on volatility changes.
Now let's talk about the usage of dynamic rate indicators. They have different usage times for different trading strategies and market environments. Generally, when market volatility is low, traders can take advantage of the opportunity to do trend tracking or oscillating trades. When market volatility is high, traders can take a more conservative approach, such as using stop-loss orders or reducing position sizes.
Using dynamic rate indicators can bring several benefits. First, they can help traders evaluate the risk level of the market, so they can develop suitable risk management strategies. Traders can adjust stop-loss and take-profit levels based on changes in volatility to control risk. Second, dynamic rate indicators provide information about market trends and price fluctuations, helping traders make wiser trading decisions. Traders can determine entry and exit points based on the signals of dynamic rate indicators. Lastly, dynamic rate indicators play a significant role in option pricing. Implied volatility helps traders evaluate option prices and market expectations for future volatility, so they can carry out option trades or hedging operations.
In conclusion, dynamic rate indicators are essential for traders as they help assess market volatility and risk levels, develop suitable trading strategies and risk management measures, and increase trading success and profitability. Remember that different indicators are suitable for different types of markets, so it is essential to choose the right one for your specific trading needs.
This indicator is a powerful tool for traders who want to stay ahead of the market and make informed trading decisions. By analyzing trends in volatility, this indicator can provide valuable insights into market sentiment and help traders identify potential trading opportunities.
One of the key advantages of the L1 Visual Volatility Indicator is its ability to adapt to changing market conditions. The channel structure it constructs based on ATR characteristics provides a framework for tracking volatility that can be adjusted to different timeframes and asset classes. This allows traders to customize the indicator to their specific needs and trading style, making it a versatile tool for a wide range of trading strategies.
Another advantage of this indicator is its use of gradient colors to differentiate between Bullish and Bearish volatility. This provides a visual representation of market sentiment that can help traders quickly identify potential trading opportunities and make informed decisions. Additionally, the use of Fibonacci's long-term moving average to define the sideways consolidation area provides a reliable framework for identifying key levels of support and resistance, further enhancing the indicator's usefulness in trading.
In conclusion, the L1 Visual Volatility Indicator is a powerful tool for traders looking to stay ahead of the market and make informed trading decisions. Its ability to adapt to changing market conditions and use of gradient colors to differentiate between Bullish and Bearish volatility make it a versatile and effective tool for a wide range of trading strategies. By incorporating this indicator into their trading arsenal, traders can gain valuable insights into market sentiment and improve their chances of success in the markets.
HOW-TO predict sudden pumps and dumps?The volatility indicator (Volatility) is used to measure the magnitude and instability of price changes in financial markets or a specific asset. This thing is usually used to assess how risky the market is. The higher the volatility, the greater the fluctuation in asset prices, but brother, the risk is also relatively high! Here are some related terms and explanations:
- Historical Volatility: The actual volatility of asset prices over a certain period of time in the past. This thing is measured by calculating historical data.
- Implied Volatility: The volatility inferred from option market prices, used to measure market expectations for future price fluctuations.
- VIX Index (Volatility Index): Often referred to as the "fear index," it predicts the volatility of the US stock market within 30 days in advance. This is one of the most famous volatility indicators in global financial markets.
Volatility indicators are very important for investors and traders because they can help them understand how unstable and risky the market is, thereby making wiser investment decisions.
---
Today I want to introduce a volatility indicator that I have privately held for many years. It can use colors to judge sharp rises and falls! Of course, if you are smart enough, you can also predict some potential sharp rises and falls by looking at the trend!
In the financial field, volatility indicators measure the magnitude and instability of price changes in different assets. They are usually used to assess the level of market risk. The higher the volatility, the greater the fluctuation in asset prices and therefore higher risk. Historical Volatility refers to the actual volatility of asset prices over a certain period of time in the past, which can be measured by calculating historical data; while Implied Volatility is derived from option market prices and used to measure market expectations for future price fluctuations. In addition, VIX Index is commonly known as "fear index" and is used to predict volatility in the US stock market within 30 days. It is one of the most famous volatility indicators in global financial markets.
Volatility indicators are very important for investors and traders because they help them understand market uncertainty and risk, enabling them to make wiser investment decisions. The L1 Dynamic Volatility Indicator that I am introducing today is an indicator that measures volatility and can also judge sharp rises and falls through colors!
This indicator combines two technical indicators: Dynamic Volatility (DV) and ATR (Average True Range), displaying warnings about sharp rises or falls through color coding. DV has a slow but relatively smooth response, while ATR has a fast but more oscillating response. By utilizing their complementary characteristics, it is possible to construct a structure similar to MACD's fast-slow line structure. Of course, in order to achieve fast-slow lines for DV and ATR, first we need to unify their coordinate axes by normalizing them. Then whenever ATR's yellow line exceeds DV's purple line with both curves rapidly breaking through the threshold of 0.2, sharp rises or falls are imminent.
However, it is important to note that relying solely on the height and direction of these two lines is not enough to determine the direction of sharp rises or falls! Because they only judge the trend of volatility and cannot determine bull or bear markets! But it's okay, I have already considered this issue early on and added a magical gradient color band. When the color band gradually turns warm, it indicates a sharp rise; conversely, when the color band tends towards cool colors, it indicates a sharp fall! Of course, you won't see the color band in sideways consolidation areas, which avoids your involvement in unnecessary trades that would only waste your funds! This indicator is really practical and with it you can better assess market risks and opportunities!
HOW-TO determine when to go long and when to go short?Hey there! I previously wrote an article about the Larry Williams ViX Fix technical indicator. Soon after, friends from the TradingView community told me that this indicator could be combined with the Risk Assessment indicator I wrote about earlier to determine when to go long or short. At the time, I found it a bit cumbersome to use both indicators together, so I came up with a solution: to merge them. This way, we can use one technical indicator to visually see whether we should go long or short. Isn't that cool? The indicator has a very common name: ** L2 Votatility of Williams VixFix Risk Assessment, or VoWVRA for short.**
This TradingView Pine Script is a custom indicator based on the Larry Williams ViX Fix technical indicator, designed to help traders with risk assessment and trading decisions. The Larry Williams ViX Fix indicator is derived from the volatility of the S&P 500 index and is mainly used to display changes in current market sentiment. The indicator determines market volatility by calculating the distance between the highest price, the lowest price, and the closing price. The higher the value of the indicator, the more tense the market sentiment, and the higher the market volatility; conversely, the lower the value, the more stable the market sentiment and the lower the market volatility.
The VoWVRA indicator is based on the Larry Williams ViX Fix indicator, combined with technical indicators such as Bollinger Bands and EMA, to assess market risk. The indicator can be customized with input parameters to suit different markets and investor needs. Using the VoWVRA indicator can help traders make wiser choices in risk control and trading decisions.
In addition, this TradingView Pine Script also includes a risk assessment indicator. The indicator calculates a series of values and then applies the exponential moving average (EMA) to the percentage change between the closing price and the highest and lowest prices within a certain range to determine the safety level. The safety level is then compared to different thresholds to determine the market's risk level. The risk assessment indicator can be customized with input parameters such as risk length, safety length, and EMA length to suit different market conditions and investor preferences. Using the risk assessment indicator can help traders make wiser decisions in risk management and trading strategies.
By using the VoWVRA and risk assessment indicators, traders can more accurately assess market risk and make wiser choices in trading decisions.
HOW-TO trim a lightweight version of T3 MA
Tilson T3 Moving Average (T3MA) is a type of moving average line designed to reduce lag and improve the accuracy of trend identification. It is based on a combination of multiple smoothed moving averages, with each subsequent smoothed moving average having a higher weight than the previous one. The T3MA formula includes three different smoothing coefficients and a volume coefficient or volatility coefficient, which can be adjusted according to user preferences. T3MA is commonly used by traders and investors to identify trends and generate trading signals.
The calculation method for T3MA requires the use of exponential moving averages (EMA). In Pine scripts in the TradingView community, over 90% of them use the EMA function to calculate T3MA. Specifically, in Pine scripts, it is necessary to define the length and volatility coefficient of T3MA, then calculate three different lengths of EMA separately. Next, three constants need to be calculated that are related to volatility. Finally, the weighted average value of the three EMAs and three constants is added together to obtain the value of T3MA. If you want to customize the length and volatility of T3MA, you just need to modify the parameters in the code. Overall, T3MA is a very useful technical indicator that can help traders better understand market trends and improve trading efficiency.
The improved version introduced today mainly addresses my perception that traditional T3 algorithms are too redundant with high computational complexity leading to delayed reactions. Therefore, I have developed a lightweight version called L1 T3 MA Lite Version. This doesn't bring about any qualitative changes; it simply makes adjustments in terms of computational resources and response speed. To illustrate its advantages compared with traditional T3 MA indicators, I will provide a comparison using Everget's script from TradingView community blogger everget.
The difference between these two scripts for calculating T3 Moving Average lies in their implementation methods. The first script (Everget) uses a more complex calculation formula, which requires calculating three different lengths of EMA and computing three constants based on volatility. Finally, they are weighted averaged to obtain T3MA. This complex calculation formula can enhance the sensitivity of the T3MA indicator, thereby better identifying price trends. On the other hand, the second script (Blackcat1402) uses a relatively simple calculation formula that only requires calculating three different lengths of EMA and computing three constants based on volatility. Finally, they are weighted averaged to obtain T3MA as well. This simple calculation formula reduces computational complexity and speeds up calculations. Both have slightly different effects and calculation methods; users can choose the script that suits their needs.
In summary, T3 Moving Average is a very useful technical indicator that can help traders better understand market trends and improve trading efficiency. Users can choose scripts suitable for themselves according to their needs and flexibly adjust the length and volatility coefficient of T3MA to adapt to different markets.
HOW-TO combine multiple MAs as a Magic MAThis is a code snippet written in the Pine programming language for TradingView platform. It is an implementation of a custom technical indicator called "L1 Magic Moving Average".
Moving averages are widely used in technical analysis to identify trends and reversals in the price of an asset. The idea behind moving averages is to smooth out the price data by calculating the average price over a certain period of time. This helps to filter out the noise in the price data and provides a clearer picture of the underlying trend.
The Magic Moving Average (MMA) is a custom moving average that is calculated using a combination of three different types of moving averages: simple moving average (SMA), exponential moving average (EMA), and weighted moving average (WMA). The MMA is designed to be more responsive to changes in the price of an asset compared to traditional moving averages.
The code starts by defining the input parameters for the indicator. The length parameter determines the number of periods used for calculating the moving averages. The source parameter specifies the price data used to calculate the moving averages. Finally, the smoothness parameter adjusts the weighting of the WMA component of the MMA.
Once the input parameters are defined, the code calculates the MMA by adding the SMA, EMA, and WMA components. The SMA and EMA components are calculated using the standard functions provided by TradingView. The WMA component is calculated using a custom function that takes into account the smoothness parameter.
After the MMA is calculated, the code plots it on the chart as two lines, one for the current value and one for the previous value. The two lines are then filled with colors depending on the position of the current MMA relative to its previous value. If the current value is higher than the previous value, the plot is filled with yellow color, otherwise, it is filled with fuchsia color.
In addition to the plot, the code also includes logic for generating buy and sell signals based on the crossover of the MMA and its previous value. If the MMA crosses above its previous value, a buy signal is generated. Conversely, if the MMA crosses below its previous value, a sell signal is generated. When a signal is generated, an alert is triggered to notify the user.
Finally, the code also includes labels for the generated signals. When a buy signal is generated, a green "B" label is placed at the bottom of the candle. Similarly, when a sell signal is generated, a red "S" label is placed at the top of the candle. These labels help the user to quickly identify the signals on the chart.
Overall, this code provides a simple yet effective way of generating trading signals based on the Magic Moving Average. By using a combination of different types of moving averages, the indicator is able to capture different aspects of the price movement and generate signals that are more reliable. The flexibility of the input parameters also allows the user to adjust the indicator to their specific trading needs.
HOW-TO use VIDYA moving average to identify trendVariable Index Dynamic Average (VIDYA) is a technical indicator that adjusts its sensitivity to market volatility. VIDYA is an exponential moving average (EMA) that uses the standard deviation of price as a measure of volatility. When the market is volatile, the indicator places more weight on recent prices, and when the market is stable, it places more weight on older prices. This makes VIDYA more responsive to market conditions than a regular EMA.
This script is a powerful tool that traders can use to gain valuable insights into market trends and make informed trading decisions. The L1 Variable Index Dynamic Average (VIDYA) is a technical indicator that adjusts its sensitivity to market volatility, making it more responsive to market conditions than a regular EMA. By incorporating the standard deviation of price as a measure of volatility, VIDYA can provide a more accurate representation of the market's current state, which can be especially useful in volatile markets.
One of the key features of this script is that it allows the user to customize the period and alpha inputs used in the VIDYA calculation. This means that traders can tailor the indicator to their specific trading strategies and preferences. By adjusting the period and alpha inputs, traders can fine-tune the sensitivity of the indicator to match the volatility of the market they're trading in.
In addition to plotting the VIDYA line on the chart, this script generates alerts and labels for buy and sell signals based on the crossover and crossunder of the VIDYA line. These alerts and labels can be incredibly helpful in identifying potential trading opportunities and avoiding costly mistakes. By being alerted to buy and sell signals in real-time, traders can take advantage of market movements and make trades quickly and confidently.
Another advantage of this script is that it is written in TradingView's Pine programming language, which is specifically designed for technical analysis and trading. Pine is a user-friendly language that allows traders to create custom indicators and strategies without having to learn a complex programming language. This means that even traders with little to no programming experience can use this script to gain valuable insights into the market.
Overall, this script is an excellent tool for traders who are looking for a powerful and customizable technical indicator that can help them make informed trading decisions. With its ability to adjust to market volatility, generate alerts and labels, and be customized to match individual trading strategies, the L1 Variable Index Dynamic Average (VIDYA) is a valuable addition to any trader's toolkit.
HOW-TO use Larry Williams VIXFIX to identify trendLarry Williams, had this idea to create a synthetic VIX for more than just the main stock indices. Check out the formula for Williams VixFix:
```
VIX Fix Formula = (Highest(Close, 22) – Low) / (Highest(Close, 22)) * 100
```
What does this even mean? In normal person terms, here's what it's all about:
1. Find the highest close over the last 22 days and subtract today's low (or the current bar).
2. Divide that by the highest close of the past 22 days.
3. Multiply the result by 100 to "normalize" the indicator.
Why 22 days, you ask? That's how long the normal month of trading days is.
So, you see, the formula is pretty chill. It's just a way to measure the price volatility of the last 22 trading days. It's a bit of a lagging indicator, but it gets the job done.
Here my version of this scriptcreates a custom technical indicator called "L1 Larry Williams VixFix" that measures the distance between the highest high and the lowest low of a security's price over a specified period.
The user can adjust the period length and source price used in the VixFix calculation. The period length is set to 22 by default, but can be modified by the user with the "Length" input parameter. The source price is set to "close" by default, meaning it will use the closing price of each bar to calculate the VixFix. However, the user can also choose a different type of price data, such as open, high, or low.
The VixFix is calculated as a percentage of the difference between the highest close and the lowest low over the specified period. This percentage is then multiplied by 100 to create a more readable value.
Finally, the code plots the VixFix line on the chart with a yellow color and a thickness of 2. This allows the user to easily visualize the VixFix value and incorporate it into their trading decisions.
Overall, this script provides a powerful tool for technical analysis that can help traders identify potential trend changes and market reversals.
HOW-TO use L4 Adaptive Hull Suite 4H for BTCUSDT.P 4HLevel: L4
Function Description:
The L4 Adaptive Hull Suite 4H aims to help traders identify trend reversals and trade signals using various moving averages and indicators. The script is designed to be adaptable and customizable, allowing traders to tweak the settings to suit their individual preferences and trading styles.
At its core, the script uses the hybrid Hull Moving Average (HHMA), a popular technical indicator that aims to reduce lag and noise while improving the accuracy of moving average signals. The HHMA is combined with a reverse chop indicator, which helps identify trend reversals by measuring the volatility of the market and comparing it to a set threshold.
In addition to the HHMA and reverse chop indicators, the script also includes customized open-close cross (OCC) conditions and a hybrid Hull Moving Average (Hybrid Hull MA). The OCC conditions allow traders to generate buy and sell signals based on the cross of the open and close prices, while the hybrid Hull MA combines the HHull MA with other moving averages to provide a more accurate and reliable trend-following signal.
Traders can adjust the settings of the script to suit their trading style and risk appetite. For instance, the chop length, ATR length, and reverse chop threshold can be customized to identify trend reversals more accurately, while the Hull MA length can be adjusted to provide a faster or slower response to price changes.
Overall, the L4 Adaptive Hull Suite 4H is a powerful and flexible Pine script that can help traders identify trend reversals and generate accurate buy and sell signals. With its customizable settings and reliable indicators, the script can be a valuable addition to any trader's toolkit.
About Time Frame:
The L4 Adaptive Hull Suite 4H is specifically designed for use on the 4-hour time frame and is particularly well-suited for trading the BTCUSDT.P trading pair. The script combines various technical indicators, including the Adaptive Hull Moving Average (AHMA) and the reverse chop indicator, to help identify trend reversals and generate accurate buy and sell signals.
Traders who are interested in using the L4 Adaptive Hull Suite 4H should be aware that it is optimized for use on the 4-hour time frame. While it may work on other time frames, the signals generated may not be as reliable as those generated on the 4-hour chart. Additionally, the script is specifically designed for use on the BTCUSDT.P trading pair, and may not be as effective on other trading pairs.
Overall, the L4 Adaptive Hull Suite 4H is a powerful and adaptable Pine script that can help traders identify trend reversals and generate accurate buy and sell signals. With its focus on the 4-hour time frame and the BTCUSDT.P trading pair, the script can be a valuable tool for traders who are looking to improve their trading results on this particular asset.
Choppiness Sensitive
The L4 Adaptive Hull Suite 4H includes a choppiness detection feature that helps traders identify whether the market is trending strongly or moving sideways. When the market is trending strongly, the background color of the chart will turn blue, indicating an active buy or sell signal. Conversely, when the market is moving sideways, the script will ignore any buy or sell signals generated by the OCC or Hull MA conditions.
The choppiness detection feature is based on the reverse chop indicator, which measures the volatility of the market and compares it to a set threshold. When the chop value is above the threshold, the market is considered to be in a sideways or choppy phase, and the script will not generate any buy or sell signals. However, when the chop value is below the threshold, the market is considered to be trending strongly, and the script will generate active buy or sell signals based on the OCC or Hull MA conditions.
Overall, the choppiness detection feature is a valuable addition to the L4 Adaptive Hull Suite 4H, as it helps traders identify the optimal times to enter and exit the market. By focusing on strong trends and ignoring sideways movement, traders can improve their trading results and minimize their risk of losses.
Divergence Detection and Alerts
The L4 Adaptive Hull Suite 4H is a powerful Pine script that can produce divergence labels and TradingView alerts using the built-in alert() function. This allows traders to receive real-time notifications when the script generates a buy or sell signal, making it easier to stay on top of market movements and take advantage of profitable trading opportunities.
To set up alerts, traders can simply add the alert() function to the script and specify the conditions that should trigger the alert. For instance, traders may want to receive an alert when the script generates a buy signal based on the OCC conditions, or when the Hull MA crosses above or below a certain level.
In addition to alerts, the script can also produce divergence labels, which can help traders identify potential trend reversals and generate more accurate buy and sell signals. Divergence labels are based on the difference between the script's indicators and the price action of the asset being traded, and can provide valuable insights into the underlying market dynamics.
Overall, the L4 Adaptive Hull Suite 4H is a versatile and customizable script that can help traders identify trend reversals and generate accurate buy and sell signals. With its ability to produce alerts and divergence labels, the script can be a valuable tool for traders who are looking to stay on top of market movements and take advantage of profitable trading opportunities.
HOW-TO fuse MACD+RSI for a MTF feasible indicatorThe MACD and RSI fusion is a popular technical analysis strategy used by traders to identify buy and sell signals in the market. The strategy makes use of two popular technical indicators, the Moving Average Convergence Divergence (MACD) and the Relative Strength Index (RSI), and combines them to create a powerful trading signal.
The MACD and RSI fusion was originally developed for the Chinese stock market and is commonly used by traders all over the world. The strategy is based on the idea that the MACD and RSI indicators can be used together to provide a more accurate and reliable signal.
To use the MACD and RSI fusion , traders need to follow a few simple steps. The following code is the TradingView Pine script v4 indicator equivalent of the original MACD and RSI fusion code:
```
//@version=4
study(" MACD and RSI fusion ", overlay=false)
// Define the simple fusion indicator
simple_fusion = (ema(close, 12) - ema(close, 26)) * 1.2 + rsi(close, 14) / 50
// Define the simple fusion lag indicator
simple_fusion_lag = nz(simple_fusion )
// Plot the simple fusion and simple fusion lag indicators
plot(simple_fusion, color=color.blue, title="simple fusion")
plot(simple_fusion_lag, color=color.red, title="simple fusion Lag")
```
This code defines the simple fusion and simple fusion Lag indicators and plots them on the chart. The simple fusion indicator is the sum of the 12- and 26-period exponential moving averages of the closing price, multiplied by 1.2, and added to the 14-period relative strength index of the closing price, divided by 50. The simple fusion Lag indicator is the value of the simple fusion indicator from the previous period.
Traders can use the simple fusion and simple fusion Lag indicators to identify buy and sell signals. When the simple fusion indicator crosses above the simple fusion Lag indicator, it is a buy signal, and when the simple fusion indicator crosses below the simple fusion Lag indicator, it is a sell signal.
In conclusion, the MACD and RSI fusion is a simple but powerful technical analysis strategy that combines two popular technical indicators to identify buy and sell signals in the market.
HOW TO use William Gann slope to scalpShort-term weapon: William Gann slope oscillator
William Gann (Wilian D. Gann) is one of the most famous investors in the twentieth century. His outstanding achievements in the stock and futures markets are unparalleled. The theory he created that perfectly combines time and price has been It is still talked about and highly praised by the investment community.
The slope is the degree of the angle line relative to the time axis (X axis). Volatility is the ratio of unit amplitude to unit time. At the heart of Gann angles is the determination of volatility. Gann angle is the movement of price defined by time unit and price unit. Each angle is determined by the relationship between time and price. In the rising angle, the angle with the larger slope means that the stock price is rising stronger and falling. In a trend line, the larger the slope, the stronger the downtrend.
This technical indicator speaks of the Gann slope expressed as an oscillator. Its value varies from 0 to 100. The positive slope means rising, and the negative slope means falling. For rising and falling, the strength of rising and falling is distinguished by the thickness and color of the oscillating line:
1. The thin white line represents the basic oscillator curve and has no special meaning.
2. Light red indicates that an uptrend is established, and dark red indicates a very strong uptrend.
3. Light green indicates an established downtrend, dark green indicates a very strong downtrend.
This technical indicator is open source and released in the TradingView community, and interested friends can study and study:
A bloody case by TerraUSD reveals a big joke: Code is Law The cryptocurrency's third-largest stablecoin, TerraUSD (UST), fell below $1 on Monday and fell to a low of 32 cents at one point, causing a large number of investors to sell their holdings. As of press time, the price of UST was as low as 32 cents. It fell more than 67% by two days and is now in a state of severe decoupling.
USTUSD quotes from TradingView
This is not the first time that stablecoins have become unstable. I remember that there was a small-level crash in USDT in 2018. At that time, I even copied the bottom with my friends. At that time, I thought that there would be a repair after the panic. This time UST, from the price point of view, someone started to buy the bottom, but I did not act. The main reasons are:
1. Unlike 2018, UST has many strong stablecoin competitors, and robust traders may not return. In 2018, USDT, as the only stable currency on the market, did not have many choices in the long bear market. Instead of being eaten away by the bear market, it is better to return to maintain the market value.
2. USDT is relatively traditional, and does not use algorithms to stabilize it. It is completely dependent on TEDA executives to beat their heads. However, according to the rules of the game, TEDA executives must maintain their best interests and prepare a set of fooling arguments. Don't underestimate the game of human heart, this thing may be more stable than the algorithm. "Code is Law" and decentralization are just flickering retail investors with plots to enter the market to pay the bill. After understanding a lot of technical essence, you will find that this decentralized world is either the emperor's new clothes or the rhetoric of killing pigs. Very shabby. It is Satoshi Nakamoto's game thinking that makes POW the backbone of the crypto market. What BM, and the rhetoric about changing the world, the various rhetoric of the Chinese projects of web3.0 are just on the one hand retail investors who are waiting to feed, and on the other hand "bring a soft condom" for the project party's sharp sickle to prevent scaring away Retailers. Although it may not be easy to accept, this is also the reality, whether it is accepted or not is there. The sooner you realize the essence of this market, the sooner you can escape the sharp edges of a few sickles.
Let's go back to the mechanics of UST, let's see how this tragedy happened.
UST is an algorithmic stablecoin that maintains a peg to the US dollar through an on-chain minting and destruction mechanism. That is, in theory, these systems should ensure that traders can exchange $1 worth of UST for $1 worth of LUNA, which has a floating price and is designed to act as a kind of "shock absorber" for UST price fluctuations. However, due to the recent interest rate hike by the Federal Reserve, the cryptocurrency market continued to fluctuate, and the price of LUNA currency fell.
LUNAUSD quotes from TradingView
In fact, from the historical point of view, algorithmic stablecoins are not as stable as traditional stablecoins. Even after TEDA surreptitiously revises the rules and removes the clause that USDT is pegged to the US dollar, it is still stable (the decoupling of USDT in 2018 was before the rules were revised). In addition to this time, stablecoins such as UST have also experienced a 15% decoupling last year. Whether this thing is reliable or not can be seen.
The main reason for the UST bloody case is the loophole in its algorithm mechanism, which is exploited by speculators, chooses a God-given opportunity, pushes it lightly, and it collapses! The UST mechanism is too greedy. The anchor protocol in the Terra ecosystem of UST and LUNA is not only a stable currency, but also the pursuit of high returns (there is an old Chinese saying that it is necessary to establish an archway), and it has really been realized. , but at the expense of risk exposure. In the days of singing and dancing, no one would pay attention to this detail. However, when disaster strikes, the loopholes are exposed, and the time has come. Powerful traders can participate in the UST pledge redemption on LUNA through the anchor protocol, and then exchange UST for other stable coins can become a rich arbitrage behavior, and they can get it. Up to 600% of the income. It is this crazy mechanism design. When the market is bad, a large number of UST are sold, causing UST to be delinked from the US dollar. However, according to its algorithm mechanism, more LUNA will be minted on the chain to maintain the peg between UST and the US dollar. When the gap cannot be filled, the silly algorithm will continue to issue LUNA. A large amount of LUNA has flowed into the market. The Fed's interest rate hike has caused the global risk market to fall continuously. When LUNA itself fell, there were still a large influx of newly issued LUNA, which made the situation worse. At this time, traders who poured into the Terra ecosystem with a large number of early arbitrage panic, and no one wanted their assets to shrink, so they started the "faster than hand" market in A-shares. It is equivalent to the "nuclear button" of A shares, except that the encryption did not fall by the limit, and all the way down, panic spread, and LUNA started this session. At this time, everyone knew that LUNA and UST were one family. How could UST survive if LUNA died? Some people began to sell UST in large quantities again. It doesn’t matter. The algorithm on the chain is not the Securities Regulatory Commission or the Federal Reserve. It will only try to stupidly and violently issue LUNA. So far, an avalanche of constant positive feedback has begun, and this is the vacancy and vacancy filled by the believers of "Code is Law" with real money! Seeing Terra's murder, you have to admire the wisdom and pattern of Satoshi Nakamoto. The core of the PoW mechanism is game theory and a thorough understanding of human nature. Later mainstream and copycats either learned the shape and only copied and pasted the essence of Satoshi Nakamoto's thought, or some people were too greedy and not satisfied with the inefficient mechanism of PoW (inefficiency is to ensure the realization of competition and reliability), Switch to PoS. Throughout human history, where there is PoS, there must be corruption! From this point of view, V is not God, and it is enough to downgrade ETH to PoS to see that its cognitive level is comparable to that of BM, but it is more pedantic!
HOW-TO use three turnover musketeers #1 : L5 HSL TrendThe market decides how much profit to give you, and you can decide how much to lose! ---- Linda Bradford Risk
Recently, I have concentrated on the time to summarize and optimize the three tools for turnover: turnover trend, turnover oscillator, and turnover supply and demand; as explained in advance, these three indicators are only suitable for stocks in the A-share market. In TradingView Errors may be reported for other targets. It is planned to introduce their usage in three articles. For those who are not familiar with this indicator, I will briefly introduce the concepts of turnover and turnover in this first article.
Change of hands refers to the transaction in which shares are transferred from Party A to Party B. Turnover rate: refers to the ratio of the trading volume in a certain period of time to the total number of outstanding shares of the stock, which is one of the indicators reflecting the liquidity of the stock. It should be noted here that it must be divided by the circulating market, because the circulating market is real and can be circulated, and it is a bargaining chip that retail investors and main players can buy and sell, so the ruling is more representative. The turnover rate (HSL) is used for market research and judgment to help traders track the activity of individual stocks. Generally, the higher the turnover rate of a stock, the more active the stock is; otherwise, the more sluggish the stock is, The less the market pursuers: when the daily turnover rate is less than 1%, it is called absolute land volume. 1%-3% is called land volume or low volume, 3%-5% is called slightly active, 5%-8% is called volume, 8%-10% is heavy volume, 10%-25% is huge volume, 25 % or more is abnormal transaction.
1. Land volume or downturn indicates that the transaction is relatively inactive; the stock price will generally maintain the original running trend, mostly consolidating or falling, except for the stocks with high control;
2. A little activity and volume indicate that the transaction is active;
3. Heavy volume, huge volume and abnormal transaction indicate that the transaction is warm; if it occurs at a low level, it is likely to be the main purchase; if it occurs at a high level, it is likely to be the main shipment.
There is also a concept of real turnover: in a stock, individual stocks held by controlling shareholders will not be easily traded. We believe that these chips are basically unchanged, and individual stocks held by strategic investors will not Easy to buy and sell, unless there is a larger profit, so this part of the chips is also considered unmoved. Therefore, the real circulating market is the circulating chips displayed on the software minus the stocks held by controlling shareholders and strategic investors. In this way, the turnover rate and willingness to buy and sell can be more realistically reflected. Therefore, whether the turnover rate or the real turnover rate needs to be judged according to its absolute value.
In addition, the turnover rate alone is not comprehensive enough. It is usually necessary to combine the K-line to understand the meaning of the market. The two are complementary. The reduction or enlargement of the turnover rate is of great significance for identifying the candlestick chart. If you don't look at the turnover rate, you can't distinguish the strength of the main force and whether it is really a stock. It cannot effectively follow the main force of the market to make money. Combining the turnover rate with the stock price trend can make a more accurate prediction and judgment on the future stock price. If the turnover rate is high for a long time and within a certain price, it means that the amount of capital in and out is large, and the main capital is sufficient, so that the individual stocks are operable, but if the turnover rate suddenly increases in a very short period of time, such as within a day or two, After that, it suddenly calmed down. This situation is often that after the main players in the market have put out most of their chips, in order to sell out all the remaining chips in their hands, they deliberately use this very small amount of chips to fight against and create the illusion of active trading volume. , and let inexperienced traders follow suit, so that the main force can get rid of the remaining chips smoothly, which will be followed by waves of slumps.
A high turnover rate can indicate that there is an inflow of funds or an outflow of funds. Therefore, the turnover rate is of great significance in judging the stock market. Only from the long-term K-line chart can we see the in and out process of the main market forces. When the inflow and outflow process of market capital can be seen, the relative level of stock price can be identified. When the main force enters the market, the turnover rate is high and the stock price is low, indicating that there is capital inflow; when the main force is shipped, the turnover rate is high and the stock price is high, and there is capital outflow.
The turnover rate trend is the simplest of the three indicators, including two parts, the turnover rate bars marked with different colors and the fast and slow moving averages of the turnover rate. The default parameters are 5 and 10. This parameter is mainly used for the daily market, and you can also configure other values that are more reasonable in the settings. The golden cross and the dead cross of the fast line (red) and slow line (green) of the turnover rate indicate the trend of the turnover rate, but note that this is not the price. It has rich market meaning and does not have a price orientation. It also needs to be judged with the K-line price.
For the turnover bars, there is a percentage on each bar, which is the current day's turnover value, accurate to one decimal place. The color of the bars is a color designation that I always use to provide an illustration of the relationship between the bar combinations in addition to the absolute value of turnover. The colored turnover bars have 6 colors and 5 meanings. Because, the cyan/emerald color is NA, that is, there is no special meaning.
1. Buying and changing hands - a large number of changes, a large price range (the range from the highest price to the lowest price), the positive line (red), the typical K-line pattern is a large positive line with a large number;
2. Selling and changing hands - a large number of hand-changing, a large price range from the highest price to the lowest price), Yinxian (white), the typical K-line pattern is a large Yinxian with a large number;
3. Huge tug-of-saw - a lot of changes, small price range (green), star line, small yin and small yang, with a large amount, the opening and closing prices are relatively close, the typical K-line pattern is a huge amount of doji;
4. The amount of land - the amount of land or changing hands is sluggish (yellow), the amount of shrinkage, the typical K line is the amount of small yang and small yin line;
5. Buy and sell changing hands plus a huge number of hand-changing saws - meet the above 2 conditions (magenta) at the same time. The range of the highest price and the lowest price is large, the range of opening and closing prices is small, and there is a large number of hand changes, that is, a large number with a long upper shadow or a long lower shadow. The typical K line is a large real body with upper and lower shadows. Mostly.
6. In the absence of these special turnover signals, the bar color is cyan or emerald green.
Buying and changing hands: buying and changing hands can reach a climax
Buying and changing hands usually occurs in:
• The beginning of an uptrend (the main force aggressively builds positions and grabs chips);
• The end of the trend (primary pull-ups, retail pick-ups), and;
• Pullback during a downtrend (main force pulls back to sell, shorts replenish, longs bottom).
The beginning of an uptrend is almost always marked by the appearance of buying and selling. This shows that the main force is eager to build positions and grab chips, and a large number of incremental funds enter the market and quickly raise prices. An effective breakthrough should be more bullish power leading to a positive line, but occasionally the K line behind the buying tide will test whether the lowest price of the K line corresponding to the buying tide can support it. If there is no support, it is the short side offside, and you can consider stop loss and exit.
The wave of buying and changing hands (red) at the top of the market is also characterized by the fact that it usually coexists with a huge amount of seesaw (green, long-short competition) or land volume (yellow, buyers are trying their best). A change in trend usually takes a while to develop, so don't get coaxed out too soon - wait for the market to become exhausted (divergence) before taking action. A useful signal to watch is land volume (yellow) - land volume indicates that there is ultimately no demand, so the market may stop moving forward.
During a downtrend, rallies are often characterized by buying and selling. (The main force does not want to sell at a low price, and sells at a high price, creating the illusion of a trend reversal, or showing short-covering chips, or traders constructing a bottom too quickly) Once the volume of buying and changing hands continues to decline, the downward trend may be will continue. When the lowest price of the K-line corresponding to the buying and changing hand tide is below (the short side is offside), it can be confirmed that the downward trend will continue, and those who enter by mistake need to stop loss and exit.
The tide of selling and changing hands: the rate of selling and changing hands reaches a climax
Market behavior is highly dual. There is buy and sell. Selling turnover is basically the opposite of buying turnover. BKVO identifies sell turnover waves by multiplying the sell volume (trading at the bid price) by the price range, then looking for the highest value in the last 8 turnover bars (the default setting). A surge in selling indicates that a large supply has caused prices to fall. The default setting is to set the turnover bar color to white.
The selling tide usually occurs in:
• The beginning of a downtrend (massive shipments of the main force);
• the end of a downtrend (bear trap);
• Pullbacks during an uptrend (shuffle, shock, long replenishment).
The beginning of a downtrend almost always begins with a wave of selling. This shows that the main force is eager to ship, and the chips enter the market in large quantities and quickly push down the price. A valid downside breakout should have more price breakouts (changes move ahead of price), but occasionally a sell-change surge corresponds to the highest price of the candlestick. If the price of the K-line and the turnover rate later break through the highest value of the buying and changing tide, then the yang overcomes the yin, and you can enter the market to open a position.
The characteristic of the selling tide (white) at the bottom of the market is that it coexists with the changing tide (green, long-short competition) or land volume (yellow, sellers do their best). A change in trend usually takes a while to develop, so don't be coaxed into a trade too early - wait until the market becomes exhausted and the bears completely unravel. A useful signal to watch is land volume (yellow) - this indicates that eventually there is no supply and the market may stop falling.
During an uptrend, pullbacks are usually characterized by a wave of selling (white). These indicate profit-taking or the desire of the trader to get to the top quickly. Once the tide of selling and changing hands declines, the uptrend may resume and continue the original uptrend. When the price of the volume column and the K-line of the sell-and-change tide is double-covered, that is, the yang overcomes the yin, and the continuation of the upward trend can be confirmed.
giant saw
Mass saws are usually seen in:
• End of uptrend;
• the end of a downtrend;
• Profit-taking boosted the medium-term trend.
Be
When huge tug-of-war volumes are high, it indicates that demand is being met by new supply of chips or supply is being met by new bottom-chip demand - in fact, as new supply or demand comes into the market, because, price It is impossible to advance, and the range from the highest price to the lowest price of the K line will be very small, so only the turnover rate can observe the market changes. Mass saws are seen as 'brakes'. It's like hitting the brakes - typically, the car will stop shortly thereafter (1-2% points), then turn around. However, at other times, the momentum is so great that all you get is a pause and then the market keeps going in the same direction! This is the difficulty of judging the development of market trends!
It is worth noting that occasionally the trading tide and huge seesaw will overlap. At this time, the color of the turnover rate column is positive red (the buying and selling tide plus the huge seesaw), and its market meaning is also more complicated or vague. unclear.
land change
A change of land is usually seen in:
• End of uptrend;
• the end of a downtrend;
• Mid-term trend pullback.
The volume change (yellow) is my favorite indicator of the turnover rate. They show what retail traders do on candlestick charts. They are also very useful when the market tests tops or bottoms, as indicators that can confirm a change in trend direction.
The colored turnover rate column is an important part of the quantitative knowledge system of Qingmao, and it is an effective aid in the existing and future release indicators. Because they can show turnover indicators that need attention at different market stages:
• The top of the market is characterized by a buying rush (red), huge seesaws (green) and shrinking positives (yellow, also known as testing).
• The bottom of the market is characterized by a surge of selling (white), a huge see-saw (green) and a shrinking volume (yellow, also known as a test).
• Retracements of up or down trends are similar to market tops or bottoms, but with shorter duration and simpler turnover bar colors. Keep in mind that this method of using turnover to identify turning points is even more powerful when combined with non-correlated indicators such as whales and tangles.
NOTE: this indicator can only applied for Stocks. Or it may fail in calculations.
HOW-TO allow your indicators to adapt to market cyclesFor many traders with a background in digital signal processing (DSP), John F Ehlers' cycle theory may be easy to understand. He sees the market as a discrete digital signal system and uses a lot of modern digital signal algorithms in his indicators. Among them, he believes that the market life is a variable cycle, rich in various harmonic components of the digital signal system. Since it is a variable cycle, if the parameters of many technical indicators are fixed, they can only conform to the market characteristics for a certain period of time and can correctly reflect the real state of the market at that time alone. Once the market frequency is adjusted, the "frequency" of the fixed parameter indicator will be "out of tune" with the market, and thus will be invalid. In short, it is like the FM radio used in daily life. If the frequency can be matched, you can enjoy wonderful music. Once the frequency is shifted, you can only hear noise. This is a truth for market as well. In addition, Ehlers' cycle theory holds that trends are just large cycles, with rising or falling phases dominated by the large-period component, and small periods of various rhythms mixed in with the large-period component. But in any case, it can be expressed by sine wave synthesis of many frequencies, but there are many components, and the frequency is changing. In fact, this not only corresponds to Dow Theory and Elliott Wave Theory, but also corresponds to the concept of "level/timeframe" of Chinese Zen Theory. This explains why many people still fail to invest in stocks after learning the Elliott wave or Zen theory, because this "dominant cycle/level/timeframe" is changing, not static. Most likely to lose money or being liquidated. If a sniper wants to hit a high-speed moving target, he must adjust the magnification of the magnifying glass. Using a fixed multiplier to shoot an out-of-range target will increase the probability of misses. It is reasonable to use technical indicators as well.
Technical indicators of automatic parameter adjustment
At present, many people try various methods to make technical indicators quickly adapt to market changes, that is, Adaptive Indicators. There is no shortage of traders using AI machine learning algorithms and even the latest Transformer algorithms (Google). However, traditional machine learning algorithm training requires a large number of samples and training to ensure that the algorithm converges and obtains effective parameters. But this response is often not enough to meet the rapidly changing market trends. At this time, some adaptive algorithms in the Ehlers cycle theory can be considered to adapt the index parameters.
For example, the figure below is an adaptive RSI that calculates the main control period through discrete Fourier transform and uses the main control period to "tune" the RSI indicator parameters. Simply put, the parameter of this adaptive RSI is neither 14 nor 7, but a dynamic parameter N is calculated according to market changes, you can set the range of this N, and the algorithm will automatically calculate the value of N, and Let RSI automatically adjust among different parameters.
SZSE: 399006 ChiNext Index from TradingView
In order to compare and see the effect of adding or not adding self-adaptation on the indicators, I use the following ESCGO oscillator for comparison. The above is the ESCGO indicator with fixed parameters that I wrote, and the following is the ESCGO indicator with adaptation. Can you see the difference?
SZSE: 399006 ChiNext Index from TradingView
I read 4 English books of J.F Ehlers, and after carefully studying all the published articles, I summed up 12 algorithms for calculating the Dominant Cycle of the market, and wrote them into the TradingView pine v5 library dc_ta to share publicly at TradingView community.
1. EhlersHoDyDC(). This is the algorithm that Ehlers uses Hilbert Transform combined with Homodyne Discriminator to calculate the main control period. Homodyne means that the market signal is multiplied by itself. More precisely, we want to multiply the complex value of the signal of the current bar with the signal of the previous bar. By definition, a complex conjugate is a complex number with the sign of its imaginary part reversed.
2. EhlersPhAcDC(). This is an algorithm that uses the Hilbert Transform combined with the Phase Accumulator to calculate the master cycle. The market master cycle measurement using the phase accumulation method always uses one full cycle of historical data. This is both an advantage and a disadvantage. The advantage is that the hysteresis in the obtained master period is directly related to the loop period. That is, short-period measurements have less lag than long-period measurements. However, the number of samples used to make the measurements means that the average period varies with the loop period. A longer averaging time will reduce the noise level compared to the signal. Therefore, a shorter period necessarily has a higher output signal-to-noise ratio (SNR). Therefore, this algorithm is more suitable for calculating small cycles to ensure less cycle calculation lag.
3. EhlersDuDiDC(). This is the way to calculate the main control period using the Hilbert Transform combined with the Dual Differential algorithm. The market signal components are complex averaged and smoothed in the EMA to avoid any undesired cross products in the subsequent multiplication steps. Periods are solved directly from the smoothed in-phase and quadrature components. The temporary calculation of the denominator is performed as Value1 to ensure that the denominator does not have a zero value. The sign of Value1 is reversed with respect to the theoretical equation because the difference is looked back in time.
4. EhlersCycPer(). This is Cycle Period. It shows how to calculate the current cycle period, which is the approximate number of bars between the current peak or trough and the next peak or trough.
5. EhlersCycPer2(). This is another version of Cycle Period.
6. EhlersBPZC(). This is the Bandpass Zero Crossings method. Traders who have a better understanding of digital filter theory will know that the main control period can be found by constraining the bandwidth of the bandpass filter, and other period components are filtered out, and then the output signal will be like a sine wave, when the sine wave starts crossing over from a zero point. It is a cycle to crossover zero to the next time.
7. EhlersAutoPer(). This is the Autocorrelation Periodogram method. The construction of the autocorrelation periodogram starts with the autocorrelation function using a minimum of three average candlesticks. Extract loop information using the discrete Fourier transform (DFT) of the autocorrelation results. Compared with other spectrum estimation techniques, this method has specific advantages (which do not mean that these advantages are more obvious in practical applications).
8. EhlersHoDyDCE(). This is an algorithm that Ehlers uses to calculate the main control period using Bandpass Filtering combined with Homodyne Discriminator.
9. EhlersPhAcDCE(). This is the algorithm that Ehlers uses Bandpass Filtering combined with Phase Accumulator to calculate the main control period.
10. EhlersDuDiDCE(). This is how Ehlers uses Bandpass Filtering combined with Dual Differential algorithm to calculate the dominant cycle.
11. EhlersDFTDC(). This is the method of extracting the dominant period by discrete Fourier transform.
12. EhlersDFTDC2(). This is a method of extracting the dominant period using multiple bandpass filters combined with discrete Fourier transforms.
The dc_ta library can enable traditional indicators, but there is also a difficulty here, that is, the problem of scaling dynamic adaptive parameters: which value is the benchmark, and how much amplitude is the best. I understand that the use of the dc_ta adaptive library can only undertake part of the work of tracking market changes by the algorithm, and it is still necessary to control the long-term drift of the algorithm. I am still in the research stage. At present, in addition to calibration, the calculated period lag still needs to be evaluated. That is to say, if the calculated cycle is already obsolete, it is of little significance to the current market. Who are interested in this topic are welcome to exchange relevant insights with me.
Re-visit SARSometimes when inspiration comes, you have to grasp it in time and quickly turn your ideas into code. It is said that I suddenly wanted to explore SAR today, but the original plan was disrupted. I summed up some past scripts wholeheartedly, and released the sar_ta library.
A common SAR is an acronym for "Stop And Reveres". It means stop loss turning and was created by American technical analysis guru Wells Wilder. It is an easy-to-learn and relatively accurate medium- and short-term technical analysis tool. SAR uses a parabolic method to adjust the position of the stop loss at any time to observe the buying and selling points. Because the stop loss point (also known as the turning point) moves in an arc, many people in China call it the parabolic turning indicator.
SAR has two meanings:
One is "Stop", which means stop loss, stop loss, which requires investors to set a stop loss price before buying or selling a stock to reduce investment risks. And this stop-loss price is not always the same, it is constantly adjusted with the fluctuation of the stock price. How to effectively control potential risks without missing the opportunity to earn greater returns is the goal pursued by every investor. However, the stock market situation is unpredictable, and different stocks have different trends in different periods. If the stop loss level is set too high, the stock may be sold when it adjusts and falls, and the sold stock will expand from then on. A new uptrend misses the opportunity to earn greater profits. On the contrary, if the stop loss is set too low, it will not be able to control the risk at all. Therefore, how to accurately set the stop loss level is the purpose of various technical analysis theories and indicators, and the SAR indicator has its own unique function in this regard.
The second is "Reverse", which means reversal and reverse operation, which requires investors to set a stop loss level before deciding to invest in stocks. The stock is closed, and the reverse short operation can be carried out while the position is closed, in order to maximize the income. At present, the domestic market does not allow shorting, so investors mainly use two methods. One is to sell the stock in time and wait and see when the stock price falls below the stop-loss price. When the time comes, buy stocks in time or hold stocks to rise.
Compared with other technical indicators, the SAR indicator can provide considerable help for quantitative investment, and it is simple and easy to operate:
1. Hold currency and wait and see. When the stock price of a stock is suppressed by the SAR indicator and keeps moving downward, investors can wait and see until the stock price breaks through the pressure of the SAR indicator and issues a clear buy signal before considering whether to buy or not. stock.
2. The shareholding is pending. When the stock price of a stock is above the SAR indicator and keeps moving upwards relying on the SAR indicator, investors can hold the stock all the way up until the stock price breaks down the support of the SAR indicator and issues a clear sell signal, then consider whether to sell or not. out of stock.
3. Clear stop loss. The SAR indicator has a very clear stop loss function, and its stop loss is divided into buy stop loss and sell stop loss. Sell stop loss means that when the SAR sends a clear buy signal, no matter what price the investor sold the stock at before and whether it lost or not, the investor should buy the stock in time and hold the stock to rise. Buy stop loss means that when the SAR indicator sends a clear sell signal, no matter what price the investor bought the stock at before and whether it made a profit or not, the investor should sell the stock in time and wait and see.
Hercules SAR is a private SAR I released, which is conveniently referred to as "Hercules SAR". The first goal of optimizing it is to be closer to the price trend, and the second is to filter out some short-term trend jitters. I compared it graphically with the traditional SAR, with Hercules in red and SAR built into TradingView in blue.
A common SAR is an acronym for "Stop And Reveres". It means stop loss turning and was created by American technical analysis guru Wells Wilder. It is an easy-to-learn and relatively accurate medium- and short-term technical analysis tool. SAR uses a parabolic method to adjust the position of the stop loss at any time to observe the buying and selling points. Because the stop loss point (also known as the turning point) moves in an arc, many people in China call it the parabolic turning indicator.
SAR has two meanings:
One is "Stop", which means stop loss, stop loss, which requires investors to set a stop loss price before buying or selling a stock to reduce investment risks. And this stop-loss price is not always the same, it is constantly adjusted with the fluctuation of the stock price. How to effectively control potential risks without missing the opportunity to earn greater returns is the goal pursued by every investor. However, the stock market situation is unpredictable, and different stocks have different trends in different periods. If the stop loss level is set too high, the stock may be sold when it adjusts and falls, and the sold stock will expand from then on. A new uptrend misses the opportunity to earn greater profits. On the contrary, if the stop loss is set too low, it will not be able to control the risk at all. Therefore, how to accurately set the stop loss level is the purpose of various technical analysis theories and indicators, and the SAR indicator has its own unique function in this regard.
The second is "Reverse", which means reversal and reverse operation, which requires investors to set a stop loss level before deciding to invest in stocks. The stock is closed, and the reverse short operation can be carried out while the position is closed, in order to maximize the income. At present, the domestic market does not allow shorting, so investors mainly use two methods. One is to sell the stock in time and wait and see when the stock price falls below the stop-loss price. When the time comes, buy stocks in time or hold stocks to rise.
Compared with other technical indicators, the SAR indicator can provide considerable help for quantitative investment, and it is simple and easy to operate:
1. Hold currency and wait and see. When the stock price of a stock is suppressed by the SAR indicator and keeps moving downward, investors can wait and see until the stock price breaks through the pressure of the SAR indicator and issues a clear buy signal before considering whether to buy or not. stock.
2. The shareholding is pending. When the stock price of a stock is above the SAR indicator and keeps moving upwards relying on the SAR indicator, investors can hold the stock all the way up until the stock price breaks down the support of the SAR indicator and issues a clear sell signal, then consider whether to sell or not. out of stock.
3. Clear stop loss. The SAR indicator has a very clear stop loss function, and its stop loss is divided into buy stop loss and sell stop loss. Sell stop loss means that when the SAR sends a clear buy signal, no matter what price the investor sold the stock at before and whether it lost or not, the investor should buy the stock in time and hold the stock to rise. Buy stop loss means that when the SAR indicator sends a clear sell signal, no matter what price the investor bought the stock at before and whether it made a profit or not, the investor should sell the stock in time and wait and see.
Hercules SAR is a private SAR I released, which is conveniently referred to as "Hercules SAR". The first goal of optimizing it is to be closer to the price trend, and the second is to filter out some short-term trend jitters. I compared it graphically with the traditional SAR, with Hercules in red and SAR built into TradingView in blue.
SZSE:159949 ChiNext 50 Quotes from TradingView
The other one, which I think is better optimized is Taurus SAR, which is recorded as "Taurus" SAR. In contrast, it pays more attention to the filtering of disturbance signals. The comparison is as follows, the yellow is Taurus, and the blue is the built-in classic SAR of TradingView.
SZSE: 159949 GEM 50 quotes from TradingView
SAR's criteria for judging price trends are mainly:
1. When the stock price starts to break above the SAR curve from below the SAR curve, it is a buy signal, indicating that a round of rising stock prices may unfold, and investors should buy stocks quickly and in a timely manner.
2. When the stock price breaks through the SAR curve and continues to move upward and the SAR curve moves upward at the same time, it indicates that the upward trend of the stock price has been formed, and the SAR curve constitutes a strong support for the stock price. Overweight to buy stocks.
3. When the stock price starts to break down the SAR curve from the top of the SAR curve, it is a sell signal, indicating that a round of decline in the stock price may start. Investors should sell the stock quickly and in a timely manner.
4. When the stock price breaks through the SAR curve and continues to move downward, and the SAR curve also moves downward at the same time, it indicates that the downward trend of the stock price has been formed, and the SAR curve poses huge pressure on the stock price. Investors should resolutely hold the currency and wait and see. High lighten up.
Of course, the above is just a classic point of view. In a comprehensive quantitative system, SAR is only a good functional module, and it still needs to resonate with other factors to judge the market.
sar_ta is an impure sar_ta library
The original intention is to compare the performance of various similar SARs in order to screen better strategic factors. It turns out that there are actually very few variants of pure SAR technology. However, there are many SAR-like technologies that have already emerged. Therefore, this library also includes similar technical indicators such as Gann Hilo activator and Chandelier Exit, which are rare but work well.
I finally decided to open source this library to facilitate more people to learn and exchange SAR-like technologies. For members of the community who can provide me with some help, I have clearly written some incentives on the sar_ta library release page, which can not only activate the atmosphere, but also benefit each other.
HOW-TO use Sextan Strategy Backtesting FrameworkBacktesting of technical indicators and strategies is the most common way to understand a quantitative strategy. However, the complicated configuration and adaptation work of backtesting many quantitative tools makes many traders who do not understand the code daunted. Moreover, although I have written a lot of strategies,
However, I am still not very satisfied with the backtest configuration and writing efficiency. Therefore, I have been thinking about how to build a backtesting framework that can quickly and easily evaluate the backtesting performance of any indicator with a "long/short entry" indicator, that is, a "simple backtesting tool for dummies". The performance requirements should be stable, and the operation should be simple and convenient. It is best to "copy", "paste", and "a few mouse clicks" to complete the quick backtest and evaluation of a new indicator.
Luckily, I recently realized that TradingView provides an "Indicator on Indicator" feature, which is the perfect foundation for doing "hot swap" backtesting. My basic idea is to use a two-layer design. The first layer is the technical indicator signal source that needs to be embedded, which is only used to provide buy and sell signals of custom strategies; the second layer is the trading system, which is used to receive the output signals of the first layer, and filter the signals according to the agreed specifications. , Take Profit, Stop Loss, draw buy and sell signals and cost lines, define and send custom buy and sell alert messages to mobile phones, social software or trading interfaces. In general, this two-layer design is a flexible combination of "fixed and flexiable", which can meet the needs of most traders to quickly evaluate the performance of a certain technical indicator. The first layer here is flexible. Users can insert their own strategy codes according to my template, and they can draw buy and sell signals and output them to the second layer. The second layer is fixed, and the overall framework is solidified to ensure the stability and unity of the trading system. It is convenient to compare different or similar strategies under the same conditions. Finally, all trading signals are drawn on the chart, and the output strategy returns. test report.
The main function:
The first layer: "{Sextan} Your Indicator Source", the script provides a template for personalized strategy input, and the signal and definition interfaces ensure full compatibility with the second layer. Backtesting is performed stably in the backtesting framework of the layer. The first layer of this script is also relatively simple: enter your script in the highlighted custom script area, and after ensuring the final buy and sell signals long = bool condition, short = bool condition, the design of the first layer is considered complete. Input it into the PINE script editor of TradingView, save it and add it to the chart, you can see the pulse sequence in yellow (buy) and purple (sell) on the sub-picture, corresponding to the main picture, you can subjectively judge that the quality of the trading point of the strategy is good or bad.
The second layer: "{Sextan} PINEv4 Sextans Backtest Framework". This script is the standardized trading system strategy execution and alarm, used to generate the final report of the strategy backtest and some key indicators that I have customized that I find useful, such as: winning rate , Odds, Winning Surface, Kelly Ratio, Take Profit and Stop Loss Thresholds, Trading Frequency, etc. are evaluated according to the Kelly formula. To use the second layer, first load it into the TrainingView chart, no markers will appear on the chart, since you have not specified any strategy source signals, click on the gear-shaped setting next to the "{Sextan} PINEv4 Sextans BTFW" header button, you can open the backtest settings, the first item is to select your custom strategy source. Because we have added the strategy source to the chart in the previous step, you can easily find an option "{Sextan} Your Indicator Source: Signal" at the bottom of the list, this is the strategy source input we need, select and confirm , you can see various markers on the main graph, and quickly generate a backtesting profit graph and a list of backtesting reports. You can generate files and download the backtesting reports locally. You can also click the gear on the backtest chart interface to customize some conditions of the backtest, including: initial capital amount, currency type, percentage of each order placed, amount of pyramid additions, commission fees, slippage, etc. configuration. Note: The configuration in the interface dialog overrides the same configuration implemented by the code in the backtest script.
How to output charts:
The first layer: "{Sextan} Your Indicator Source", the output of this script is the pulse value of yellow and purple, yellow +1 means buy, purple -1 means sell.
The second layer: PINEv4 Sextans Backtest Framework". The output of this script is a bit complicated. After all, it is the entire trading system with a lot of information:
1. Blue and red arrows. The blue upward arrow indicates long position, the red downward arrow indicates short position, and the horizontal bar at the end of the purple arrow indicates take profit or stop loss exit.
2. Red and green lines. This is the holding cost line of the strategy, green represents the cost of holding a long position, and red represents the cost of holding a short position. The cost line is a continuous solid line and the price action is relatively close.
3. Green and yellow long take profit and stop loss area and green and yellow long take profit and stop loss fork. Once a long position is held, there is a conditional order for take profit and stop loss. The green horizontal line is the long take profit ratio line, and the yellow is the long stop loss ratio line; the green cross indicates the long take profit price, and the yellow cross indicates the long position. Stop loss price. It's worth noting that the prongs and wires don't necessarily go together. Because of the optimization of the algorithm, for a strong market, the take profit will occur after breaking the take profit line, and the profit will not be taken until the price falls.
4. The purple and red short take profit and stop loss area and the purple red short stop loss fork. Once a short position is held, there will be a take profit and stop loss conditional order, the red is the short take profit ratio line, and the purple is the short stop loss ratio line; the red cross indicates the short take profit price, and the purple cross indicates the short stop loss price.
5. In addition to the above signs, there are also text and numbers indicating the profit and loss values of long and short positions. "L" means long; "S" means short; "XL" means close long; "XS" means close short.
TradingView Strategy Tester Panel:
The overview graph is an intuitive graph that plots the blue (gain) and red (loss) curves of all backtest periods together, and notes: the absolute value and percentage of net profit, the number of all closed positions, the winning percentage, the profit factor, The maximum trading loss, the absolute value and ratio of the average trading profit and loss, and the average number of K-lines held in all trades.
Another is the performance summary. This is to display all long and short statistical indicators of backtesting in the form of a list, such as: net profit, gross profit, Sharpe ratio, maximum position, commission, times of profit and loss, etc.
Finally, the transaction list is a table indexed by the transaction serial number, showing the signal direction, date and time, price, profit and loss, accumulated profit and loss, maximum transaction profit, transaction loss and other values.
Finally, I will explain that this is just the beginning of this model. I will continue to optimize the trading system of the second layer. Various optimization feedback and suggestions are welcome. For valuable feedback, I am willing to provide some L4/L5 technical indicators as rewards for free subscription rights.
How to implement Fibonacci change time algorithmI believe that many traders must be familiar with the Fibonacci sequence. In actual combat, we also use the Fibonacci sequence to predict the probability of a change in direction at an important stage of the market. , In the market analysis method, the Fibonacci sequence appears frequently.
The price trend of the market is cyclical, and the time period is the mystery of the rise and fall of stock prices. In the cycle theory, no matter how to look for a variable inventory, the Fibonacci sequence is one of the foundations of various important analysis, also known as "Magic Numbers" or "Fibonacci Cycles". Here comes the concept of the Fibonacci sequence.
The Fibonacci Sequence is a sequence of numbers introduced by the mathematician Leonardo da Fibonacci to reveal the laws of nature by taking the breeding of rabbits as an example: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233... Starting from the third number in the sequence, each number is equal to the sum of the previous two adjacent numbers. The quotient of two adjacent items in the Fibonacci sequence is close to the golden ratio of 0.618, hence the name "magic number".
How to call out the Fibonacci cycle in Tradingview, the specific operation is as follows.
After opening the icon, select "Fibonacci Time Zone" in the third tool drawer from top to bottom in the "Drawing Toolbar" on the left. After clicking this icon, pull out the Fibonacci from the high point or low point Cycle, you can see from the chart that the approximate change node can be predicted in the sequence of the trading day. Although no technical analysis can accurately predict the market situation, through the study of Fibonacci cycle lines, the high and low points of stock prices are sometimes not exactly within these cycle lines, but the gap is roughly 2-5 days. In actual trading, you can’t foolishly wait for the value on the cycle to appear. It must be combined with the market environment, market sentiment, energy state, macro policy and other factors of the big cycle at that time to conduct a comprehensive analysis to find a time window with a high probability of existence.
SSE:000001 Quote from Tradingview
Then I adjust the chart cycle to the weekly market. The original daily changing line will be displayed in weekly units. Observe the Fibonacci sequence in the large cycle. When the daily and weekly market prices are relatively close, it means that The effectiveness of the variable disks tested on multiple levels has been further confirmed. Therefore, it is a very effective method to confirm the validity of the Fibonacci cycle line drawing by using the MTF test whether the Fibonacci sequence is still accurate and effective in predicting the variable inventory. Taking into account the actual situation, an error of +0 or +1 will be allowed on the large period, because the resolution of the large period is relatively large, and the difference is caused by the difference, which we should tolerate.
SSE:000001 Quote from Tradingview
Then someone will definitely ask, can this work of drawing Fibonacci cycle lines be implemented through the script of PINE V5? My answer is yes. Drawing Fibonacci cycles manually is usually more labor-intensive. Here I tentatively implement a technical indicator that automatically draws Fibonacci time windows. It can automatically locate the high and low points of historical prices and count them. When the period displayed by the counter is a Fibonacci number, it will be highlighted with a yellow background color and marked with the Fibonacci number. value. However, there are still some drawbacks in the algorithm judgment, after all, the artificial matching accuracy will be higher. I named this script L1 Fibonacci Counter (Fibonacci Counter), and it was designed using the functions of the blackcat1402/pandas_ta library. The source code is as follows:
Comparison of algorithm drawing and manual drawing effects:
Summary:
1. The Fibonacci sequence is a natural law. On the trading days near these numbers, the market is more likely to change.
2. When drawing Fibonacci cycle lines in small cycles, historical data is required for confirmation. When more high and low points fall on the Fibonacci sequence numbers, the more effective the drawing will be.
3. If the large period and small period resonate, the reliability of the variable disk is very high, but due to the problem of large period resolution, +1 error tolerance can be considered.
4. Fibonacci change inventory does not provide accurate buying and selling points, its performance is not reliable in small cycles, and there are certain rules in large cycles, but in practice, it still needs to be combined with market trends, market sentiment, other technical indicators, volume and energy, etc. factors to confirm the reliability of the variable disc.
How to use pandas_ta library to build R-Breaker indicatorToday is the first day of 2022. I hereby wish all my friends a smooth transaction in the new year, and your account will be N times profitable.
The reason why I write this article is not to simply introduce the R-Breaker strategy itself. I think many of my friends may have used this strategy for intraday short-term trading operations. And I hope to use this case to introduce how to use the pandas_ta library I just released for indicator and strategy design.
Many friends who are familiar with Python may find: Is the pandas_ta library not an open source library for Python? How can it be directly used in Tradingview? In fact, I spent some time and energy to convert the Python version of the pandas_ta library file into Tradingview's Pine v5 script, and used the latest library functions released in v5 to encapsulate most of the functions.
The pandas_ta library is a public library file containing functions that can be reused in Pine indicators, strategies or other libraries. They are useful for defining commonly used functions, so their source code does not have to be included in every script that requires them. The pandas_ta library is a public and open source Pine script library, so it is referenced in another script. In fact, according to Tradingview's release policy, all libraries must be released as open source before they can be publicly cited. In other words, public scripts can only use public libraries, and they must be open source. Private or personal scripts saved in the Pine editor can use public or private libraries. A library can use other libraries, or even its own previous version (Tradingview requires that the version number of the library must be noted when importing).
If you want to use the pandas_ta library, it is done through the import statement in the following format:
import //
Among them, the path // will uniquely identify the library. must be specified explicitly. In order to ensure the reliability of scripts that use the library, there is no way to automatically use the latest version of the library. Each time the author of the library updates, its version number will increase. If you plan to use the latest version of the library, you need to update the value in the import statement. The as part is optional. When used, it defines the namespace that will reference library functions. For example, if you import a library using the allTime alias as we did in the example below, you would call the library's function allTime.(). When no alias is defined, the name of the library becomes its namespace. To use the panadas_ta library, our script will need an import statement:
import blackcat1402/pandas_ta/2 as pta
The above is an introduction to the usage of the Tradingview library. Next, let me talk about the realization of the intraday short-term strategy R-Breaker.
The R-Breaker strategy is a short-term intraday trading strategy that combines trend and reversal trading methods. High, Close and Low PreClose are respectively the highest price of the current K-line, the closing price of the current K-line, the lowest price of the current K-line and the closing price of yesterday. Through these prices, a pivot point (Pivot Point) can be set, and many people in China also refer to it as the "pocket pivot." With the "pocket pivot", we can calculate the support and resistance levels for buying and selling. They are:
-Breakthrough buying price = Observing selling price + 0.25 * (Observing selling price-Observing buying price)
-Observe the selling price = High + 0.35 * (Close – Low)
-Reversal selling price = 1.07 / 2 * (High + Low) – 0.07 * Low
-Reversal buying price = 1.07 / 2 * (High + Low) – 0.07 * High
-Observe the buying price = Low – 0.35 * (High – Close)
-Breakthrough selling price = Observing the buying price-0.25 * (Observing the selling price-Observing the buying price)
R-Breaker trading strategy details:
-1) When the intraday highest price exceeds the observed selling price, and the intraday price falls back and further breaks below the support line constituted by the reversal selling price, a reversal strategy is adopted, that is, at this point (backhand, open position) ) Short;
-2) When the intraday lowest price is lower than the observed purchase price, and the intraday price rebounds and further exceeds the resistance line constituted by the reverse purchase price, a reversal strategy is adopted, that is, at this point (backhand, open position) ) Long;
-3) In the case of a short position, if the intraday price exceeds the breakthrough buying price, a trend strategy is adopted, that is, open a long position at that point;
-4) In the case of a short position, if the intraday price breaks below the selling price, a trend strategy is adopted, that is, open a short position at that point.
R-Breaker indicator usage
-Generally used in short periods such as minute periods (I generally use 30 minutes and 1 hour periods, taking into account the response speed and stability), or the T+0 varieties with strong shares.
-It is best to perform double verification based on other indicators such as volume, price, market, and sector.
-The green label B is for early warning and buying.
-The red S label is short warning and sell.
Use pandas_ta library file to build R-Breaker
At the beginning of script writing, you need to use import to import the pandas_ta library, as follows:
//@version=5
indicator(" L2 Intraday R-Breaker Indicator", overlay = true)
import blackcat1402/pandas_ta/2 as pta
After naming the pandas_ta library as pta, you need to use "pta." as the prefix when referencing functions in it, for example:
preclose = callsec(syminfo.tickerid, "D", close, false)
nn = ta.barssince(dayofmonth!=pta.xrf(dayofmonth,1))+1
hh = pta.xrf(pta.xhh(high,nn),nn)
ll = pta.xrf(pta.xll(low,nn),nn)
Do not use pta.xrf, pta.xll, pta.xhh to reference the functions in the pandas_ta library.
In summary, this is the whole content of the tutorial. The tradingview library is very convenient to use, which can greatly improve coding efficiency and focus on the development of core strategies.
HOW-TO add dynamic alerts to whale jump out of ocean
This tutorial applies to the (blackcat) L5 Whales Jump Out of Ocean X indicator. This is an Invite-Only indicator based on Tradingview. By adding the dynamic message alerts, 30~400 trading pairs tracking signals can be set in the premium account of Tradingview, once the whale/banker fund is detected. The Tradingview alert system will send the alarm information to your mobile phone, App or email to remind you according to your customized configurations.
The reason why I added this function is that @azrultebi, on 2021-04-12, proposed to add an alert function to this indicator. The specific requirements are:
1. when whale start jump long or short entries.
2. fibonacci bottom and top time window.
3. long entry motive waves or short entry corrective waves.
Alerts for Whale Jumps
For the whale jump alert signal, the function definition is relatively intuitive. Short at the first yellow bar when the short whale appears, and close short position the first green bar that appears after; in the same way, long at the first fuchsia bar when the long whale appears, and close long position at the first red bar that appears afterwards. Therefore, there are 4 alerts for whale jump signals, namely Whale SHORT (S+), Whale LONG (L+), Whale XSHORT (XS+) and Whale XLONG, (XL+). These four signals are relatively reliable, and try to use them in a time frame greater than or equal to 1 hour. The larger the time frame, the more stable the entry signal. The trigger frequency of these alert signal is the first function call in the latest candlestick to trigger the alert.
Alerts for Waves
For the wave alert signal, the definition of long-short reversal is rather vague. I used John Ehlers' filtering technology to process the wave digitally, filtering out a lot of noise signals, and ensuring that its delay is within 1 to 2 candle bars. However, it is still difficult to filter the frequent entries in sideways market. The difficulty of this operation is that some good trading points are born in the sideways. I have tried to add Chop Index Filter for filtering, but found that some buying and selling points will also be filtered out and lose profits. Therefore, I gave up the sideways filtering mechanism. I directly utilize the filtered moving average golden cross and dead cross to produce a wave entry signal. According to the definition of Elliott Wave Theory, a motive wave is a long wave, and the incoming signal is Wave LONG (L); similarly, a corrective wave is a short wave, and the incoming signal is Wave SHORT (S). It is worth noting that the wave alerts did not generate a close/exit signal. Therefore, the wave alert has only two signals: long and short. Compared with the wave long-short signal and the whale long-short signal, the main difference is in the trend strength and certainty of the market trend. Obviously, the whale signal is stronger than the wave signal in trend strength and certainty, so when placing an order, the order size and position control can be defined accordingly. For wave signal, small order sie can be used for test/verification; For whale signal, half of balance can be used to follow up.
Alerts for Fibonacci Time Windows
For Fibonacci Time Window "Support" or "Resistance" signal, I did not add alerts here because they are blur and not suitable as precise entry signal.
HOW-TO add alerts
Alerts in this script use an`alert()` function which allows a fully dynamic message to be generated when the alert triggers. To create the new alerts: Create one alert for the script using the chart’s “Create Alert” dialog box and select an alert type including “alert() function call”.
The Alert message format is like:
"
Symbol: BINANCE:DOGEUSDT,
Whale LONG (L+),
Price: 0.592
"
This format generates automatically from the indicator and you do not need to set any input parameters besides alert configurations.
If you are fresh on Tradingview Alerts, I recommend you to read Tradingview manual and blog as,
(1) How to set up alerts, www.tradingview.com
(2) Our New Alerts Allow for Dynamic Messages, www.tradingview.com
HOW-TO use whale jump out of ocean indicator
Whale and Banker Fund Tracking Indicator
I have been working on developing indicators on how to track the banker funds or whales. In my open-source indicators published, you can search for the keywords "Banker" or "Whale" to find and use these indicators. After three years of development and hard work, I have perfectly combined the banker fund/whale mathematical model and the unique Fibonacci space-time indicators. This is named as "L5 Whales Jump Out of Ocean X" indicator that I will introduce today. First of all, I want to state the three premises for using this indicator.
1. This indicator is not an open-source indicator, it is an Invite-Only indicator based on Tradingview scheme. You need to use TradingView Coin or cryptocurrency to redeem usage permissions for a period. I strongly recommend that more people use the free and open-source indicators I published. This L5 indicator is only for or suitable for TradingView community members who have a strong desire to use it and don't mind the closed-source form of the script.
2. "L5 Whales Jump Out of Ocean X" indicator is only suitable for discretionary trading, and does not support automatic trading system/bots with alerts. Users who are willing should know the scope of use of this indicator in advance, and determine whether it is suitable for your own situation before deciding whether to redeem the permission to use it.
3. You cannot delegate the full responsibility of your trading decisions to this indicator, I hope you will do so knowing that much more trading knowledge, skills and live trading experience than access to this script is needed to become a successful trader.
This indicator introduces three independent judgment standards. They are whales & waves, Fibonacci time windows and dynamic Fibonacci retracement arrows. Whales and waves are banker fund/ whale behavior modeling based on my unique moving average technology. Fibonacci time and space indicators are a unique improvement I made to traditional indicators of the same kind to make them more powerful.
Application Scenarios
This indicator is basically applicable to all markets, but requires traders to choose the most suitable trading pair to operate. This indicator is used for multiple periods. Because the smaller the period, the more unstable the data, the larger the period, the more stable the Fibonacci space-time indicator. I use this indicator for the operation of cryptocurrency, commodities, forex, local stocks and ETFs. When this indicator is combined with the candle patterns of Japanese candlesticks, it will often produce higher quality signals, so I suggest that people who use this indicator should have the basic knowledge of Japanese candlesticks in order to better use this indicator.
What are "Long Whales" and "Short Whales "?
One of the biggest differences between cryptocurrency and traditional financial markets is that cryptocurrency is based on blockchain technology. Individual investors can discover the direction of the flow of large funds through on-chain transfers. These large funds are often referred to as Whale. Whale can have a significant impact on the price movements of cryptocurrencies, especially Bitcoin . Therefore, how to monitor Whale trends is of great significance both in terms of fundamentals and technical aspects.
We often see whales suddenly jump out of the ocean and then set off huge waves. What we need to do is to surf the wave according to the trend after the whale jumps out of the sea. This is really an exciting sport!
Therefore, in this indicator. "Long Whales" denotes banker fund is pumping the price, which is presented as fuchsia and red stick bars (Motive waves with fuchsia color; corrective waves with red color). On the ohter hand, "Short Whales " means banker fund is dumping the price, which is described by yellow and red green stick bars (Motive waves with yellow color; corrective waves with green color).
Concepts of whales and waves are inroduced to judge the power balance between long and short, respectively. There are two types of whales: long whales (fuchsia-red stick bars) and short whales (yellow-green stick bars). In response to this, there are two types of waves: long waves (fuchsia-red areas) and short waves (yellow-green areas). The color is mainly used to distinguish whether it is a motive wave or a corrective wave (if you have been exposed to Elliott wave theory, this concept will be much clearer). Long whales and waves use fuchsia color represents motive waves (bullish), red represent corrective waves (bearish); short whales and waves use yellow color represent motive waves (bearish), and green color represent corrective waves (bullish). Because the behavior of this model is indeed very close to the phenomenon of whales jumping out of the ocean to stir up waves in nature, it is named. When using, you need to pay attention to the amplitude of long and short waves and the comparison between the two. For example: If the amplitude of the short wave is gradually higher than the long wave until a certain level, there will be a short whale ermerging, that is to say, the short-whale goes out of ocean and stimulates a short wave amplitudes. This is a good time to go short until the yellow stick bar turns into a green stick bar (the motive short wave becomes a corrective short wave). Once the green stick bar appears, it is the time to close the short position. The same goes for long.
What are "Long Waves" and "Short Waves"?
Waves are generated by whales and they will forcast when whales emerge. In this indicator, fuchsia and red areas (Motive waves with fuchsia color; corrective waves with red color) stand for long Waves; while yellow and red green areas (Motive waves with yellow color; corrective waves with green color) stand for Short Waves.
Long whales and short whales are used to track the trading of banker funds. How to judge when the banker funds do not move? The answer is to use wave conditions for observation. When there are no whales, please observe whether the wave is dominated by long waves or short waves. Long motive waves are represented by fuchsia color, long corrective waves are represented by red; short motive waves are represented by yellow, and corrective waves are represented by green.
The wave characteristics of this indicator are used to predict whether whales will appear in addition to the normal long-short power comparison. Before the whale goes out of ocean, in nature, the waves on the sea will fluctuate greatly. This phenomenon also appears in this indicator. As long as banker funds start to take action, they will definitely be reflected in the waves. This phenomenon can predict the trend of banker funds. For example: when the long wave gradually surpasses the short wave, and continues to rise and rise, so as to exceed the normal level in the past, this may indicate that the whale is going to jump out to pump or dump.
Fibonacci Time Window Background Color Indicator
The Fibonacci time window is an indicator that suggests periodic price positions. Its principle is to judge the number of times the current candle appears on the time axis when the retreat time period is a Fibonacci number. If the current candle is in the historical data, multiple times coincide with the price high or low of the cycle that the Fibonacci number will retreat, and the number of times exceeds a certain threshold, the indicator will determine that the current candlestick is in Fibonacci time window. On the Fib time period, it is usually the time point near the long-short reversal. The principle of this indicator is completely dependent on time and historical price highs and lows. It is a technical indicator independent of price trends and volume. Combining it with whale-wave can effectively improve the signal quality. Once resonance occurs, signal reliability will also be improved. The Fibonacci time window is represented by the indicator background color. When the Fibonacci time window indicates that the current candlestick is a potential lowest point in time, the background color is green; when the Fibonacci time window indicates that the current candlestick is a potential highest point in time, the background color is red.
Fibonacci Space Retracement Arrow Indicator
At present, there are many technical indicators related to Fibonacci retracement in the community. Fibonacci retracement levels are horizontal lines that indicate where support and resistance are likely to occur. They are based on Fibonacci numbers. Each level is associated with a percentage. The percentage is how much of a prior move the price has retraced. The Fibonacci retracement levels are 23.6%, 38.2%, 61.8%, and 78.6%. While not officially a Fibonacci ratio, 50% is also used.
However, in "L5 Whales Jump Out of Ocean X", a smarter way than the traditional Fibonacci retracement is adopted. First of all, my Fibonacci retracement is dynamically configured and adaptive. The Fibonacci retracement position is dynamically represented by up and down arrows with different color intensity (if you are used to using traditional Fibonacci retracement indicators, you may need to adapt to this new model). In other words, you do not need to configure a fixed-length back-off period to find high and low points. It counts the results of Fibonacci retracements of multiple short, medium and long periods (periods are still not fixed values here, but adaptive under an upper limit). If there are many times in this statistical result that the current candlestick falls on the key Fibonacci retracement positions of multiple short-term, mid-term and long-term historical data, a stronger chromatic arrow (brightest) will be displayed. Conversely, if only a few statistics are hit, the arrow with the weaker chromaticity (darkest). These arrows are dynamically deployed on the whale and wave oscillators, and "SUP" indicates the Fib support level, "RES" indicates the Fib resistance level, "*SUP" indicates a preparatory signal, and the support level will appear later, and "*RES" indicates a preparatory signal, the resistance level will appear later.
SPECIAL NOTE : Because Tradingview limits the number of labels (Label) used on the server side in order to save resources, not all historical data will have a dynamic Fibonacci retracement arrow sign. Instead, the Fibonacci arrow display is only performed on the finite period of the latest data retreat.
Preparatory Signal X
Another major feature of this indicator is to provide preliminary signals for support and resistance levels. Please note: Preliminary signals are not signals of support or resistance levels. They are only early reminders that one candle or a few candles will touch the support and resistance of historical data. So don't be nervous, it is best to see the state after the price touches or breaks through the support and resistance levels before making a decision. The preparatory signal is indicated by a cross "×" in the indicator. If the preliminary signal is red "×" and displays "*RES", the market meaning of this preliminary signal is that the subsequent price may touch the historical resistance level; if the preliminary signal is green "×" and displays "*SUP", this market implication of the preliminary signal is that the price may touch the historical support level later. Finally, the preliminary signals will not fluctuate with the value of the indicator, they will only appear on the zero axis.
Multi-Timeframe Observation
This indicator is suitable for multiple time frames. Generally speaking, multiple time frames of observation are helpful to determine whether the signal is reliable. You can use Tradingview's chart to focus on two time frame levels at the same time, typically the multiplier is 4 to 6 times. For example: if your operation level is 1H, you can also pay attention to the trend changes on the 4H. This helps to make the right decision without being affected by the subtle fluctuations of the current time frame.