Lemrin

Fractal Breakout

First of all, huge credit to synapticEx, whose brilliant use of the security function inspired me to figure out a way to get quasi-shape boundaries automatically drawn on a chart.

This study draws upper and lower trend lines, based on configurable fractal*** reversal detection, calculates slope from the last two upper or lower reversal points, and then extends a dotted line along the same slope...until the next upper (or lower) reversal occurs. If the high (or low) breaks this extension, the dotted line becomes solid to aid visibility. Reversal detection is configurable to use any number of ticks, but probably four to eight will work best.

I made the inclusion of volume in the reversal logic optional (off by default) and left the existing SMA input found in synapticEx's code intact, albeit with a lower default. With the addition of trend lines, I found volume hindered identification of reversals, although I could try various other filters than the SMA included originally.

I have also left intact the very nice ability to change the period and use the requested period identify reversals, courtesy of synapticEx.

This could be used in a strategy, as the values plotted are actual values that are available to include in logic and do not include knowledge of the future. However, information is not available until the floor of half the number of ticks used in reversal detection (I then offset by that number to line things up visually). Having never heard of it until now, I just Googled the Bill Williams Alligator strategy, which looks interesting, so maybe I could see how this could be ported to that.

***As I typed this, I remembered that while making reversal detection configurable, I changed the detection logic simply to look for highest (or lowest) of the desired length of ticks. I don't know whether this is not strictly fractal anymore, but if desired, with a little work, I could make it require consecutive, consistent changes before and after each reversal again.

Here are a few screenshots from hourly ticks, using the "current" (hourly) period, with and without volume, and playing with the number of points used to identify reversals.

Not using volume

Using volume
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?