Simple Market Structure

This indicator is meant for education and experimental purposes only.

Many Market Structure Script out there isn't open-sourced and some could be complicated to understand to modify the code. Hence, I published this code to make life easier for beginner programmer like me to modify the code to fit their custom indicator.

As I am not a expert or pro in coding it might not be as accurate as other reputable author.
Any experts or pros that is willing to contribute this code in the comment section below would be appreciated, I will modify and update the script accordingly as part of my learning journey.

It is useful to a certain extend to detect Market Structure using Swing High/Low in all market condition.

Here are some points that I am looking to improve / fix:
  • To fix certain horizontal lines that does not paint up to the point where it breaks through.
  • To add in labels when a market structure is broken.
  • Allow alerts to be sent when market structure is broken (Probably be done in the last few updates after knowing it is stable and as accurate as possible)

Any suggested improvement, please do let me know in the comment section below and I will try my best to implement it into the script.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


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.

Want to use this script on a chart?