PINE LIBRARY

Order Block Refiner [TradingFinder]

已更新
🔵Introduction

The "Refinement" feature allows you to adjust the width of the order block according to your strategy. There are two modes, "Aggressive" and "Defensive," in the "Order Block Refine". The difference between "Aggressive" and "Defensive" lies in the width of the order block.

For risk-averse traders, the "Defensive" mode is suitable as it provides a lower loss limit and a greater reward-to-risk ratio. For risk-taking traders, the "Aggressive" mode is more appropriate. These traders prefer to enter trades at higher prices, and this mode, which has a wider order block width, is more suitable for this group of individuals.


Important:
One of the advantages of using this library is increased code accuracy. Not only does it have the capability to create order blocks, but you can also simply define the condition for order block creation (true/false) and "bar_index," and you'll find the primary range without applying any filters.


🟣Order Block Refinement Algorithm

The order block ranges are filtered in two stages. In the first stage, the "Open," "High," "Low," and "Close" of the current order block candle, its two or three previous candles, and one subsequent candle (if available) are examined. In this stage, minimum and maximum distances are calculated, and logical range filters are applied.

In the second stage, two modes, "Aggressive" and "Defensive," are calculated.

For the "Defensive" mode, the width of these ranges is compared with the "ATR" (Average True Range) of period 55, and if they are smaller than "ATR" or 1 to more than 4 times "ATR," the width of the range is reduced from 0 to 80 percent.

For the "Aggressive" mode, you get the same output as the first filter, which usually has a wider width than the "Defensive" mode.


Order Block Refiner: Off

快照

Order Block Refiner: On / "Aggressive Mode"

快照

Order Block Refiner: On / "Defensive Mode"

快照



🔵How to Use




To add "Order Block Refiner Library", you must first add the following code to your script.




OBType: This parameter receives 2 inputs. If the order block you want to "Refine" is of type demand, you should enter "Demand," and if it's of type supply, you should enter "Supply."

OBRefine: Set to "On" if you want the "Refine" operation to be performed. Otherwise, set to "Off."

RefineMethod: This input receives 2 modes, "Aggressive" and "Defensive." You can switch between these modes according to your needs.

TriggerCondition: Enter the condition with which the order block is formed in this parameter.

Index: Enter the "bar_index" of the candle where the order block is formed in this parameter.


🟣Function Outputs

This function has 6 outputs: "bar_index" at the beginning of the "Distal" line, "bar_index+1" at the end of the "Distal" line, "Price" at the "Distal" line, "bar_index" at the beginning of the "Proximal" line, "bar_index+1" at the end of the "Proximal" line, and "Price" at the "Proximal" line, which can be used to draw order blocks.

Sample:


發布通知
v2
🔵Fixed Error

Due to the limitation on the number of available candles, which is no more than 5000, errors occasionally occurred. This issue has been resolved with a minor modification.
displaystatisticstechindicator

Pine腳本庫

在真正的TradingView精神中,作者將這段Pine程式碼發佈為開源程式庫,以便我們社群的其他Pine程式設計師可以重複使用它。請向作者致敬!您可以私下使用這個函式庫,或在其他開源出版品中使用,但在出版物中再次使用這段程式碼將受到網站規則的約束。


Get Access to TradingFinder indicators and Education for FREE: tradingFinder.com/

Forex, Crypto, Stocks, Futures & Index informational materials and Trading Tools in Turkish language: tradingFinder.com/tr/
更多:

免責聲明