TradingView
LuxAlgo
3 oct. 2023 13:16

Range Detector [LuxAlgo] 

Bitcoin / United States DollarCoinbase

Description

â‹…
The Range Detector indicator aims to detect and highlight intervals where prices are ranging. The extremities of the ranges are highlighted in real-time, with breakouts being indicated by the color changes of the extremities.

🔶 USAGE



Ranging prices are defined by a period of stationarity, that is where prices move within a specific range.

Detecting ranging markets is a common task performed manually by traders. Price breaking one of the extremities of a range can be indicative of a new trend, with an uptrend if price breaks the upper range extremity, and a downtrend if price breaks the lower range extremity.



Ranges are highlighted as zones and are set retrospectively, that is the starting point of a range is offset in the past. The exact moment a range is detected is highlighted by a gray background color. The average between the maximum/minimum of a zone is also highlighted as a dotted line and is also set retrospectively.

The range extremities are set in real-time, blue extremities indicate the range extremities were not broken, green extremities indicate that price broke the upper range extremity, while red extremities indicate price broke the lower range extremity.



Extremities are extended until a new range is detected, allowing past ranges extremities can be used as future support/resistances.

🔶 DETAILS

The detection algorithm used to detect ranges tests if all the prices within a user-set window are all within two extremities. These extremities are determined by the mean of the detection window plus/minus an ATR value.

When a new range is detected, the script checks if this new range overlaps with a previously detected range, if this is the case, both ranges are merged into one; updating the extremities of the previous range.



This can be observed with the real-time extremities changing within a highlighted zone.

🔶 SETTINGS

  • Minimum Range Length: Minimum amount of bars needed to detect a range.
  • Range Width: Multiplicative factor for the ATR used to detect new ranges. Lower values detect ranges with a lower width. Using higher values might return false positives.
  • ATR Length: ATR length used to determine the range width.
Commentaires
kizona
â‹…
Hi, Is it possible to use any time frame?
anildivyanshu66
â‹…
LuxAlgo
â‹…
@kizona, For sure, you can apply the Range Detector to any timeframe
Tkysl
â‹…
I really dont get how it works
LuxAlgo
â‹…
@Tkysl, You can read through the usage section above for a full explanation, however, in simple terms this indicator aims to estimate ranging market conditions as close to real-time as possible.

The vertical line is where a range has been officially detected, then the range area is colored based on the price breaking upwards or downwards.

Detecting areas where price is ranging instead of trending is a very challenging aspect of technical analysis, whereas most technical indicators are designed specifically to help you catch trends, this indicator aims to do the exact opposite, while also allowing for possible use cases of trading the breakouts of these detected ranges.

Hope this helps!
Ch1pCh0p
â‹…
@LuxAlgo, is it possible to create alert everytime vertical line show up (range detected) ?

Thanks
johnslocks
â‹…
@Tkysl, On its own it is just interesting to watch. Combined with other indicators it can add a layer of confirmation to a trade setup. I am using this along with 2 other indicators and it has increased my win rate dramatically.
Tkysl
â‹…
@johnslocks, whats your confirmation? Can you be clearer, lets say you re gonna take long position or short position what are u lookin for on this
johnslocks
â‹…
@Tkysl, I started testing it last week along with 3MA Cross Trendicator using 13 and 55 for the trigger. I back tested that setup on 2 sets of 20 trades. First set was taking every entry with the cross and coming out of range box in the same direction on 5m TF. I also verify trend on 30m, 4h and daily on a separate monitor. First 20 I got a win rate of 39%. 2nd go round I paid closer attention to the separation I was getting between the 13 and 55 MA which makes a lot of difference. And I also threw on another indicator I got from a mentor that also helps verify good entry points. 2nd bunch was 59% wins. Short answer is, back testing is free. Just keep tweaking it until you get a win percent you're happy with. The 39% is profitable at a 1:2 but 59 is better. I passed a demo challenge in 7 trades since Monday at a 57% win rate. The Range Detector just makes it easier for me to see and enter possible trades.
Trade_in_Real_Life
â‹…
@johnslocks, Is it okay to mention what is the other indicator you used..
Plus