blackcat1402

How to implement Fibonacci change time algorithm

SSE:000001   SSE Composite Index
I 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.

Avoid losing contact!Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq 防止失联,请立即行动,加入本猫聊天群: discord.com/invite/ZTGpQJq
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.