HeWhoMustNotBeNamed

Extreme Trend Reversal Points [HeWhoMustNotBeNamed]

HeWhoMustNotBeNamed Premium 업데이트됨   
Using moving average crossover for identifying the change in trend is very common. However, this method can give lots of false signals during the ranging markets. In this algorithm, we try to find the extreme trend by looking at fully aligned multi-level moving averages and only look at moving average crossover when market is in the extreme trend - either bullish or bearish . These points can mean long term downtrend or can also cause a small pullback before trend continuation. In this discussion, we will also check how to handle different scenarios.

🎲 Components
🎯 Recursive Multi Level Moving Averages
Multi level moving average here refers to applying moving average on top of base moving average on multiple levels. For example,

Level 1 SMA = SMA (source, length)
Level 2 SMA = SMA (Level 1 SMA , length)
Level 3 SMA = SMA (Level 2 SMA , length)
..
..
..
Level n SMA = SMA (Level (n-1) SMA , length)

In this script, user can select how many levels of moving averages need to be calculated. This is achieved through "recursive moving average" algorithm. Requirement for building such algorithm was initially raised by @loxx
While I was able to develop them in minimal code with the help of some of the existing libraries built on arrays and matrix, I also thought why not extend this to find something interesting.

Note that since we are using variable levels - we will not be able to plot all the levels of moving average. (This is because plotting cannot be done in the loop). Hence, we are using lines to display the latest moving average levels in front of the last candle. Lines are color coded in such a way that least numbered levels are greener and higher levels are redder.


🎯 Finding the trend and range
Strength of fully aligned moving average is calculated based on position of each level with respect to other levels.

For example, in a complete uptrend, we can find

source > L(1)MA > L(2)MA > L(3)MA ...... > L(n-1)MA > L(n)MA

Similarly in a complete downtrend, we can find

source < L(1)MA < L(2)MA < L(3)MA ...... < L(n-1)MA < L(n)MA

Hence, the strength of trend here is calculated based on relative positions of each levels. Due to this, value of strength can range from 0 to Level*(Level-1)/2

0 represents the complete downtrend
Level*(Level-1)/2 represents the complete uptrend.

Range and Extreme Range are calculated based on the percentile from median. The brackets are defined as per input parameters - Range Percentile and Extreme Range Percentile by using Percentile History as reference length.

Moving average plot is color coded to display the trend strength.

Green - Extreme Bullish
Lime - Bullish
Silver - range
Orange - Bearish
Red - Extreme Bearish


🎯 Finding the trend reversal
Possible trend reversals are when price crosses the moving average while in complete trend with all the moving averages fully aligned. Triangle marks are placed in such locations which can help observe the probable trend reversal points. But, there are possibilities of trend overriding these levels. An example of such thing, we can see here:


In order to overcome this problem, we can employ few techniques.

1. After the signal, wait for trend reversal (moving average plot color to turn silver ) before placing your order.
2. Place stop orders on immediate pivot levels or support resistance points instead of opening market order. This way, we can also place an order in the direction of trend. Whichever side the price breaks out, will be the direction to trade.
3. Look for other confirmations such as extremely bullish and bearish candles before placing the orders.


🎯 An example of using stop orders

Let us take this scenario where there is a signal on possible reversal from complete uptrend.

Create a box joining high and low pivots at reasonable distance. You can also chose to add 1 ATR additional distance from pivots .

Use the top of the box as stop-entry for long and bottom as stop-entry for short. The other ends of the box can become stop-losses for each side.

After few bars, we can see that few more signals are plotted but, the price is still within the box. There are some candles which touched the top of the box. But, the candlestick patterns did not represent bullishness on those instances. If you have placed stop orders, these orders would have already filled in. In that case, just wait for position to hit either stop or target.


For bullish side, targets can be placed at certain risk reward levels. In this case, we just use 1:1 for bullish (trend side) and 1:1.5 for bearish side (reversal side)


In this case, price hit the target without any issue:
Wait for next reversal signal to appear before placing another order :)


릴리즈 노트: Updated short title

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?