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
S-curve
RSI Radar Multi Time FrameHello All!
First of all many Thanks to Tradingview and Pine Team for developing Pine Language all the time! Now we have a new feature and it's called Polylines and I developed RSI Radar Multi Time Frame . This script is an example and experimental work, you can use it as you wish.
The scripts gets RSI values from 6 different time frames, it doesn't matter the time frame you choose is higher/lower or chart time frame. it means that the script can get RSI values from higher or lower time frames than chart time frame.
It's designed to show RSI Radar all the time on the chart even if you zoom in/out or scroll left/right.
You can set OB/OS or RSI line colors. Also RSI polyline is shown as Curved/Hexagon optionally.
Some screenshots here:
Doesn't matter if you zoom out, it can show RSI radar in the visible area:
Another example:
You can change the colors, or see the RSI as Hexagon:
Time frames from seconds to 1Day in this example while chart time frame is any ( 30mins here )
Enjoy!
Normal Distribution CurveThis Normal Distribution Curve is designed to overlay a simple normal distribution curve on top of any TradingView indicator. This curve represents a probability distribution for a given dataset and can be used to gain insights into the likelihood of various data levels occurring within a specified range, providing traders and investors with a clear visualization of the distribution of values within a specific dataset. With the only inputs being the variable source and plot colour, I think this is by far the simplest and most intuitive iteration of any statistical analysis based indicator I've seen here!
Traders can quickly assess how data clusters around the mean in a bell curve and easily see the percentile frequency of the data; or perhaps with both and upper and lower peaks identify likely periods of upcoming volatility or mean reversion. Facilitating the identification of outliers was my main purpose when creating this tool, I believed fixed values for upper/lower bounds within most indicators are too static and do not dynamically fit the vastly different movements of all assets and timeframes - and being able to easily understand the spread of information simplifies the process of identifying key regions to take action.
The curve's tails, representing the extreme percentiles, can help identify outliers and potential areas of price reversal or trend acceleration. For example using the RSI which typically has static levels of 70 and 30, which will be breached considerably more on a less liquid or more volatile asset and therefore reduce the actionable effectiveness of the indicator, likewise for an asset with little to no directional volatility failing to ever reach this overbought/oversold areas. It makes considerably more sense to look for the top/bottom 5% or 10% levels of outlying data which are automatically calculated with this indicator, and may be a noticeable distance from the 70 and 30 values, as regions to be observing for your investing.
This normal distribution curve employs percentile linear interpolation to calculate the distribution. This interpolation technique considers the nearest data points and calculates the price values between them. This process ensures a smooth curve that accurately represents the probability distribution, even for percentiles not directly present in the original dataset; and applicable to any asset regardless of timeframe. The lookback period is set to a value of 5000 which should ensure ample data is taken into calculation and consideration without surpassing any TradingView constraints and limitations, for datasets smaller than this the indicator will adjust the length to just include all data. The labels providing the percentile and average levels can also be removed in the style tab if preferred.
Additionally, as an unplanned benefit is its applicability to the underlying price data as well as any derived indicators. Turning it into something comparable to a volume profile indicator but based on the time an assets price was within a specific range as opposed to the volume. This can therefore be used as a tool for identifying potential support and resistance zones, as well as areas that mark market inefficiencies as price rapidly accelerated through. This may then give a cleaner outlook as it eliminates the potential drawbacks of volume based profiles that maybe don't collate all exchange data or are misrepresented due to large unforeseen increases/decreases underlying capital inflows/outflows.
Thanks to @ALifeToMake, @Bjorgum, vgladkov on stackoverflow (and possibly some chatGPT!) for all the assistance in bringing this indicator to life. I really hope every user can find some use from this and help bring a unique and data driven perspective to their decision making. And make sure to please share any original implementaions of this tool too! If you've managed to apply this to the average price change once you've entered your position to better manage your trade management, or maybe overlaying on an implied volatility indicator to identify potential options arbitrage opportunities; let me know! And of course if anyone has any issues, questions, queries or requests please feel free to reach out! Thanks and enjoy.
Branch CurveLibrary "branch"
Generates a branch made of segments with a starting angle
and a turning angle for each segment. The branch is generated from a starting point
and a number of nodes to generate. The length of each segment and angle of each segment
can be adjusted. The branch can be generated in 2D or 3D, render as you wish.
method branch(origin, nodes, segment_length, segment_growth, angle_start, angle_turn)
# Branch Generation.
- `origin`: CommonTypesMath.Vector3 - The starting point of the branch. If the z value is not zero, it will be used as the starting angle.
- `nodes`: int - The number of nodes to generate.
- `segment_length`: float - The length of each segment.
- `segment_growth`: float - The growth of each segment. 0 = no growth, 100 = double the length of the previous segment.
- `angle_start`: float - The starting angle of the branch in degrees.
- `angle_turn`: float - The turning angle of each segment in degrees.
Namespace types: CommonTypesMath.Vector3
Parameters:
origin (Vector3 type from RicardoSantos/CommonTypesMath/1) : The starting point of the branch. If the z value is not zero, it will be used as the starting angle.
nodes (int) : The number of nodes to generate.
segment_length (float) : The length of each segment.
segment_growth (float) : The growth of each segment. 0 = no growth, 100 = double the length of the previous segment.
angle_start (float) : The starting angle of the branch in degrees.
angle_turn (float) : The turning angle of each segment in degrees.
@return segments The list of segments that make up the branch.
Historical Federal Fund Futures CurveUse this indicator to plot the federal funds futures implied rates term structure against historical curves
Based upon the work of @BarefootJoey, @longfiat, @OpptionsOnly
TurntLibraryLibrary "TurntLibrary"
Collection of functions created for simplification/easy referencing. Includes variations of moving averages, length value oscillators, and a few other simple functions based upon HH/LL values.
ma(source, length, type)
Apply a moving average to a float value
Parameters:
source : Value to be used
length : Number of bars to include in calculation
type : Moving average type to use ("SMA","EMA","RMA","WMA","VWAP","SWMA","LRC")
Returns: Smoothed value of initial float value
curve(src, len, lb1, lb2)
Exaggerates curves of a float value designed for use as an exit signal.
Parameters:
src : Initial value to curve
len : Number of bars to include in calculation
lb1 : (Default = 1) First lookback length
lb2 : (Default = 2) Second lookback length
Returns: Curved Average
fragma(src, len, space, str)
Average of a moving average and the previous value of the moving average
Parameters:
src : Initial float value to use
len : Number of bars to include in calculation
space : Lookback integer for second half of average
str : Moving average type to use ("SMA","EMA","RMA","WMA","VWAP","SWMA","LRC")
Returns: Fragmented Average
maxmin(x, y)
Difference of 2 float values, subtracting the lowest from the highest
Parameters:
x : Value 1
y : Value 2
Returns: The +Difference between 2 float values
oscLen(val, type)
Variable Length using a oscillator value and a corresponding slope shape ("Incline",Decline","Peak","Trough")
Parameters:
val : Oscillator Value to use
type : Slope of length curve ("Incline",Decline","Peak","Trough")
Returns: Variable Length Integer
hlAverage(val, smooth, max, min, type, include)
Average of HH,LL with variable lengths based on the slope shape ("Incline","Decline","Trough") value relative to highest and lowest
Parameters:
val : Source Value to use
smooth
max
min
type
include : Add "val" to the averaging process, instead of more weight to highest or lowest value
Returns: Variable Length Average of Highest Lowest "val"
pct(val)
Convert a positive float / price to a percentage of it's highest value on record
Parameters:
val : Value To convert to a percentage of it's highest value ever
Returns: Percentage
hlrange(x, len)
Difference between Highest High and Lowest Low of float value
Parameters:
x : Value to use in calculation
len : Number of bars to include in calculation
Returns: Difference
midpoint(x, len, smooth)
The average value of the float's Highest High and Lowest Low in a number of bars
Parameters:
x : Value to use in calculation
len
smooth : (Default=na) Optional smoothing type to use ("SMA","EMA","RMA","WMA","VWAP","SWMA","LRC")
Returns: Midpoint
Oscillating Length Moving Averages***CREDIT TO TradingView's TA Library*** (), Attempted to use "import TradingView/ta/4" to import the library, but for whatever reason
some of the functions failed to work, while others had no issue, so I opted to just copy paste what I wanted to use.
This moving average uses an oscillator to influence the length used during calculation. Extremely customizable/tunable with ability to change Max and Min length values, length multiplier, length multiple,4 different settings ,( Decline , <>Peak, >Decline , <>Peak, ><Trough
step6:Select Final Filtering method
step7:plot
Yield Curve (1-10yr)Yield curve of the 1-10 year US Treasury Bonds, with over 60 years of history.
The Yield Curve is the interest rate on the 10 year bond minus the 1 year bond.
When it inverts (crosses under 0) a recession usually follows 6-12 months later.
It's a great leading indicator to identify risk in the macroeconomic environment.
Yield curves can be constructed on varying durations. Using a 1-year as the short-term bond provides a slightly faster response than the 2-year bond; and the 1-year has more historical data on TradingView.
Yield Curve (2-10yr)Yield curve of the 2-10 year US Treasury Bonds, with over 50 years of history.
The Yield Curve is the interest rate on the 10 year bond minus the 2 year bond.
When it inverts (crosses under 0) a recession usually follows 6-12 months later.
It's a great leading indicator to identify risk in the macroeconomic environment.
Converging Pullbacks and PeaksMulti Timeframe Converging Lines Indicator. Using the highest/lowest Values at 2 different lengths. Convergence created by taking the highest/lowest value and subtracting/adding the # of barssince the highest/lowest bar was set multiplied by the price multiplied by the float. Curves are created from averaging out the emas of the center lines of the extremeties.
Helps show trendlines automatically most of the time but can be tweaked by changing the floats or Fast/Slow lengths to you liking.
Multi Yield CurveAn inversion between the 2 year and 10 year US treasury yield generally means a recession within 2 years. But the yield curve has more to it than that. This script helps analysis of the current and past yield curve (not limited to US treasury) and is very configurable.
"A yield curve is a line that plots yields (interest rates) of bonds having equal credit quality but differing maturity dates. The slope of the yield curve gives an idea of future interest rate changes and economic activity." (Investopedia)
When the slope is upward (longer maturity bonds have a higher interest rate than shorter maturity bonds), it generally means the economy is doing well and is expanding. When the slope is downward it generally means that there is more downside risk in the future.
The more inverted the curve is, and the more the inversion moves to the front, the more market participants are hedging against downside risk in the future.
The script draws up to 4 moments of a yield curve, which makes it easy to compare the current yield curve with past yield curves. It also draws lines in red when that part of the curve is inverted.
The script draws the lines with proper length between maturity (which most scripts do not) in order to make it more representative of the real maturity duration. The width cannot be scaled because TradingView does not allow drawing based on pixels.
This script is the only free script at time of writing with proper lengths, showing multiple yield curves, and being able to show yield curves other than the US treasury.
█ CONFIGURATION
(The following can be configured by clicking "Settings" when the script is added to a chart)
By default the script is configured to show the US treasury (government bond) yields of all maturities, but it can be configured for any yield curve.
A ticker represents yield data for a specific maturity of a bond.
To configure different tickers, go to the "TICKERS" section. Tickers in this section must be ordered from low maturity to high maturity.
• Enable: draw the ticker on the chart.
• Ticker: ticker symbol on TradingView to fetch data for.
• Months: amount of months of bond maturity the ticker represents.
To configure general settings, go to the "GENERAL" section.
• Period: used for calculating how far back to look for data for past yield curve lines. See "Times back" further in this description for more info.
• Min spacing: minimum amount of spacing between labels. Depending on the size of the screen, value labels can overlap. This setting sets how much empty space there must be between labels.
• Value format: how the value at that part of the line should be written on the label. For example, 0.000 means the value will have 3 digits precision.
To configure line settings per yield curve, each has its own "LINE" section with the line number after it.
• Enable: whether to enable drawing of this line.
• Times back: how many times period to go back in time. When period is D, and times value is 2, the line will be of data from 2 days ago.
• Color: color of the line when not inverted.
• Style: style of the line. Possible values: sol, dsh, dot
• Inversion color: color of the line when the curve inverses between the two maturities at that part of the curve.
• Thickness: thickness of the line in pixels.
• Labels: whether to draw value labels above the line. By default, this is only enabled for the first line.
• Label text color: text color of value label.
• Label background color: background color of value label.
To configure the durations axis at the bottom of the chart, go to the "DURATIONS" section.
• Durations: whether to show maturity term duration labels below the chart.
• Offset: amount to offset durations label to be below chart.
█ MISC
Script originally inspired by the US Treasury Yield Curve script by @longfiat but has been completely rewritten and changed.
Cubic Bézier Curve Extrapolation [LuxAlgo]The following script allows for the extrapolation of a Cubic Bézier Curve fit using custom set control points and can be used as a drawing tool allowing users to estimate underlying price trends or to forecast future price trends.
Settings
Extrapolation Length: Number of extrapolated observations.
Source: Source input of the script.
Style
Width: Bézier curve line width.
Colors: The curve is colored based on the direction it's taking, the first color is used when the curve is rising, and the second when it is declining.
The other settings determine the locations of the control points. The user does not need to change them from the settings, instead only requiring adjusting their location on the chart like with a regular drawing tool. Setting these control points is required when adding the indicator to your chart.
Usage
Bézier curves are widely used in a lot of scientific and artistic fields. Using them for technical analysis can be interesting due to their extrapolation capabilities as well as their ease of calculation.
A cubic Bézier curve is based on four control points. Maxima/Minimas can be used as control points or the user can set them such that part of the extrapolated observation better fits the most recent price observations.
A possible disadvantage of Bézier curves is that obtaining a good fit with the data is not their primary goal. Rational Bézier curves can be used if obtaining a good fit is the primary user goal.
Details
At their core, Bézier curves are obtained from nested linear interpolation between each control point and the resulting linearly interpolated results. The Bézier curve point located at the first control point P0 and the last curve point located at the last control point Pn are equal to their respective control points. However, this script does not make use of this approach, instead using a more explicit form.
As mentioned previously, the complexity of a Bézier curve can be determined by its number of control points which is related to the Bézier curve degree (number of control points - 1). Instead of using nested linear interpolations to describe Bézier curves, one can describe them as a polynomial of a degree equal to the degree of the wanted Bézier curve.
Coppock Curve StrategyThis strategy makes use of a not widely known technical indicator called "Coppock Curve".
The indicator is derived by taking a weighted moving average of the rate-of-change (ROC) of a market index such as the S&P 500 or a trading equivalent such as the S&P 500 SPDR ETF. For more info: (www.investopedia.com)
This strategy uses $SPY Coppock curve as a proxy to generate buy signals on other ETF's and stocks.
Buy signals are generated when the Coppock Curve crosses above zero, and sell signals are generated when it crosses below.
An optional, trailing stop loss is available, with default settings to 100% so that it does not currently affect the buy and sell signals solely generated by the Coppock Curve. But you may find adding a Trailing stop loss may improve results on certain ETF's/Stocks.
You may also change the symbol for which signals are generated for, default is $SPY.
The published example shows using this strategy on a leverage ETF $TQQQ w/ starting capital of 10k, w/ 10k per trade. Try it on other stocks such as $AAPL, $AMZN $NFLX ect... I have found it to be an effective strategy that has a favorable risk to reward profile.
Any questions, please let me know!
SBER Coppock Curve with 14EMA (Prefer with 1 HR)Modified coppock curve along with 14EMA can be used by non-aggressive traders as per detailed rules explained in video on "Trading made easy with secret coppock curve"
Bitcoin Logarithmic Growth CurvesThis plots logarithmic curves fitted to major Bitcoin bear market tops & bottoms. Top line is fitted to bull tops, bottom line is fitted to lower areas of the logarithmic price trend (which is not always the same as bear market bottoms). Middle line is the median of the top & bottom, and the faded solid lines are fibonacci levels in between.
Inspired by & based on a Medium post by Harold Christopher Burger, which shows how linear Bitcoin's long-term price growth is when plotted on a double-log chart (log scaling on the price AND time axis).
These curves will only make sense for tickers representing Bitcoin vs. USD (such as BITSTAMP:BTCUSD, BITMEX:XBTUSD, BLX index). Plotting on other assets will probably end up with lines that shoot off into space without any relationship to the underlying price action.
The upper, middle & lower curves can be projected into the future, which can be turned on or off in the indicator settings. The fibonacci levels can also be switched on/off. And the upper & lower curve intercepts & slopes can be tweaked.
I'm releasing this open-source, if you end up making something cool based off of this code, I don't need attribution but please hit me up on here or on twitter (same username) so I can check out what ya made. Thanks, hope y'all enjoy it.
Price-Curve ChannelIntroduction
Although many will use lines in order to make support and resistances, others might use curves, this is logical since trends are not always linear. Therefore it was also important to take this into consideration, and when i published the price-line channel indicator, i already started a curved version of it. Therefore i propose this new indicator based on the recursive bands framework that allow to return curved support and resistances. The benefits of this indicator are : a totally stable approach, user friendly, and extremities able to converge faster toward the price.
The Indicator
The indicator is way faster than the price-line channel one, this is due to the fast convergence toward the price of the extremities. Length control the reactivity of the indicator, while mult is more related to the rate of convergence, values of mult lower than 1 will make the curve converge slower,
mult = .5
Higher values of mult will make the extremities converge faster toward the price.
mult = 2
Unlike the price-line channel indicator this one is directly "readjusted", this is due to the fact that the extremities are no longer linear, of course a "perfectly" curved version could come in an update, but for the moment it wasn't really a necessity.
Comparison With Price-Line
The fact that the extremities converge faster toward the price allow to possibly capture more tops/bottoms/retracements. However the extremities of both indicator have the same behavior regarding their accuracy, for example the upper extremity have a higher chance to detect a retracement when on a downtrend, while the lower extremity have higher chance to detect a retracement while on a up-trend.
On The Indicator Construction
The recursive bands framework is the core of the indicator, it is important to use it. The curved effect is given by multiplying the correction factor by the barssince function, therefore the correction factor is no longer constant which in return allow for a non linear output.
The size is divided by the square of length in order to keep a certain logic between the output and the length period.
Conclusion
The recursive bands framework prove again to be quite interesting, lot of indicators can be made using it, i only posted a fraction of what can be done with it, which make the recursive bands indicator one of the best indicators i ever made in my opinion.
The proposed indicator is stable, and don't require nightmarish manipulations (unlike the linear channels indicator), its ability to detect possible support and resistances points, although subjective, remain a feature of the indicator. The use of recursion make the indicator efficient. I hope the indicator find some use in the community.
Thanks for reading !
Linear version.
Note
Respect the house rules, always request permission before publishing open source code. This is an original work, requesting permission is the least you can do.
I apologize for any grammatical/orthographic error in this post.
Straightened Price CurveThis is another among zillions of attempts at a moving average of a security. More precisely, two attempts at one go). The zzoid function generates a zigzag-like MA that can adopt different forms. The stepline function creates, sure enough, a stepline.
Coppock CurveThis indicator was originally developed by Edwin "Sedge" Coppock (Barron's Magazine, October 1962).
Specially for @AlexMayorov :
1) Buy when indicator crosses the zero line upside
2) Sell when indicator crosses the zero line downside
Inverted Yield Curve with VIX Fear IndexUS 2 year and US 10 year comparison, inverted yield curve with VIX. I use this on a weekly chart with 2 moving averages, the 40 week (ma200 daily) and the 520 week (10 year median).
The bottom histogram is the VIX and the plot is the yield curve. When the VIX is above a certain level (you can set it in settings) and the ýield curve is close to or at inversion the background goes red.
The last seven recessions were preceded by an inverted yield curve. Here I combined the two main fear indexes, the VIX and the run for safe US treasuries (Inverted Yield Curve).
This is preset to the 2 year and 10 year US bond, weekly, and the normal VIX ticker but you can set it to whatever you like.
Published with source code for anyone to modify. Please comment below if you do so! This is the second in a series of indicators I intend to publish as a package of economic recoverty/recession symptom indicators.
Follow me for updates, next one up is commodities with dr Copper and oil!
UCSgears_Linear Regression CurveThe Linear Regression Slope is based on the Curve.
List of All my Indicators - www.tradingview.com