TradingView
DoctaBot
Oct 21, 2022 3:44 AM

Mastering Market Structure 

Bitcoin / TetherUSBinance

描述

"Market structure first, always" - Mr. Anderson aka TrueCrypto28 right before he went on to master Kung-Fu

Understanding and identifying market structure is essential for successful and consistent profitability. No system is perfect, but trading in the direction of the prevailing market structure can reduce the likelihood of being caught severely offsides and can yield trades with tighter invalidations and greater risk-to-reward potential.

This script will automatically identify and plot the following:

Market Structure
  • Pivot highs and lows using the lookback left and right lengths are analyzed to identify major swing highs and lows to identify the current trading range.
  • Bullish structure is characterized by a series of higher highs and higher lows.
  • Bearish Structure is characterized by lower highs and lower lows.
  • Structure breaks when a bar closes outside the current trading range. Major swing highs and lows will update following these breaks to continue following the current price action
  • Current market structure bias, bullish or bearish, can be displayed in a table in the location of your choosing.
  • Structure is fractal, so seeing low time frame structure shift against the high time frame structure can identify the beginning of a pullback. When it realigns with the high timeframe structure, it can identify the beginning of the high time frame trend continuation. You can choose to analyze structure on any timeframe with this script and even add multiple copies of it to your chart each analyzing different a timeframes to easily find high quality trade opportunities.


Fibonacci Levels of the current trading range
  • These are included to help identify areas of interest for trade execution and profit levels.
  • We want to buy at a discount and sell at a premium. The "Wholesale Zone" can be considered below the 50% retracement level in bullish structure, or above it in a bearish structure.
  • When in a bullish structure, "discount" buy opportunities can be found below the 50% retracement level with the expectation of trend continuation.
  • In a bearish structure, more ideal "premium' sell opportunities can be found above the 50% retracement with the expectation of trend continuation.
  • Optimal trade entry (OTE) zone, between the 61.8% and 78.6% retracement can offer a great risk-to-reward ratio for execution of a new position in trending environments.
  • When trading sideways in a range, opening new buy positions near the bottom of the range or new sell positions from the top of the range are preferred. Midrange 50% level commonly sees some reaction and can be used as a primary target with further targets either being the opposite end of the range or lower support levels (see order block section).


Order Blocks
  • New Bullish and bearish order blocks are created and plotted with every respective market structure break. They identify the price level from which the most recent leg of price action that yielded the structure break began.
  • In strong trending environments, these levels should continue to support or resist price. They are great areas to look to enter new positions.
  • Order blocks can also be used as targets for your trades to avoid giving back unrealized profits as price tends to react off of these levels.
  • To keep your chart clean and the order blocks relevant, an order block will be automatically deleted if price trades through and closes beyond it. Otherwise, printed order blocks will remain on your chart until either it's origin bar is out of TradingView's maximum bar history allowance or their maximum box count allowance.
  • Pairing these with fibonacci levels, retracements into order blocks that are in the Wholesale Zone or even the OTE zone offer higher probability trades with more favorable risk-to-reward potential.


Swing Failure
  • Swing failure patterns (SFPs) arise when a candle takes out a swing high or low, but fails to close beyond it.
  • Again, pairing these with other features of this script like range boundaries, wholesale zones, OTE zones, and order blocks can help traders identify the best times to actually execute their trade as SFPs are commonly seen at points of inflection in price action.


Moving Averages
  • Up to 4 moving averages from the current time frame are available. MA type and lengths can be adjusted to your preference.
  • Up to 4 MTF MAs. By Default this is an EMA 200 as it is commonly used for trend identification and support/resistance.
  • These are included for confluence of trend direction and strength.
  • They can also act as dynamic support and resistance and so can be useful for trade execution if price bounces or rejects off of them or targets as price may do so when it reaches them.


Additionally, alerts have been coded for the following scenarios:
  • MS Break alerts will trigger on bar close when a break in market structure has been confirmed.
  • SFP alerts will trigger on bar close when the swing failure pattern has been confirmed.
  • Entering OB alerts will trigger as soon as price touches the closest order block.
  • Entering Wholesale Zone alerts will trigger as soon as price cross the 50% retracement level. This can be used as an early alert to identify assets that have undergone a significant pullback before potential continuation in the direction of the main trend.
  • Entering OTE Zone alerts will trigger as soon as price crosses into the Optimal Trade Entry zone between the 61.8% and 78.6% retracement.


This script is unique in the way that it tracks market structure, automatically updates as price action continues to develop, presents high quality areas of interest, and SFPs for trend reversal and continuation. Traders will no longer need to constantly monitor their charts or exhaustively update their alerts to find good trade opportunities. This script takes care of all of it automatically. Collectively, all of the included features can be used to build a complete trading system.

版本注释

Minor update to how order blocks are calculated to better target the beginning of the recent leg
评论
Nagast
nice job @DoctaBot just a question, do you plan to add more features like BMS CHoCH FVGs etc?
peterwillz87
Best indicator for market structure yet !!!!!!!!!!!!!!!!!!!!!
Why is this indicator not popular?
lavinsamuel
I cannot thank you(@DoctaBot) enough for coding "Market structure first, always" . Credits to Mr. Anderson aka TrueCrypto28 also for explaining this approach in such detail in his youtube video.
I have a doubt though regarding the D, 4H, 1H, 15m lines though? what does those lines represent? they do come in green/red colour lines. Does that say if its bullish or bearish in each of those timeframes?? If so, Sometimes I see disparities in the colour between the [BIAS window colour] and these lines. Hope you can give an explanation. Thanks.
DoctaBot
@lavinsamuel, Those are the MTF MAs. By default it is the 200EMA for those TFs, but you can change the MA type, length, and TFs in the settings
ETTROM
Congratulations! This is the best indicator based on SMC to detect CHoCH/BoS in price
boodinoorrr
Dear brother docta, i ask yuo to allow me to use the code for the indicator so that i can describe some of the tools. Thank you
HalfShellTrader
Super awesome indicator, dude. Very surprised it's not more popular.
behzadh666
hey man nice script just can you added to show break with shadow too not just close?
mtpfan
Please provide a color selection on OB level LABEL, it is white which is hard to read in white background, Thank you
spiritedJaguar47847
It's great.
love you 💕
更多