Tillson IE/2 [CC]The IE/2 was created by Tim Tillson (Stocks and Commodities Jan 1998) and this is a practically undiscovered gem because in that same article he goes on to to create the popular T3 moving average and the GDEma but practically no one seemed to notice the IE2 or maybe it is just my imagination. Anyway this indicator name is short for Integral of Linear Regression Slope + Endpoint Moving Average / 2 so you can why it was shortened to IE/2. Like the name implies this takes two variations of smoothing that complement each other and averages them together to in theory get the benefits of each. The EPMA is much noiser but follows the data more closely and the complete opposite for the ILRS so you can see the idea in action. Like all of my indicators I include strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Regressão Linear
Soldi OscillatorThe Soldi Oscillator measures the mean of logarithmic returns, given this data you can assume market expectancy in returns of the mean. When seeing positive Means you can assume positive returns will follow positive returns if positive autocorrelation is present. Vice versa for the other event of negative returns.
How you can effectively use this indicator and oscillator is by looking at a higher time frame and if the oscillator is positive, you can go to a lower timeframe and try to trade in that direction of the market as the expected returns are positive in nature.
You can also spot trend divergences very well as the trend continues but the returns are dropping that means the returns are mean reverting and can have a potential to flip to the other side
Linear Regression Relative Strength[image/x/iZvwDWEY/
Relative Strength indicator comparing the current symbol to SPY (or any other benchmark). It may help to pick the right assets to complement the portfolio build around core ETFs such as SPY.
The general idea is to show if the current symbol outperforms or underperforms the benchmark (SPY by default) when bought some certain time ago. Relative performance is displayed as percent and is calculated for three different time ranges - short (1 mo by default), mid (1 quarter), and long (half a year). To smooth the volatility, the script uses linear regression to estimate the trend and takes the start and the end points of the linear regression line to compute the relative strength.
It is important to remember that the script shows the gain relative to SPY (or other selected benchmark), not the asset's gain. Therefore, it may indicate that the asset is profitable, but it still may lose value if SPY is in downtrend.
Therefore, it is crucial to check other indicators before making a decision. In the example above, standard linear regression for one quarter is used to indicate the direction of the trend.
Trends_2022Hello everyone,
we are developing a strategy which is suited for people that likes to trade in small time frames.
Our strategy uses many indications for entries. These indicators can be used individually or better solution we combined them together for best prediction.
These indications like True Range, Average True Range , moving averages also previous bars highs, lows and closes values and finally mathematical equations to decide close price wave movement. Most of the work is in scaling price data and comparing them with the indicators to decide trend
The strategy is planned to go only long direction..
now we will discuss how each indicator is used to decide trend
* According to ATR trend prediction ...
it is up when the scaled bar price greater than ATR value
it turns down when the scaled bar price is less than ATR value
* According to MAs trend prediction ...
we use SMA and previous bar data averages then apply linReg ( Linear regression curve) this result in curve up and down zero
it is up when the value is up zero
it turns down when the value is down zero
* According to close price wave movement ...
we applied cos function on previous bars close data to get the sloping wave of close movement
If the slope is increasing ... this means the current wave value is greater than the previous value
If the slope is decreasing ... this means the current wave value is less than the previous value
Now as we mentioned before... The strategy goes only long direction.
LONG ENTRY Conditions (ANDing condition not ORing):
we can use any one of these indicators individually, or mix any two of them or use them all simultaneously
So... LONG ENTRY Conditions are as below:
if ATR trend is used .. it should be UP.
if MAs trend used .. it should be > 0.
if close wave slope is used .. it should be increasing.
On the other side… the Exit conditions are also (ANDing condition not ORing):
So... LONG Exit Conditions are as below:
if ATR trend is used .. it should be down.
if MAs trend used .. it should be < 0.
if close wave slope is used .. it should be decreasing.
Please send me private message for script authorization.
Happy trading everyone!
Fusion: Trend and thresholdsThis is your basic single moving average but with a "slope" component. The idea here is that once a slope reaches a value great enough you should probably only trade with the trend so this indicator allows you to set that threshold separately for going long and short.
The indicator is designed to display on both the main chart and a separate chart area. If you want to display it on the main chart then the quick way is to just check the "On main chart" option and it will disable off main chart items and then just move it to the main chart.
There's half a dozen or so moving average types to select from so you will probably find one that suits you pretty well.
Once a threshold is reached you will get a signal showing the trend is strong enough where you probably should not trade in the opposite direction.
There is a "normalize" option which will fix the oscillator to a maximum of 100. The upside of this is that you can be more consistent in your settings of a threshold. The down side is that normalization happens over a predefined number of bars so it's a floating number, not an absolute number however I set the number of bars default to 3,000 so it should be pretty close to ideal. I haven't found a perfect way of getting a consistent maximum on the oscillator as a benchmark yet so if anyone has any ideas please contact me and I'll do an update. I may look into using percentage rank instead of normalization.
I like to see it as both an oscillator and on the main chart so I generally have two copies.
The settings are certainly not optimized so set to whatever suits your needs as my defaults will probably be wrong for you.
The code is structured to easily drop into a bigger system so use it as a lone indicator or add the code to some bigger project you are creating. If you do, send me a note, it would be nice to know it's being well used.
Finally, if you find value please do make a comment, give a thumbs up etc.
Enjoy and good luck!
Projection Bands [CC]The Projection Bands were created by Mel Widner (Stocks and Commodities Jul 1995) and this indicator and the other two that rely on this one (I will publish them later) are very underappreciated in my humble opinion. The biggest strength of this indicator is the fact that it is a leading indicator for dramatic price movements. As you can see in my example chart it consistently gives great exit points before a downturn. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators or scripts you would like to see me publish!
Linear Regression 200/100/50/20Four time frames in one indicator in different colors, showing current price trend in different scopes.
If the slope of the smaller time frame is in a (0,75;1,25) interval of some of the bigger ones the smaller one is omitted (different signs near zero are not coalesced in that way though).
Every time frame has four deltas of range in trend lines of different grade of transparency (2-1-4-3), as well as a vertical line denoting regression date range start, also bearing the same color (blue-red-green-gray for 200/100/50/20).
On the right of the latest bar are Pearson coefficients and slopes of the regressions, 200/100/50/20 bottom-up, also appropriately colored.
Pairs Trading (basic OLS regression)Pairs trading using hedge ratio.
Firstly, it calculates hedge ration using OLS linear regression.
Then it calculates spread and z-score of spread.
if spread in specific range (which it's possible to change in settings) it makes Long/Short orders.
The very basic script.
Logarithmic Trend ChannelThis indicator automatically draws a regression channel plotted on logarithmic scale from the first quotation.
This model is useful for the long term series data (such as 10 or 20 years time span).
The Pearson correlation measures the strength of the linear relationship between two variables. It has a value between to 1, with a value of 0 meaning no correlation, and + 1 meaning a total positive correlation.
Logarithmic price scales are a type of scale used on a chart, plotted such that two equivalent price changes are represented by the same vertical changes on the scale.
They differ from linear price scales because they display percentage points and not dollar price increases for a stock.
Technical issues
*The user have to pan over the chart from the beginning to the end of the study range (such as 10 years of bars) so the pine script could generate those lines on the chart.
*If on the chart the number of bar is less than the lookback period, it won't generate any lines as well.
[YUTAS] Linear Regression Trend Channel
・Indicator for linear regression channel.
・Multiple deviations can be displayed.
・The color changes by reading the angle of the center line according to the direction of the market.
Rising market → blue
Down market → Red
----------------------------------------------
・線形回帰チャネルのインジケーター。
・偏差を複数表示可能。
・相場の向きに合わせてセンターラインの角度を読み取り色が変わります。
上げ相場 → 青
下げ相場 → 赤
Buy and Sell with Master_in_chart-ind. [V1]This script indicates the Buy and Sell positions on your chart. In addition, it shows entry price , stop loss and possible targets on the chart. The same information are shown in a table where you can find the position type (long/short) in green and red color, entry point, stop-loss (always in red) and targets.
The targets are defined by Risk to Reward ratios 1:1, 1:1.5 and 1:2.
the labels appears when the all conditions are satisfied.
Interesting part of the script is the alert function. Here one can set the script for different
securities and activate alert in TV.
In summary, one can change and tune the setting of the indicator easily by clicking on the gear icon. In the setting, there are four sections. First section sets the slop-loss. Second section activates and shows the super trend indicator. Third section is designed to tune the signals. Finally, you can apply the script on five different symbols at different time-frames. Here you can set alarm to alert you the signals.
I hope you enjoy it!
Profit Maxima: a crypto strategyThis strategy is designed for those who are looking for long-term positions with low risk and high profitability.
How does it work?
In short, the basis of this strategy is the frequent modeling of the price using regression equations and the estimation of the range of price movements.
The price modeling process starts from the first bars and will be repeated on each bar. This process is performed in each candle based on the data available up to that candle, and data for subsequent bars is not used.
There is also no fixed price model, but it will change from one candle to the next; Therefore, the more candles there are, the larger the statistical population and therefore the quality of the price model increases.
I have also used the concept of scarcity. Bitcoin is the first scarce digital object in the world. Once something becomes scarce enough, it can be used as money. This scarcity gradually increases and affects the price. The entire crypto market also follows Bitcoin.
However, always remember that past results in no way guarantee future performance.
Why this strategy generates a small number of trades?
Preston Pysh believed Bitcoin cycles happen in three phases: the Bull Run, the Correction, and the Reversion to the Mean. He estimates there are about 200,000 blocks per cycle and there are about 144 blocks per day.
Therefore, each cycle of Bitcoin lasts about four years. The entire crypto market follows bitcoin. On the other hand, cryptocurrency is a new phenomenon. They have a limited price history.
This strategy is designed to open a long position at the lowest possible price. In addition, due to the concept of scarcity and its continued impact on prices, trading in the “short” direction is avoided.
The combination of these factors leads to generate a small number of trades. However, you can test it on several different charts to make sure it works properly.
Default settings
{ default_qty_type } = strategy.percent_of_equity
{ default_qty_value } = 3.3
{ commission_value } = 0.1
{ pyramiding } = 3
{ close_entries_rule } = "ANY"
In a simple word, buy (Entry) and sell (take-profit) orders are each done at three different levels. At each level, 3.3% of equity is used (9.9% in total)
0.1% commission is considered for each transaction.
“close_entries_rule” determines the order in which orders are closed. The default is FIFO (first in, first out), but in this strategy, orders are executed in “first in, last out” order. In this way, the lowest buy (Entry) order corresponds to the lowest sell (take profit) order.
Choose the best chart
Charts have a significant impact on the performance of the strategy. As mentioned, the more historical bars there are, the larger the statistical population and therefore the quality of the price model increases.
You can use the Chart Quality panel to choose the appropriate chart:
The ‘Historical Bars’ field shows the number of candles in the chart. Choose the chart of an exchange that has the most historical bars.
The ‘Recommended Chart’ field shows the suggested chart for some symbols.
The “Predictability” field indicates to what extent price movements can be predicted using the model; the higher the “predictability”, the more credible the results of the strategy. "Predictability" indicates that the results of the strategy are reliable or not.
The image below shows the recommended chart for 20 different symbols:
How to use
You don't need automated trading platforms to use it. It can be used by placing simple buy and sell (take-profit) orders manually.
The green and red lines indicate the 'Entry' and 'Profit' levels respectively. If there is no order (buy / sell) active on one of these levels, it will be displayed in gray. The corresponding values are displayed in the Entry & Profit Limits table.
After choosing the appropriate chart, you can use this table to place your orders manually.
Note that trading in the "short" direction is not recommended at all.
Samples
NEXT Regressive VWAPOverview:
This version of the Volume-Weighted Average Price (VWAP) indicator features an extended algorithm, which, in addition to volume and price, also incorporates regression analysis. The result is a more responsive, often leading VWAP slope with a degree of statistical predictability built in. Just like with the original VWAP, NEXT Regressive VWAP offers two optional Standard Deviation bands that parallel it. These can be set to any deviation level, with the default being 1 and -1, indicating one standard deviation above and one below Regressive VWAP, respectively.
Below is a screenshot comparing NEXT Regressive VWAP (green) to the original VWAP (blue) on CME_MINI:ES1! M3 chart.
Application and Strategy Ideas:
Price above NEXT Regressive VWAP is interpreted to have a bullish bias, and below, bearish. You can use TradingView's native Set Alert functionality to be notified, in real-time, when price crosses Regressive VWAP, and/or any of its standard deviation bands. Another popular "probability play" strategy is to scalp price when it crosses under the upper band (short) and crosses over the lower band (long). The screenshot below visualizes such a strategy on NASDAQ:QQQ M1 chart:
Input Parameters:
There are 3 groups of input.
Regression Settings
Length - controls the length of time (in bars) for regression analysis with higher values yielding smoother, more responsive values.
Regression Weighting - controls the degree of regression analysis incorporated into VWAP, with 5 being average, 0-4 less, 6-10 more. The higher the value, the more responsive the Regressive VWAP curve.
VWAP Settings
Anchor Period - controls the origin of VWAP calculations, start of session being the default.
Source - data used for calculating the VWAP, typically HLC/3, but can be used with other price formats and data sources as well.
Offset - shifting of the VWAP line forward (+) or backward (-).
Standard Deviation Bands Settings
Calculate Bands - checking this will add 2 bands, each equidistant (by the amount of Multiplier) from the NEXT Regressive VWAP line.
Bands Multiplier - standard deviation multiplier, with 1 being the default
Signals and Alerts:
Here is how to set price (close) crossing NEXT Regressive VWAP alerts: open a chart, attach NEXT Regressive VWAP, and right-click on chart -> Add Alert. Condition: Symbol e.g. ES (close) >> Crossing >> Regressive VWAP >> VWAP >> Once Per Bar Close.
Linear Regression Histogram [LuxAlgo]This indicator is inspired by traditional statistical histograms. It will return the number of occurrences of price falling within each interval (bins) of the linear regression channel. This can be useful to highlight zones of interest within a trend.
Settings
Length: Number of recent closing prices used for the computation of the linear regression.
Bins Number: Number of intervals constructed from the linear regression channel.
Mult: Multiplicative factor for the RMSE. Controls the width of the linear regression channel.
Src: Input source of the indicator.
Usage
The indicator is constructed by dividing the linear regression channel range into a series of intervals (bins) of equal width. We then count the number of price values falling within each interval.
If a significant number of price values fall within a specific interval then that interval can highlight a potential zone of interest within a trend.
The zone of interest is highlighted in blue.
RSI Linear Regression with ZigZag by zdmreBoth the RSI (Relative Strength Index) and the Linear Regression ( LR ) rank among the most popular momentum indicators used in trading. When used in combination with other technical indicators (ZigZag), both RSI, LR and ZigZag can offer value in validating trade opportunities to optimize your risk management practices.
Here’s a look at how to use RSI, LR and ZigZag (Can be used for divergence patterns.) as part of your trade analysis.
If you have new ideas to improve this indicator then let me know please.
***Use it at your own risk
Linear Regression Fan [LuxAlgo]This indicator displays a fan using a linear regression fit to the price as a base. All lines are equidistant and are drawn from the first point of the linear regression to the most recent point of the linear regression plus the root-mean-square deviation (RMSD) multiplied by a certain factor.
Settings
Length: Lookback period for the linear regression.
Mult: Multiplier for the RMSD, allows returning wider fans.
Lines Per Side: Number of lines on each side of the fan.
Src: Input source of the indicator.
Usage
Traders often use the lines of fans to determine significant points of support or resistance at which they might expect price variations to reverse.
The length can be adjusted so that the starting point of the linear regression is located at a pivot high/low.
Some technical analysts use the measure rule of broadening wedges with fans when price breaks one of the extremities. This allows setting precise take-profits/stop-losses.
To learn more about the measure rule see:
log-log Regression From ArraysCalculates a log-log regression from arrays. Due to line limits, for sets greater than the limit, only every nth value is plotted in order to cover the entire set.
Exponential Regression From ArraysCalculates an exponential regression from arrays. Due to line limits, for sets greater than the limit, only every nth value is plotted in order to cover the entire set.
Smoothed Wave ScalperThis one is a little different.
Instead of layering lots of indicators to filter noise, I'm instead using two different kinds of price averaging to smooth the candles and better define the direction. Just select a smoothing value that fits your chart and timeframe. In theory, this should remove a fair bit of noise (although nothing's perfect)
I've managed to determine when the candles change colour, signifying a potential new trend. When the candle colours do change, an alert is fired. It's as simple as that! Wyckoff wave volume analysis is then applied to each alert to validate the move. Further filtering can be achieved using heikin ashi candles if this is your preference.
Alerts are built in for both the candle colour change and the wave filtered signals (long/short). Use long/short for entries and the colour changes for exits.
I'm currently trading with linear regression to help indentify obvious channels and areas of support/resistance. The candles bouncing down off of the upper band can confirm a downward trend, and bouncing off of the lower band can signify an up trend. It's much easier to see with smoothed candles like these and can give you confidence when trading manually. These bands are rendered automatically, but aren't essential to taking a trade.
The Echo Forecast [LuxAlgo]This indicator uses a simple time series forecasting method derived from the similarity between recent prices and similar/dissimilar historical prices. We named this method "ECHO".
This method originally assumes that future prices can be estimated from a historical series of observations that are most similar to the most recent price variations. This similarity is quantified using the correlation coefficient. Such an assumption can prove to be relatively effective with the forecasting of a periodic time series. We later introduced the ability to select dissimilar series of observations for further experimentation.
This forecasting technique is closely inspired by the analogue method introduced by Lorenz for the prediction of atmospheric data.
1. Settings
Evaluation Window: Window size used for finding historical observations similar/dissimilar to recent observations. The total evaluation window is equal to "Forecast Window" + "Evaluation Window"
Forecast Window: Determines the forecasting horizon.
Forecast Mode: Determines whether to choose historical series similar or dissimilar to the recent price observations.
Forecast Construction: Determines how the forecast is constructed. See "Usage" below.
Src: Source input of the forecast
Other style settings are self-explanatory.
2. Usage
This tool can be used to forecast future trends but also to indicate which historical variations have the highest degree of similarity/dissimilarity between the observations in the orange zone.
The forecasting window determines the prices segment (in orange) to be used as a reference for the search of the most similar/dissimilar historical price segment (in green) within the gray area.
Most forecasting techniques highly benefit from a detrended series. Due to the nature of this method, we highly recommend applying it to a detrended and periodic series.
You can see above the method is applied on a smooth periodic oscillator and a momentum oscillator.
The construction of the forecast is made from the price changes obtained in the green area, denoted as w(t) . Using the "Cumulative" options we construct the forecast from the cumulative sum of w(t) . Finally, we add the most recent price value to this cumulated series.
Using the "Mean" options will add the series w(t) with the mean of the prices within the orange segment.
Finally the "Linreg" will add the series w(t) to an extrapolated linear regression fit to the prices within the orange segment.
Exponential Regression Channel with novel volatilityThis code is a modified version of the built-in "linear regression" script of Tradingviews which can be plotted correctly on logarithmic charts
The log reg code of Forza was adjusted by altustro to generate an exponential regression (or a correct linear regression on the log scale, this is equivalent).
The standard deviation in the log scale is a better volatility measure which we call novola, and which defines the trend channel displayed in addition to the main indicator.
The exponential regression slope and channel also defines the typical holding time of the stock and the SL/TP boundaries, which are calculated and displayed at the last bar.
The display works both in log and regular scale. But only in the log scale it can be compared to the linear extension, which can also be plotted when activated in the properties.
The underlying exponential fit can not be displayed in regular scale as only lines can be plotted by TV. But with the related script Exponental Regression also the exponential regression can be exactly displayed using a workaround.
Exponential RegressionIn Tradingview it is not possible to actually display arbitrary non-linear functions retrospectively.
Series objects can only depend on the current or past bars
Thus, while regression is possible, display of a non-linear curve into the past is not possible
This script is a workaround to be able to still display an exponential fit of the last n bars.
It is based on a linear regression of the log(close). The parameters of this regression are printed in the label.
To create the correct plot, these parameters have to be written into the properties of the indicator.
The functions displayed follow the expression exp(A)* exp(pot*t+d)
where d =0 for the center line, and d = +-std * upperMult for the upper and lower line respectiveley.
The parameters of the function are:
amplitude in log scale A
exponent of the exponential function pot
standard deviation of the linear regression std
number of bars of the current chart bindex
multiplicator of the std of the upper and lower exponential line upperMult and lowerMult +
This code is a version of the built-in "linear regression" script of Tradingview alztered by Forza so it can be plotted correctly on logarithmic charts
The code of Forza was further adjusted by altustro to be able to plot the full exponential curve also in regular scale
MACD Linear Regression by zdmreBoth the Moving Average Convergence Divergence (MACD) and the Linear Regression (LR) rank among the most popular momentum indicators used in trading. When used in combination with other technical indicators, both MACD and LR can offer value in validating trade opportunities to optimize your risk management practices.
While they represent a similar approach to evaluating trades, the functions of both MACD and LR are distinct, which makes them useful indicators to combine in trade evaluation. Here’s a look at how to use MACD and LR as part of your trade analysis.
***Use it at your own risk
If you have new ideas to improve this indicator then let me know please.
Keep Learning, Keep Earning