TradingView
mentalRock19315
2 פבר׳ 2023 17:00

Orders Blocks [TK] 

EUR/USDOANDA

תיאור

This indicator draw only valid orders blocks on your 1 minute Chart

An order block is created when :
A bullish candle engulf a previous bearish candle
A bearish candle engulf a previous bullish candle

Once the order block is created, a zone is stretched to the actual bar

If the price goes into the order block zone, the zone is reduced accordingly
If the price cross the order block zone, the order block and its zone are deleted

This way, you will have on your screen only the orders blocks nevers crossed

You can choose the color of the bearish and of the bullish order block zone in the settings

NB :
  • Order block older that 5000 bars are deleted
  • This indicator works only in the 1 minute timeframe

הערות שחרור

V1.2
The script work on every time frame and will draw the orders blocks from the same timeframe
The code is more efficient and with comments

הערות שחרור

v1.3 : Add max bar back for the time variable to avoid pinescript run time error

הערות שחרור

Correction : Multiple orders blocks can now be deleted by only one huge price move

הערות שחרור

You can choose to alway show the order block of the 1D (One day) timeframe, even if your chart is in a inferior timeframe.
Correction of a minor bug.

הערות שחרור

Modify max_bars_back for the non premium account

הערות שחרור

V2.0 : You can now force the view of the Order Block from the 1 day and/or 1 hour timeframe if you are in a smaller timeframe
The script draw all the Order Blocks inside the lowest and highest value of the price drawn in the user screen,
and only 1 order block is drawn outside this price range.
The script adapt the number of order blocks to draw if the user change the view.

The way of storing the data is more effective

תגובות
akutsusho
Wow!! great work...
Liquidity_Pro
wow this is great work and very unique! I would like to make some small changes, but the code is a little over my head. Can you show me how I could change the code so that the order blocks don't shrink in size as price action moves into them? I would like to see the original order block, not the smaller one... I see you are French :-) I lived in Lyon for a year where I did my troisieme in a French school many many years ago. Salut!
mentalRock19315
@upsidesignal, try to comment the lines where ' // Adjust the OB ' appears. You will then have a lot of order blocks drwing on your screen and I think it won't be usefull
Liquidity_Pro
@mentalRock19315, thanks, I tried that but not carefully, will try again. I don't want more OBs showing, just want the 1 hr blocks to stay original size...
Liquidity_Pro
@upsidesignal, i see that worked but as you say, now i have too many OBs...
ukmpits
@mentalRock19315 Sir, Is there any future update? Thanks mate
JeyCollini
It looks like bullish order blocks are green and bearish order blocks are red, however sometimes I get a green order block ABOVE my current price, and vice versa. How do I interpret these order blocks that I would expect to be a different color?
Jay1176
Thank you so much for the wonderful indicator, God bless you abundantly
brnoteixeira123
how you know that the order block is valid? Im testing it and i've tried many timeframes but doesnt work or i am not understanding the method. Can you help?
עוד