OPEN-SOURCE SCRIPT

Support and Resistance Zone

Support and Resistance Zone Indicator :


Introduction :

The purpose of this indicator is to identify the chart symbol's main supports and resistances. It displays these key zones, which are very important psychological points for traders. Since support and resistance are not very precise levels, the indicator displays them as zones.


Pivots :

Pivots are a key concept in identifying support and resistance. The indicator uses two types of pivot:
  • Pivot high : This is a high point that has not been reached by a user-defined number of candles on either the left and right of this candle. The "left pivot leg" is the number of candles before this pivot point that have not reached the realized high, and the "right pivot leg" is the number of candles after this pivot point that have not reached this high. If these two conditions are met, the pivot point is considered a turning point, and resistance is probably the cause.
  • Pivot low : This is a low point that has not been reached by a user-defined number of candles on either the left or right. The "left pivot leg" is the number of candles before this pivot point that have not reached the candle low, and the "right pivot leg" is the number of candles after this pivot point that have not reached this low. If these two conditions are met, the pivot point is considered a turning point, and support is probably the cause.



Support/Resistance area :

If a pivot point has been identified, the indicator considers it a resistance if it's a pivot high, or a support if it's a pivot low. To define the support or resistance zone, we'll use the ATR (Average True Range), an indicator that measures asset volatility. We'll take the ATR of the candle for which the pivot was spotted, and use it as the width of the support or resistance zone. Thus the upper line of support/resistance is at pivot+atr/2 and the lower line is at pivot-atr/2. The greater the volatility, the larger the zone.


New Support/Resistance :

If a new pivot has been identified, but the level of this pivot lies between the lower line and the upper line of the previous support or resistance, the indicator considers this to be the same support or resistance as before. In this case, no new support or resistance is created. The pivot must be outside the area of the previous support or resistance to be validated.


Anticipated Support/Resistance :

This indicator also allows early detection of support or resistance. To do this, the value of the right pivot legs will be shortened in order to find these areas more quickly. The support or resistance will then be considered anticipated and may disappear at any time if the high/low is reached. On the other hand, if the high/low is not reached, and a number of candles equal to the " Right Pivot Legs" parameter has elapsed since the detection of this anticipated support/resistance, it will be considered validated and will integrate the other supports/resistances of the chart.


Extended supports/resistances :

For a more optimal view, the indicator allows the user to choose the number of last support or resistance levels to be extended to the last candle. This must be specified in the indicator parameters.


Parameters :

  • Pivot Legs : Determine the left and right legs of the pivot i.e the number of candle before and after the pivot that doesn’t reach pivot point. The pivot is validated only if this two conditions are verified.
  • Extend Last Supports : Number of supports to extend to the last bar
  • Extend Last Resistances : Number of resistances to extend to the last bar
  • Show Support/Resistance Anticipated : If yes, will find anticipated support and resistance
  • Right Pivot Legs for Anticipation : Determine the right legs of pivots to find faster a support or a resistance.



Conclusion :

This indicator plot support and resistance zones based on pivot. The width of support and resistance zones are calculated with ATR. Possibility to find anticipated support and resistance in order to have more timeliness informations.


Enjoy the indicator and don’t forget to take the trade ;)
Bands and ChannelsPivot points and levelssentiment

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعد‎‎قوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟

إخلاء المسؤولية