Time Series ForecastIntroduction
Forecasting is a blurry science that deal with lot of uncertainty. Most of the time forecasting is made with the assumption that past values can be used to forecast a time series, the accuracy of the forecast depend on the type of time series, the pre-processing applied to it, the forecast model and the parameters of the model.
In tradingview we don't have much forecasting models appart from the linear regression which is definitely not adapted to forecast financial markets, instead we mainly use it as support/resistance indicator. So i wanted to try making a forecasting tool based on the lsma that might provide something at least interesting, i hope you find an use to it.
The Method
Remember that the regression model and the lsma are closely related, both share the same equation ax + b but the lsma will use running parameters while a and b are constants in a linear regression, the last point of the lsma of period p is the last point of the linear regression that fit a line to the price at time p to 1, try to add a linear regression with count = 100 and an lsma of length = 100 and you will see, this is why the lsma is also called "end point moving average".
The forecast of the linear regression is the linear extrapolation of the fitted line, however the proposed indicator forecast is the linear extrapolation between the value of the lsma at time length and the last value of the lsma when short term extrapolation is false, when short term extrapolation is checked the forecast is the linear extrapolation between the lsma value prior to the last point and the last lsma value.
long term extrapolation, length = 1000
short term extrapolation, length = 1000
How To Use
Intervals are create from the running mean absolute error between the price and the lsma. Those intervals can be interpreted as possible support and resistance levels when using long term extrapolation, make sure that the intervals have been priorly tested, this mean the intervals are more significants.
The short term extrapolation is made with the assumption that the price will follow the last two lsma points direction, the forecast tend to become inaccurate during a trend change or when noise affect heavily the lsma.
You can test both method accuracy with the replay mode.
Comparison With The Linear Regression
Both methods share similitudes, but they have different results, lets compare them.
In blue the indicator and in red a linear regression of both period 200, the linear regression is always extremely conservative since she fit a line using the least squares method, at the contrary the indicator is less conservative which can be an advantage as well as a problem.
Conclusion
Linear models are good when what we want to forecast is approximately linear, thats not the case with market price and this is why other methods are used. But the use of the lsma to provide a forecast is still an interesting method that might require further studies.
Thanks for reading !
Cerca negli script per "support resistance"
Adaptive Autonomous Recursive Trailing StopIntroduction
Trailing stop are important indicators in technical analysis, today i propose a new trailing stop A2RTS based on my last published indicator A2RMA (1), this last indicator directly used an error measurement thus providing a way to create enveloppes, which provide a direct way to create trailing stops based on highest/lowest rules.
The Indicator
If you need a more detailed explanation of this indicator i encourage you to check the A2RMA indicator post i made, parameters does not differ from the supertrend, thus having a length parameter and a factor parameter who is here described as gamma , gamma control how far away are the bands from each others thus spotting longer terms trends when gamma is higher.
On BTCUSD
Something worth mentioning is that the indicator sometimes behave like my MTA trailing stop indicator (2) who is closer to the price when a trend persist thus providing early exit points, however A2RTS behave a bit better.
Price can sometimes break the trailing stop, this can be interpreted as a support/resistance or just as an exit point, the support resistance methodology on trailing stop is not the most recommended.
Sometimes it is recommended to have an higher length rather than an high gamma like in this case for INTEL CORP, below gamma = 3 and length = 20
The microprocessor market like to use higher length's instead of higher gamma's , A2RMA is a non-linear filter, this would explain such behaviour.
Conclusion
Trailing stops might not suffer as much from whipsaw trades than MA crossovers but they still remain inefficient when market is not trending, results of the proposed indicator on major forex pairs are more than disappointing, but i hope this will serve as basis for other trailing stops that might act a little bit better. I conclude this post by thanking everyone who support my work and i encourage you to modify this indicator and share it with the community.
Thanks for reading !
Cited Articles
Weekly/Monthly CloseJust a simple support/resistance indicator that display weekly/monthly close price and it is configurable to work in two modes:
tracking mode - to display last week/month's close
history mode - to display weekly/monthly close prices
See how last month's close (ticker blue line) provides nice resistance and the price forms a double top then it consolidates under last week's close line (thiner blue line).
It also works on intraday charts and displays history close prices, see below how last month's close (ticker blue line) provides support over and over and also how price bounces off weekly close history prices (thiner blue line).
Multi SMAPlot all of the most important SMA values.
SMA 5, 8, 13 are based on Fibonaci values and frequently used in day trading frequently.
SMA 50, 100, 200 are important support/resistance lines.
Especially, SMA 50, 100, 200 are the most important support/resistance on BTC 1W. Dont forget to look at the weekly prices when trading :)
Standard Deviation W/Q/M PivotsThis is a re-iteration of the standard deviation of daily pivots with the pivots applied on weekly, monthly, quarterly and yearly levels. For intraday traders the weekly pivot points will act as a major support resistance levels. Quarterly and monthly pivot points are useful for short-term positions while the yearly pivot determines the stock's long term support-resistance levels and useful in determining if the stock is in a bullish/bearish leg.
Linhvb Sonic RSonic R is a famous trading system created by Mr Sonic. I only add new EMA987 as a strong dynamic support/resistance.
Daily 9 EMA Plotted at Other Than Daily Time Frame
Credit to the great @Zoen Triste for his original script at:
I just amend it for the Daily, 4H and other time frames. The main function of the Daily 9EMA (pink line) is to easily distinguish the big trend. It is also for multi time frames dynamic support / resistance when trading using tf lower than Daily, without having to toggle between the time frames. Everything is there at a single time frame chart. I like to day trade and switch to swing trade when there is a solid setup for it. To be able to do that, I use 15mins tf together with the Daily 9EMA, 4H 34EMA and 4H 21EMA.
How to trade using this setup?
First of all, if price is below the pink line (Daily 9EMA), it means the big trend is downtrend (and vice versa). When price retrace and reach the blue (4H 21EMA) or black (4H 34EMA) or the pink (Daily 9EMA) line (look at the red arrows), if there is bearish divergence / slingshot at the MACD's histogram together with a reversal candle such as pin bar (shooting star), dark cloud cover or bearish engulf, it's a short setup. We don't need to put the Stop Loss immediately. We can wait for the price to resume in the direction of the big trend to trail the SL.
I do add up daily and weekly pivots and trendlines for additional support / resistance for greater confidence. If the above setup occurs at certain pivots and trendline, we'll have a very high probability setup. Please see the zoomed-in chart as below:
When price is above the pink line, the setup is just the opposite.
My conclusion: When day trading using this setup at smaller time frames such as 15mins, we don't have to toggle between 4H and 15min time frames to see where is the EMA21 and EMA34 at 4H for the moment.
It's like we are able to see a microscopic and bird's eye views at the same time using a single time frame chart.
Tommy Oscillator v1.0 LightRSI rules: If we break above 70 RSI, 40-50 RSI acts as support,
If we break below 30 RSI, 50-60 RSI acts as resistance
I color coded the support/resistance areas to make visuals easier. This is part of my private indicator, but I removed the buy/sell part (which is the private part). I think this will help a lot with your guy's trading.
RSI with Visual Buy/Sell Setup | Corrective/Impulsive IndicatorRSI with Visual Buy/Sell Setup | 40-60 Support/Resistance | Corrective/Impulsive Indicator v2.15
|| RSI - The Complete Guide PDF ||
Modified Zones with Colors for easy recognition of Price Action.
Resistance @ downtrend = 60
Support @ uptrend = 40
Over 70 = Strong Bullish Impulse
Under 30 = Strong Bearish Impulse
Uptrend : 40-80
Downtrend: 60-20
--------------------
Higher Highs in price, Lower Highs in RSI = Bearish Divergence
Lower Lows in price, Higher Lows in RSI = Bullish Divergence
--------------------
Trendlines from Higher/Lower Peaks, breakout + retest for buy/sell setups.
###################
There are multiple ways for using RSI, not only divergences, but it confirms the trend, possible bounce for continuation and signals for possible trend reversal.
There's more advanced use of RSI inside the book RSI: The Complete Guide
Go with the force, and follow the trend.
"The Force is more your friend than the trend"
A/D Levelsuses reversal candles to determine accumulation and distribution candles
remembers the last reversal candle and draws a support or resistance line at the reversal level
does a barcolor if the price breaks support/resistance
similar to the hoffman a/d breakout indicator but there is no trend detection components
VMA's (T=1h, 2h, 4h, 8h)Plots four VMA's (Variable/Volatility Moving Average) in multiple static resolutions (1h, 2h, 4h, 8h), ideal for support/resistance/stops on predictably trending symbols like BTCUSD.
Example:
Longest Average (LA) [cI8DH]This simple indicator calculates the total average of price from the first available bar to the current bar. It seems to act as a support/resistance.
SMA Guppy (Prophet)Guppy using SMAs instead of EMAs.
SMAs commonly act as support/resistance.
Using this along with an EMA guppy gives a good trend analysis along with potential stops/targets.
Automatic Support, Resistance, Fibonacci LevelsThis indicator plots absolute high and low values for up to five completely adjustable time periods (in months, weeks, days, hours, minutes) and optionally calculates the Fibonacci levels on the pair of absolutes of your choice, ascending or descending, and mimics the shading available in the built-in Fib charting tools (e.g. retracement).
Here are a few screenshots of the same chart with various options selected.
3-Month, 4-Week, and 5-Day absolutes with 3-Monthly Fib plotted:
The same chart with 4-Weekly Fib:
The same chart with 5-Daily Fib:
5-Day, 12-Hour, 90-Minute absolutes with 12-Hourly Fib:
Zoomed in, on a 30-minute interval, with 90-minute Fib:
With descending ("inverted") 90-minute Fib:
I started putting this together for Vazzyb, who was looking for a way to automate plotting horizontal support and resistance levels for monthly, weekly, and daily extremes, and then I added additional features as they occurred to me. Special thanks to Paaax, who suggested I add Fib levels.
I am leaving the code open, so you may feel free to grab snippets you like and use them for your own purposes. Of particular interest may be my custom "calc_fib()" function, which accepts any series pair, as well as a Boolean indicating whether to invert, and returns an array with each of the major Fibonacci levels: .
If anyone likes this enough to feel generous, please feel free:
BTC
3KmFchJ18QvMzAJKDcFQXvyK9p1EHWQdhP
BCH
qqtrw64ptuwprk5vtj3z8qwkvh3v0jawxq7khqng7x
ETH
0x9b51361A278910Ba3945C7519C9f0FA8a77df18d
LTC
MDeWWsP7XCG2zQuZ2dYALZXQ52u2qkc8fh
P.S. If you want the time lengths to be as close to accurate as possible, don't forget to change the number of days per week when using for cryptocurrency!
SMMA Analyses - Buy / Sell signals and close position signals This script combines the usage of the SMMA indicator in order to provide signals for opening and closing trades, either buy or sell signals.
It uses two SMMA , a fast and a slow one, both configurable by the users.
The trigger of Buy and Sell Signals are calculated through the SMMA crosses:
Buy Signals : The fast SMMA crosses over the slow SMMA . They are highlighting by a green area and a "B" label.
Sell Signals : The fast SMMA crosses under the slow SMMA . They are highlighting by a red area and a "S" label
The trigger of Close Buy and Close Sell Signals are calculated through the close price crosses with the fast SMMA:
Close Buy Signals : The fast SMMA crosses under the close price and at the same time the trend is bullish , so the fast SMMA is greater than the slow SMMA . They are highlighted by a lighter green area
Close Sell Signals : The fast SMMA crosses over the close price and at the same time the trend is bearish , so the fast SMMA is lower than the slow SMMA . They are highlighted by a lighter red area
Few important points about the indicator and the produced signals :
This is not intended to be a strategy, but an indicator for analyzing the SMMA conditions. It gives you the triggers depending on the real time analysis of the SMMA and prices, but not being a proper strategy, pay attention about "fake signals" and add always a visual analysis to the provided signals
Following this indicator, the trade positions should be opened only when a cross happens. Either in this case, analyse the chart in order to see if the signals are a "weak" ones, due to "waves" around the SMMA . In these cases, you might wait for the next confirmation signals after the waves, when the trend will be better defined
The close trade signals are provided in order to help to understand when you should close the buy or sell trades. Even in this case, always add a visual analysis to the signals, and pay attention to the support/resistance areas. Sometimes, you can have the close signals in correspondence to support/resistance areas: in these cases wait for the definition of the trend and eventually for the next close trade signals if they will be better defined
Nearest Support / Resistance - Beasley SavagePlots nearest support and resistance at a given resolution.
CCI Secret Sauce 1hr strategy by CryptoLloydChanged the CCI_Period to 30 and T3_Period to 1
Giving us a much clear indication of when to go long or short when used with RSI and MACD.
Rules:
LONG - RSI above 50, MACD Bullish cross - Use common sense, price action, horizontal support/resistance, 55 and 150 EMA's
SHORT - Inverse rule set - Use common sense, price action, horizontal support/resistance, 55 and 150 EMA's
Sweetspot Gold RN - by JustUncleLThis is an alternate version of "Sweetspot Gold R4" that does not use sublevels. Removing the sublevels allows more efficient use of the plots (TV script has a limit of 64 plot calls).
This works well for all currency pairs I've tested, most commodities, and most stocks.
The indicator plots the so called "round price levels" or "00" levels. For example, 1.4000, 1.4400, 1.4500.
It automatically calculates the levels for each chart time frame. Optionally you can manually select main level size (in pips)
Use this indicator as a guidance to a better mapping of Support/Resistance levels on the chart. Next time you draw Support/Resistance lines, if they coincide with round price levels, you have got a excellent S/R level to work with!
Sweetspot Gold R4-22 - by JustUncleLThis upgrade I have attempted to improve the Automatic levels calculation and better automatic levels selections. It should now work better with exotic currencies, indices, commodities, and stocks.
The indicator plots the so called "round price levels" or "00" levels, which end on 00 and 50: for example, 1.4000, 1.4400, 1.4450. It automatically calculates the levels for based on your charts time frame. Alternatively you can manually select main level size (in pips) and/or the number of sub-levels (0, 1, 2, 3, 9). Generally speaking, the program tries to keep to 3 Digit "00" rounding for currencies and non-stocks, and 2 Digit "00" rounding for Stocks.
Use this indicator as a guidance to a better mapping of Support/Resistance levels on the chart. Next time you draw Support/Resistance lines, if they coincide with round price levels, especially "00", you have got a excellent S/R level to work with!
VDUB_Rejection_Spike_V3VDUB_Rejection_Spike_V3
Re added support / resistance levels from _v1
Additional Donchain channel modified RS outer support / resistance level
Added trend colour change EMA
Removed Channel walls
* Still need to work on Buy & sell entries signals
CM_OldSchool_Projected_high_LowHeard this story from Larry Williams…the trader who holds the record for winning the U.S. Trading Championship by turning $10K in to 2 Million.
A trader named Owen Taylor developed this formula as a Floor Trader before to calculate the Projected High and Low of the next day.
The formula worked so well…Owen charged other Traders 1K to get it.
I was pretty impressed with the results…so I coded it for the Weekly, Monthly, Quarterly, and Yearly Projected High Low.
While Owen considered these levels to be major support and resistance, Larry has developed many strategies based on the Breakout of the Projected High Low.
Therefore I coded it so the Levels would plot Yellow, and change to Green if the Projected High was taken out, and Red if the Projected Low was taken out.
***I’ve noticed on many instruments, Stocks, Index’s, Forex etc., depending on the instrument it works great as Support/Resistance or Breakouts.
***On a Daily Chart put the Quarterly and Yearly levels on SPY and EURUSD and go back about 10 years. Levels are pretty accurate.
Code Plots - High, Low, Open, Close—Daily, Weekly, & Monthly!!!Custom Code Plots High, Low, Open, Close
Plots Today And/Or Previous Day
Daily, Weekly, & Monthly TimeFrames
Default Settings:
Green = High
Silver = Open
Fuchsia = Close
Red = Low
Current D-W-M = Circles as Plots
Previous D-W-M = Cross as Plots
By Default The Current Days High, Low, Open, Close Plots. There are Check boxes On The Inputs Tab To Turn All Options On And Off.
***Tip - For Intra-Day Trades…I Find It Useful To Plot Previous Days High, Low, Open, Close For Support/Resistance, & Breakout Levels. Plotting the Current Weekly and Monthly Levels Is Also Very Useful.
***If You Trade Daily Charts The Previous Months Levels Are Very Useful as Support/Resistance, & Breakout Levels….
Code For High, Low, Open, Close
pastebin.com
Video On Importing Custom Indicators from PasteBin:
videos.tradingview.com
Candle Wick Analysis🔍 What This Indicator Does
The Candle Wick Analysis indicator dynamically colors each candle body based on the comparative strength of its wicks and body, helping traders visually assess market sentiment, rejection zones, and momentum exhaustion with higher clarity.
This tool is especially useful for:
Price action traders
Scalpers
Reversal and trend continuation traders
Anyone who uses candlestick structure for confirmations
📊 How It Works
The indicator analyzes each candle and compares the percentage change of the upper wick, body, and lower wick relative to the opening price. Based on this relationship, it assigns a green or red color to the candle body to indicate likely price strength or weakness.
🧠 Logic Breakdown
✅ If the Candle is Bullish (close > open):
🔵 Green Candle Body: If the upper wick is smaller than the combined percentage size of the body + lower wick
→ Indicates strong bullish momentum with low upper rejection.
🔴 Red Candle Body: If the upper wick is larger than body + lower wick
→ Suggests potential exhaustion or rejection at the top.
✅ If the Candle is Bearish (close < open):
🔴 Red Candle Body: If the lower wick is smaller than the combined percentage size of the body + upper wick
→ Indicates strong bearish momentum with low lower support.
🟢 Green Candle Body: If the lower wick is larger than body + upper wick
→ Suggests potential downside rejection or support zone bounce.
⚪ Neutral Candles:
If the candle does not meet any specific wick/body criteria, it is displayed in gray to indicate neutrality or indecision (such as a doji).
🛠️ Technical Highlights
Built in Pine Script v5
Uses precise percentage-based wick/body comparison
Works on any timeframe and instrument
Minimalist coloring style: only the body color changes, while wicks stay gray
💡 Use Cases
Quickly spot exhaustion candles, where strong wicks may indicate a reversal or trap.
Validate trend strength: strong candles are colored green, weak ones red, even within bullish or bearish structures.
Filter entries and exits using visual confirmation of wick-to-body dynamics.
📌 Notes
This is a visual tool, not a buy/sell signal indicator.
Best used in conjunction with other forms of analysis (support/resistance, volume, moving averages, etc.)
Can be enhanced with alerts, filters (e.g., volume spikes), or labeling based on user feedback.