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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?