Birdies [LuxAlgo]The Birdies indicator uses a unique technique to provide support/resistance curves based on a circle connecting the last swing high/low.
A specific, customizable part of this circle acts as a curve of interest, which can trigger visual breakout signals.
🔶 USAGE
The script projects a bird-like pattern when a valid Swing point is found. Multiple customization options are included.
🔹 Trend & Support/Resistance Tool
The color fill patterns and the wing boundaries can give insights into the current trend direction as well as serve as potential support/resistance areas.
In the example above, "Birdies" coincide with pullback and support/resistance zones.
🔹 Swing Length & Buffer
Besides the "Swing Length", with higher values returning longer-term Swing Levels, the script's behavior can be fine-tuned with filters ("Settings" - "Validation").
🔹 Validation
To minimize clutter, three filters are included:
Minimum X-Distance: The minimum amount of bars between subsequent Swings
Minimum Y-Distance: The minimum amount of bars between subsequent Swings
Buffer (Multiple of ATR)
The "Minimum X/Y-Distance" creates a zone where a new Swing is considered invalid. Only when the Swing is out of the zone, can it be considered valid.
In other words, in the example above, a Swing High can only be valid when enough bars/time have passed, and the difference between the last Swing and the previous is more than the ATR multiplied by the "Minimum Y-Distance" factor.
The "Buffer" creates a line above/below the "Birdy", derived from the measured ATR at the conception of the "Birdy" multiplied with a factor ("Buffer").
When the closing price crosses the "Birdy", it must also surpass this buffer line to produce a valid signal, lowering the risk of clutter as a result.
🔶 DETAILS
Birdies are derived from a circle that connects two Swing points. The left-wing curve originates from the most recent "Swing point" to the last value on the circle before crossing its midline. The mirror image of the left wing creates the right wing.
Enabling "Origine" will draw a line from the last Swing to the first.
🔹 Style
The publication includes a style setting with four options.
The first, "Birdy," shows a bird-like shape derived from a circle connecting the last Swing High and Swing Low.
The second option holds everything from the first option but connects both wingtips, providing potential horizontal levels of interest.
When setting "Birdy" to "None", the visual breakout signals will not defer from previous settings, but the focus is shifted towards the fill color, which can help detect potential trend shift.
A fourth setting, "Left Wing", will only show the left part of the "Birdy" pattern, removing the right part from the equation. This will change the visual breakout signals, providing alternative signals.
🔶 SETTINGS
Swing Length: The period used for swing detection, with higher values returning longer-term Swing Levels.
🔹 Validation
Minimum X-Distance: The minimum amount of bars between subsequent Swings
Minimum Y-Distance: The minimum amount of bars between subsequent Swings
Buffer (Multiple of ATR)
🔹 Style
Bullish Patterns: Enable / color
Bearish Patterns: Enable / color
Buffer Zone: Show / Color
Color Fill: Show color fill between two Birdies (if available)
Origine: Show the line between both Swing Points
🔹 Calculation
Calculated Bars: Allows the usage of fewer bars for performance/speed improvement
Shape
D-Shape Breakout Signals [LuxAlgo]The D-Shape Breakout Signals indicator uses a unique and novel technique to provide support/resistance curves, a trailing stop loss line, and visual breakout signals from semi-circular shapes.
🔶 USAGE
D-shape is a new concept where the distance between two Swing points is used to create a semi-circle/arc, where the width is expressed as a user-defined percentage of the radius. The resulting arc can be used as a potential support/resistance as well as a source of breakouts.
Users can adjust this percentage (width of the D-shape) in the settings ( "D-Width" ), which will influence breakouts and the Stop-Loss line.
🔹 Breakouts of D-Shape
The arc of this D-shape is used for detecting breakout signals between the price and the curve. Only one breakout per D-shape can occur.
A breakout is highlighted with a colored dot, signifying its location, with a green dot being used when the top part of the arc is exceeded, and red when the bottom part of the arc is surpassed.
When the price reaches the right side of the arc without breaking the arc top/bottom, a blue-colored dot is highlighted, signaling a "Neutral Breakout".
🔹 Trailing Stop-Loss Line
The script includes a Trailing Stop-Loss line (TSL), which is only updated when a breakout of the D-Shape occurs. The TSL will return the midline of the D-Shape subject to a breakout.
The TSL can be used as a stop-loss or entry-level but can also act as a potential support/resistance level or trend visualization.
🔶 DETAILS
A D-shape will initially be colored green when a Swing Low is followed by a Swing High, and red when a Swing Low is followed by a Swing High.
A breakout of the upper side of the D-shape will always update the color to green or to red when the breakout occurs in the lower part. A Neutral Breakout will result in a blue-colored D-shape. The transparency is lowered in the event of a breakout.
In the event of a D-shape breakout, the shape will be removed when the total number of visible D-Shapes exceeds the user set "Minimum Patterns" setting. Any D-shape whose boundaries have not been exceeded (and therefore still active) will remain visible.
🔹 Trailing Stop-Loss Line
Only when a breakout occurs will the midline of the D-shape closest to the closing price potentially become the new Trailing Stop value.
The script will only consider middle lines below the closing price on an upward breakout or middle lines above the closing price when it concerns a downward breakout.
In an uptrend, with an already available green TSL, the potential new Stop-Loss value must be higher than the previous TSL value; while in a downtrend, the new TSL value must be lower.
The Stop-Loss line won't be updated when a "Neutral Breakout" occurs.
🔶 SETTINGS
Swing Length: Period used for the swing detection, with higher values returning longer-term Swing Levels.
🔹 D-Patterns
Minimum Patterns: Minimum amount of visible D-Shape patterns.
D-Width: Width of the D-Shape as a percentage of the distance between both Swing Points.
Included Swings: Include "Swing High" (followed by a Swing Low), "Swing Low" (followed by a Swing High), or "Both"
Style Historical Patterns: Show the "Arc", "Midline" or "Both" of historical patterns.
🔹 Style
Label Size/Colors
Connecting Swing Level: Shows a line connecting the first Swing Point.
Color Fill: colorfill of Trailing Stop-Loss
FunctionGenerateRandomPointsInShapeLibrary "FunctionGenerateRandomPointsInShape"
Generate random vector points in geometric shape (parallelogram, triangle)
random_parallelogram(vector_a, vector_b) Generate random vector point in a parallelogram shape.
Parameters:
vector_a : float array, vector of (x, y) shape.
vector_b : float array, vector of (x, y) shape.
Returns: float array, vector of (x, y) shape.
random_triangle(vector_a, vector_b) Generate random vector point in a triangle shape.
Parameters:
vector_a : float array, vector of (x, y) shape.
vector_b : float array, vector of (x, y) shape.
Returns: float array, vector of (x, y) shape.
Slope and Concavity : derivative calculations [Fournier-Eaton]This script calculates the "instantaneous" first and second derivatives in a highly flexible and accurate way: namely, via zero-lag price tracking with increasingly narrow sample windows for sequential secant approximation tending towards the tangent. The slope of this tangential is the first derivative, i.e., slope.
Paired with a divergence indicator this can be a powerful tool for trend analysis.
The Script Works As Follows
The slope (first derivative) is represented in line form
Note that crossing through zero, the slope indicates a change in trend direction.
The concavity (second derivative) is represented in histogram form
Positive concavity indicates a shape like an upward bowl, negative is like a downward bowl, and crossing through zero is an inflection point.
Pair this with any indicator that will accept arbitrary input (i.e., from other indicators) select slope or concavity (first or second derivative) to get a lead on trend changes that are often difficult to approximate with the eye during hectic markets.
This is particularly useful as an augmentation for trend shift indicator -- which has been updated.
Periodic EllipsesThe following script periodically plot ellipses to the chart, where the maximum height of the ellipses is determined by the price high of the user-selected time frame while the price low determines the minimum height of the ellipses.
The selected time frame affects the frequency at which the ellipses are plotted, for example, a selected time frame of 1 week will plot an ellipse every week
Note that time frames that are close to the one used in the main chart can return noncircular shapes
Here the main time frame is 15 minutes, while the time frame in the script is 1 hour.
By default the script uses future data, and as such repaint which makes it only useful in offline (non-real time) situations, you can make the script use only past data by deselecting the "repaint" option.
Interpretation And Construction
In terms of usages and interpretation ellipses are similar to bands indicators, as such we can use ellipses in a breakout methodology, where a closing price crossing over the upper bound indicating an uptrend and a closing price crossing under the lower bound indicating a downtrend.
By default, the color of the plots are based on a gradient determined by the position of the closing price relative to the ellipse, with a closing price closer to the upper bound of the ellipse returning a blue color and a closing price closer to the lower bound returning a red color, the intermediate color is violet. When repainting mode is deactivated a blue color indicates an up-trend, while a red color indicates a down-trend, violet colors on the other hand indicate a ranging market.
The ellipses can also determine possible retracements, as such the upper bound of the ellipse can act as a support in an uptrend while the lower bound can act as a resistance in a downtrend.
Construction
Peoples might be interested in the construction of ellipses, this task is not complicated. We can construct circular shapes by using the equation of a semi-circle described as follows:
C = √(1 - x*x)
with 1 ≥ x ≥ -1 , values of x greater than 1 or lower than -1 will return na . In the script, the variable basis creates a line starting at -1 and ending at 1, we then only need to apply the previous equation to this line to have a semi-circle. This semi-circle is in a range of (0,1), so we need to rescale it in a useful range, let's define the highest high of the selected time frame as H and the lowest low as L , the upper and lower bound of the ellipse are calculated as follows:
upper = avg(H,L) + C*(H - avg(H,L))
lower = avg(H,L) - C*(avg(H,L) - L)
Summary
A script plotting ellipses has been proposed, we have seen that the signals that can be generated are similar to the one generated by band indicators, note however that the script has not been made to be a serious indicator, it would be more advisable to use regular band indicators instead.
Thx to @freds_view for the question.
Fractal Breakout V2Version 2 of my fractal pattern aid ( Version 1 ).
I added a bouncing line between the high and low trend lines, connecting consecutive extreme points. I also chased down a pesky bug in the slope calculation...and for now I have disabled the ability to change resolution basis for extreme detection (e.g. 30m on a 1hr chart).
For fun, I added some shading to make it more apparent at a glance what is happening, but if you find it gimmicky, there's an option to turn that off.
I am inexperienced with pattern recognition, so please send feedback if you have any ideas that would make this more useful.
Thanks!
Lemrin
Fractal BreakoutFirst 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
clouded pastSearch indicators for "clouded" to find this one, and add to your chart.
Takes lowest(min) and highest(max) of several bars,
averages that over several bars,
shifts by half of the middle of those two bar numbers,
and colors the inbetween by candle color.
You can choose 3 parameters.
Please give feedback, or donation.
Thanks.