Dynamic Structure Indicator

ZenAndTheArtOfTrading Premium 업데이트됨   
This is a dynamic structure indicator designed to map potential support and resistance zones (in all markets). It does this by looking back x amount of candles to identify major swing highs and lows on the specified reference timeframe, and then it draws a zone between the highest/lowest wick and the highest/lowest candle close across the chart until a new zone is created.

The settings are important because it gathers data from a separate reference timeframe, so sometimes it will map zones that aren’t really appropriate for lower timeframes. On lower timeframes (1Hr and under) I’d recommend setting the reference timeframe to your actual trading timeframe and increasing the lookback period to fine-tune the zone mapping. The script is set for 4 Hour forex charts by default.

Please note: the max zone option is disabled by default because it is different for every instrument, but this is a useful feature that I recommend using. Sometimes the indicator picks up huge gaps that aren’t really considered support or resistance zones. If this happens to you, use the zone size settings to invalidate huge (or tiny) zones. The zone size is in pips.

To be honest I didn’t get this indicator to be quite as accurate as I envisioned and it’s still a work in progress as I learn pine script, but this is the best I’ve been able to get it to function and with the right settings it works fairly well so I figured I might as well release this first version. Maybe someone with better skills than me can help refine it to more accurately identify major fractals and levels - if so, please get in touch! All traders should be able to identify their own major levels by eye anyway, but this script is intended to be a building block for future signal indicators I wish to develop.

Last of all - please don’t use this indicator to trade blindly! Often price will blast right through these zones and the zones aren’t always accurate. Remember that structure levels only work if they’re obvious to other traders, and always wait for confirmation signals that meet your trade plan rules before entering trades – especially reversals or counter-trend trades.

If you have any questions or tips to improve the script, feel free to leave a comment or private message me.

Enjoy, and good luck out there :)

- Matt.
릴리즈 노트: - Added an offset feature that maps the zones a slightly further distance from their point of origin
- Fixed the zone coloring change when zones are broken and closed above/below
릴리즈 노트: v1.2:

- Added an offset feature that maps the zones a slightly further distance from their point of origin
- Fixed the zone coloring change when zones are broken and closed above/below
릴리즈 노트: Fixed pip zone size input so that the indicator works for all instruments by default.
릴리즈 노트: Minor improvements
릴리즈 노트: Updated to Pine Script version 4
릴리즈 노트: Rewrote entire source code. The new settings behave as following:
- Draw Previous Structure: Saves previous structure to draw above/below more recent structure
- Reference Timeframe: This is the timeframe to reference for swing highs & lows
- High/Low Lookback: This is how far to lookback for highs & lows (on reference timeframe)
- Max Zone Size (Compared To ATR): Invalidates zone if zone exceeds this multiplier of the ATR
- Zone Update Count Before Reset: This is used to determine when to stop drawing previous structure

Now when the script detects a new structure zone, it checks:
- Is there already a previous structure zone being drawn?
> If not, then save the current zone before changing it and draw that in addition to the new one
> If there is an existing previous zone, then wait until price violates that zone before changing it
> If the number of new zones that have been detected exceeds Zone Update Count, reset previous zone

The Zone Update Count Before Reset setting is used to remove old zones after enough time has passed that it is no longer relevant to recent price action.

Basically, the script now detects major swing highs & lows on your reference timeframe determined by fractal candles (google it if you're not sure what that is). Once it detects a major swing high or low, it draws the zone between the wick and the body of that swing high/low over intraday price action until your reference timeframe violates that zone with a close above/below.

Once a violation is detected, it saves the old zone (if "Draw Previous Structure" is turned on) and begins searching for a new zone while still drawing the old zone. If the old zone gets violated, then it stops drawing that zone. If the old zone never gets violated, then after X amount of new zones have been detected it will forcibly remove itself (with X being your "Zone Update Count Before Reset" override setting).

This is my best effort at automating the detection of major support & resistance zones and is a constant work in progress as I become more proficient with Pine Script. I revisit this script every few months to see if I can improve it, but for now this is the best I can do! Feel free to modify and republish it if you have any better ideas (and definitely let me know if you do manage to improve its accuracy).

Check my blog & YouTube channel for more detailed instructions on how to use this script :)

- Matt.
릴리즈 노트: Added alert functionality.
- DSI Alert = Combines all alert conditions into 1 alert
- DSI Resistance Alert = Triggers alert if price touches resistance zone
- DSI Resistance Breakout = Triggers alert if intraday price action closes above resistance zone
- DSI Support Alert = Triggers alert if price touches support zone
- DSI Support Breakout = Triggers alert if intraday price action closes below support zone
릴리즈 노트: Dynamic Structure Indicator v2.0
- Rewrote entire script from scratch
- New script no longer uses other timeframe data, only current timeframe
- Significantly improved accuracy of zone detection
- Added alert functionality

What's it do?
The script detects major swing highs & lows, then waits for a 1ATR move in the opposite direction. If this occurs then the script draws a zone between the wick and body of that high/low until it's violated by a closing price. Once violated, it then begins looking for a new zone. If you have Draw Previous Structure turned on then the script will also draw the previous support/resistance zone until that gets violated again (support-turned-resistance etc).

ATR Movement Required: How many ATRs must price move from a high or low to validate a zone
High/Low Lookback: How many bars to look back to identify swing highs and lows in price action
Max Zone Size: If the zone size exceeds this multiplier of the current ATR then the zone is ignored
Zone Update Reset: This is used to force an update of previous dark S&R zones if they last too long
Draw Previous Structure: This turns on/off the darker colored zones which are previous S&R zones

DSI Alert: All of these alerts combined into 1
DSI Resistance Alert: Price is current testing resistance zone
DSI Resistance Breakout: Price is currently violating resistance zone
DSI Support Alert: Price is currently testing support zone
DSI Support Breakout: Price is currently violating support zone
릴리즈 노트: Updated to Pine Script v5

My Resources Hub: https://theartoftrading.com
FREE YouTube Lessons: http://rebrand.ly/zyt
FREE Pine Script Basics Course: http://rebrand.ly/zpsbc
Pine Script MASTERY Course: http://rebrand.ly/zpsmc
My Indicators & Strategies: http://rebrand.ly/zmisc
오픈 소스 스크립트

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


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

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