High-Low IndexHello All,
High-Low Index is a breadth indicator based on Record High Percent (RHP). RHP is based on new 52-week highs and new 52-week lows. RHP => 100 * (new highs) / (new highs + new lows). High-Low Index is a 10-day Simple Moving Average of the RHP, which makes it a smoothed version of RHP. You can find many articles about High-Low Index on the net.
High-Low Index above 50 indicates that there are more new highs than new lows, and considered as Bullish.
High-Low Index below 50 indicates that there are more new lows than new highs, and considered as Bearish.
High-Low Index = 0 indicates there is no new highs (0% new highs).
High-Low Index = 100 indicates that there is at least 1 new high and no new lows.
and High-Low Index = 50 indicates that new highs and new lows is equal.
by default 40 cryptos are used in the script and shows High-Low Index for these cryptos. but you can change them as you wish. for example you can set all of them as stocks and see High-Low Index for these stocks.
You can set " Time frame " and the " Length " using the options. For example; if you set " Time frame " = 1 Week and the " Length " = 52 then it finds High-Low Index for 52weeks .
or another example; if you set " Time frame " = 1 Day and the " Length " = 22 the High-Low Indexn it finds High-Low Index for 22days.
You can enable/disable Record High Percent or Simple Moving Average of High-Low Index. Some traders use High-Low Index with its SMA, for example; High-Low Index generates a buy signal when it crosses above its moving average, and a sell signal when it crosses below its moving average.
Optionally you can see the securities in a table on the left bottom, you can change table size by usşng the options.
In the Table, for each security/cell;
=> if background is green then it has New High
=> if background is red then it has New Low
=> if background is gray then no New High, no New Low
=> if background is back then Data is not available for the security
As you can see in the screenshot below, the securities were changed and stocks are used instead of cryptos, so it calculates & shows High-Low Index for these stocks.
you can also find explanation in this screenshot:
Enjoy!
在脚本中搜索"crypto"
TradingGroundhog - Strategy & Fractal V1#-- Public Strategy - No Repaint - Fractals -- Short term
Here I come with another script, more simple than Wavetrend V1. You will love it.
#-- Synopsis --
Another simple idea, on a small time frame (15 min) we buy when the opening price goes below a Bottom fractals and sell when it goes over a Top fractals, but as this script do not use Wavetrends. You should stop by your self to use the script during long lasting downtrends.
I developed the strategy using BTC /EUR 3 MIN BINANCE but it can be applied to many other cryptos, I don't know for forex or others. You can use it for short term (to a month of uptrend) and automated trading.
#-- Graph reading --
And now, how to read it ?
Fractals:
Yellow Flags occur when the opening price goes below a Bottom fractal , it means Buy.
White Flags appear when the opening price goes over a Top fractal , it means Sell.
#-- Parameters --
*** Parameters have been intensively optimized using 10 cryptocurrency markets in order to have potent efficiency for each of them. I would recommend to only change the Can Be touch parameter. For the others, I don't recommend any modifications. The idea behind the script is to be able to switch between markets without having to optimize parameters, less work, easy to target active crypto and therefor limit the risks. ***
Can be touch :
'Filter fractals' : Activate or Disable the filtering fractal operation. If Enable, buy during less risky periods. (Activate is often better)
Can be touch but not necessary :
'VolumeMA' : The Volume corrector used by the fractals
'Extreme window' : The number of price individuals to look for if we want to remove extreme fractals.
Not to touch :
'Long Sop Loss (%)' : The minimal difference of price between a Fractal bottom and the opening price to buy.
#-- Time frame --
Should be used with the following time frames depending on the necessity:
1 MIN
3 MIN (Preferred with the parameters set)
5 MIN
#-- Last words --
The script can be set up to send Tradingview signals to 3comma just by adding comment = " " in strategy.close_all() and strategy.entry().
Good trades !
Disclaimer (As it should always be one to any script)
***
This script is intended for and only to be used for personal purposes only. No such information provided by it constitutes advice or a recommendation for any investment or trading strategy for any specific person. There is no guarantee presented or implied as to the accuracy of specific forecasts, projections, or predictive statements offered by the script. Users of the script agree that its original developer does not take responsibility for any of your investment decisions. Please seek professional advice before trading.
***
# Here are the results from the 20rst of September 2021 with 100% of equity on the BTC /EUR 3 Min and with a capital of 10 000 EUR. So almost, one month.
# As I saw, it goes from +30% to more than +160% (the great SHIB) depending on the selected crypto. It may be negative if you spot a downtrend.
TradingGroundhog - Strategy & Wavetrend V2#-- Public Strategy - No Repaint - Fractals - Wavetrend --
Here I come with another script, a nice and simple strategy based on fractals and Wavetrends.
#-- Synopsis --
A simple idea, on a small time frame (15 min) we buy when the opening price goes below a Bottom fractals and sell when it goes over a Top fractals, but in order to avoid bad and evil downtrends, we use Wavetrends based on a Daily time frame. From it, Tops and Bottoms are extracted. If the opening price goes above Wavetrend Tops, no trades will be conducted during the day. If the price goes below Wavetrend bottoms, no trades will be executed from 1 to N days, until a new Wavetrend bottom is generated.
I developed the strategy using BTC /EUR 15 MIN BINANCE but it can be applied to many other cryptos, I don't know for forex or others. You can use it for long term and automated trading, I implemented the Wavetrend indicator to do so, or for short term if you have spot a long coming uptrend. Test it, look at its profit and long or short period on your crypto of choice.
#-- Graph reading --
And now, how to read it ?
Wavetrends:
Red Backgrounds are associated to No Trade periods. These periods occur when the price goes below a Wavetrend bottom or above a Wavetrend Top. They are here to limit the loss.
Blue Gradient lines represent the past Tops. For each bar, only the increasing values of the Wavetrend tops are acquired. Going from light to dark blue based on the age of the Tops. Thus, if on line goes from dark to light, this means the price is approaching a previous Wavetrend top. In the opposite, if it darken, thus the price say 'buy buy' and go dropping.
Yellow Gradient lines represent the past Bottoms. They are based on the same principe that the blue lines.
Fractals:
Yellow Flags occur when the opening price goes below a Bottom fractal , it means Buy.
White Flags appear when the opening price goes over a Top fractal , it means Sell.
#-- Parameters --
*** Parameters have been intensively optimized using 10 cryptocurrency markets in order to have potent efficiency for each of them. I would recommend to only change the Can Be touch parameter. For the others, I don't recommend any modifications. The idea behind the script is to be able to switch between markets without having to optimize parameters, less work, easy to target active crypto and therefor limit the risks. ***
Can be touch :
'Combined Smoothness' : The number of open individuals used by the Wavetrend. (6 or 9, often 9 is better but with less volatile crypto it will be 6)
'Filter fractals' : Activate or Disable the filtering fractal operation. If Enable, buy during less risky periods. (Disable is often better)
Can be touch but not necessary :
'VolumeMA' : The Volume corrector used by the fractals
'Extreme window' : The number of price individuals to look for if we want to remove extreme fractals.
Not to touch :
'Limit_candle to look on' : Number of candles to use to compute the Wavetrend Tops and Bottoms.
'Length top bottom drawn' : Size of the lines
'Long Sop Loss (%)' : The minimal difference of price between a Fractal bottom and the opening price to buy.
#-- Time frame --
Should be used with the following time frames depending on the necessity:
1 MIN
3 MIN (Interesting for short term profit, may need some parameter ajustements)
5 MIN
15 MIN (Preferred for long term profit, the script was developed on it)
#-- Last words --
The script can be set up to send Tradingview signals to 3comma just by adding comment = " " in strategy.close_all() and strategy.entry().
Good trades !
Disclaimer (As it should always be one to any script)
***
This script is intended for and only to be used for personal purposes only. No such information provided by it constitutes advice or a recommendation for any investment or trading strategy for any specific person. There is no guarantee presented or implied as to the accuracy of specific forecasts, projections, or predictive statements offered by the script. Users of the script agree that its original developer does not take responsibility for any of your investment decisions. Please seek professional advice before trading.
***
# Here are the results from the 1rst of July 2021 with 100% of equity on the BTC /EUR 15 Min and with a capital of 1 000 EUR.
# As I saw, it goes from +20% to more than +100% depending on the selected crypto. Sometimes it's negative but it's quite rare on crypto using the EUR.
robotrading bodyThis is a very simple and universal strategy. Good for crypto. For BTC/USD, shitcoin/BTC.
Strategy
Long positions only. If the candle is falling and the candle body is 3 or more times the average candle body, then open a long position.
If the candle is rising, we should close a long position.
Short positions are not used.
This is a counter-trend strategy.
The average body of a candlestick is the arithmetic average of the bodies of the previous 100 bodies.
Parameters
The multiplier is the number of times the candlestick body should be bigger than the average candlestick body to get a signal to open a long position.
Recommended
- A timeframe of 4 hours to 1 day
- Cryptocurrencies with large market capitalization
- you can use coin/USD, coin/USDT, coin/BTC, coin/ETH, etc
+ Detrended Price OscillatorAccording to TradingView the Detrended Price Oscillator is an oscillator that removes trend from price in order to more clearly show an instrument's cyclical
highs and lows so that an investor or trader may more easily time when to buy or sell the underlying instrument. Accordingly, it is not meant to be used as a way of gauging momentum, however, I find it perfectly suitable for the task (at least when used "un-centered" which is how it comes by default here). If you wish to read up more on the DPO just search for it under indicators. It's built in, so you'll find all the information you need on it there. Or check investopedia.
On to the good stuff. What have I done and how does this work?
As un-centered you can use it just like any other momentum oscillator. Price above the zero line is bullish and below is bearish, generally speaking.
I've added two moving averages that you can turn on or off, and choose amongst various types and lengths. Both of these are colored based on trend.
The DPO is also colored based on trend, with a neutral color based on where the DPO is relative to the primary MA and the zero line.
Candles are colored in the same way that the DPO is.
I've added Bollinger Bands because they could be useful on an indicator like this.
All the alert conditions you could dream of.
With this set to centered you will notice that the DPO is not inline with current price. That is intentional, as it's only designed to look at historical price
data to time highs and lows of price movement. As such, I don't recommend using this when set to centered, at least if you're trading crypto. The price volatility
perhaps makes for inconsistent timing of cyclical highs and lows, or perhaps it's the rather brief amount of time cryptocurrencies have been in existence.
I do not know. Just stick to using it un-centered.
The above image shows the indicator with Bollinger Bands turned on and the MA's turned off. Also, you should note that the candle color and DPO color is based on the primary moving average you are using. If you want consistency, and want to use the Bollinger Bands, then keep your primary moving average set as a 20 SMA, as that is the basis for Bollinger Bands.
Hope this is helpful to you. Definitely pair it with an additional indicator like an RSI, or my +ADP. I like to use something rangebound to compare its signals to.
Bitcoin Margin Call Envelopes [saraphig & alexgrover]Bitcoin is the most well known digital currency, and allow two parties to make a transaction without the need of a central entity, this is why cryptocurrencies are said to be decentralized, there is no central unit in the transaction network, this can be achieved thanks to cryptography. Bitcoin is also the most traded cryptocurrency and has the largest market capitalization, this make it one of the most liquid cryptocurrency.
There has been tons of academic research studying the profitability of Bitcoin as well as its role as a safe heaven asset, with all giving mixed conclusions, some says that Bitcoin is to risky to be considered as an hedging instrument while others highlight similarities between Bitcoin and gold thus showing evidence on the usefulness of Bitcoin acting as an hedging instrument. Yet Bitcoin seems to attract more short term speculative investors rather than other ones that would use Bitcoin as an hedging instrument.
Once introduced, cryptocurrencies where of course heavily analyzed by technical analyst, and technical indicators where used by retail as well as institutional investors in order to forecast the future trends of bitcoin. I never really liked the idea of designing indicators that specifically worked for only one type of market and ever less on only one symbol. Yet the user @saraphig posted in Feb 20 an indicator called " Margin Call MovingAverage " who calculate liquidation price by using a volume weighted moving average. It took my attention and we decided to work together on a relatively more complete version that would include resistances levels.
I believe the proposed indicator might result useful to some users, the code also show a way to restrict the use of an indicator to only one symbol (line 9 to 16).
The Indicator
The indicator only work on BTCUSD, if you use another symbol you should see the following message:
The indicator plot 6 extremities, with 3 upper (resistance) extremities and 3 lower (support) extremities, each one based on the isolated margin mode liquidation price formula:
UPlp = MA/Leverage × (Leverage+1-(Leverage*0.005))
for upper extremities and:
DNlp = MA × Leverage/(Leverage+1-(Leverage*0.005))
for lower extremities.
Length control the period of the moving averages, with higher values of length increasing the probability of the price crossing an extremity. The Leverage's settings control how far away their associated extremities are from the price, with lower values of Leverage making the extremity farther away from the price, Leverage 3 control Up3 and Dn3, Leverage 2 control Up2 and Dn2, Leverage 1 control Up1 and Dn1, @saraphig recommend values for Leverage of either : 25, 20, 15, 10 ,5.
You can select 3 different types of moving average, the default moving average is the volume weighted moving average (VWMA), you can also choose a simple moving average (SMA) and the Kaufman adaptive moving average (KAMA).
Based on my understanding (which could be wrong) the original indicator aim to highlight points where margin calls might have occurred, hence the name of the indicator.
If you want a more "DSP" like description then i would say that each extremity represent a low-pass filter with a passband greater than 1 for upper extremities and lower than 1 for lower extremities, unlike bands indicators made by adding/subtracting a volatility indicator from another moving average this allow to conserve the original shape of the moving average, the downside of it being the inability to show properly on different scales.
here length = 200, on a 1h tf, each extremities are able to detect short-terms tops and bottoms. The extremity become wider when using lower time-frames.
You would then need to increase the Leverages settings, i recommend a time frame of 1h.
Conclusion
I'am not comfortable enough to make a conclusion, as i don't know the indicator that well, however i liked the original indicator posted by @saraphig and was curious about the idea behind it, studying the effect of margin calls on market liquidity as well as making indicators based on it might result a source of inspiration for other traders.
A big thanks to @saraphig who shared a lot of information about the original indicator and allowed me to post this one. I don't exclude working with him/her in the future, i invite you to follow him/her:
www.tradingview.com
Thx for reading and have a nice weekend! :3
Simple Alt Coin Strategy - EMA and MACD w/Profit and StopThis script prints BUY and SELL signals based on settings you input. I use it to save time while scrolling through charts deciding what alts I want to look at.
BUY SIGNALS
Positive EMA Crossover
Positive MACD Crossover
Single Candle Gains
SELL SIGNALS
Profit Capture
Stop Loss
I don't trade based just on the BUY or SELL from this strategy, but I have found that these indicators do very well well looking at the large cap alt coins. It backtests well.
Default Settings EMA 5/12/50, MACD 9/12/26, Single Candle Gain 10%, Stop 10%, Profit Capture 45%
[BoTo] RSI Trend StrategyOpen source code.
It is very old trade strategy. It is older than you :) Uses the RSI indicator. The RSI indicator has described Welles Wilder in the book in 1978. And all this is still profitable!
Additional articles
1. en.wikipedia.org
2. en.wikipedia.org
3. www.tradingview.com(RSI)
How it works
Step 1. The user chooses length for RSI
Step 2. If RSI is more than 50, then it is a uptrend and the long position opens. It is necessary to close a short position if it is opened earlier.
Step 3. If RSI is less than 50, that is a downtrend and the short position opens. It is necessary to close a long position if it is opened earlier.
Well is suitable for the market of cryptocurrencies. Well length from 3 to 7 approaches. Don't use length 14 because for cryptocurrencies it is too much. Cryptocurrencies it is very volatile market. You can also use the RSI indicator which is built in on TradingView.com.
Simple profitable trading strategyThis strategy has three components.
Philakones EMAs are a sequence of five fibonacci EMAs. They range from 55 candles (green) to 8 candles (red) in length. A strong trend or breakout is marked by the emas appearing in sequence of their length from 8 to 55 or vice versa. These EMAs are also used to signal an exit. Only two EMAs are used for exit signals - when the 13 EMA crosses over/under the 55 EMA.
RSI gives a bullish signal when 40 > rsi > 70. Exit signals are oversold (30) or overbought (70)
Stochastics give a bullish signal when stoch < 80 and an exit signal when > 95.
Results include 3 ticks of slippage and taker fees of .002. Provides a pretty smooth equity curve with a 73% win rate and beats buy and hold by than 10x (returns about 60x overall) since start of 2017.
Noro's SILA v1.6L StrategyBacktesting
Backtesting (for all the time of existence of couple) only with software configurations to default (without optimization of parameters):
US = Uptrend-Sensivity
DS = Downtrend-Sensivity
It is recommended and by default:
- the normal market requires US=DS (for example US=5, DS=5)
- very bear market requires US DS, (for example US=5, DS=0)
- very bull market requires US DS, (US=0, DS=5)
Cryptocurrencies it is very bull market (US=0, DS=5)
Backtesting BTC/FIAT
D1 timeframe
identical parameters for all pairs
BTC/USD (Bitstamp) profit of +41805%
BTC/EUR (BTC-e) profit of +1147%
BTC/RUB (BTC-e) profit of +1162%
BTC/JPY (Bitflyer) profit of +215%
BTC/CNY (BTCChina) profit of 54948%
Backtesting ALTCOIN/BTC
D1 timeframe
identical parameters for all pairs
the exchange Poloniex
top-10 of cryptocurrencies on capitalization at the time of this text
NA = TradingView can't make backtest because of too low price of this cryptocurrency, or on the website there are no quotations of this cryptocurrency
ETH/BTC (Etherium) profit of +11690%
XRP/BTC (Ripple) loss of-100%
LTC/BTC (Litecoin) NA
ETC/BTC (Etherium Classic) profit of +214%
NEM/BTC loss of-49%
DASH/BTC profit of +106%
IOTA/BTC NA
XMR/BTC (Monero) profit of +96%
STRAT/BTC (Stratis) loss of-31%
ALTCOIN/ALTCOIN - not recomended
I don't need your money, I need reputation and likes.
LEGEND IsoPulse Fusion • Universal Volume Trend Buy Sell RadarLEGEND IsoPulse Fusion • Universal Volume Trend Buy Sell Radar
One line summary
LEGEND IsoPulse Fusion reads intent from price and volume together, learns which features matter most on your symbol, blends them into a single signed Fusion line in a stable unit range, and emits clear Buy Sell Close events with a structure gate and a liquidity safety gate so you act only when the tape is favorable.
What this script is and why it exists
Many traders keep separate windows for trend, volume, volatility, and regime filters. The result can feel fragmented. This script merges two complementary engines into one consistent view that is easy to read and simple to act on.
LEGEND Tensor estimates directional quality from five causally computed features that are normalized for stationarity. The features are Flow, Tail Pressure with Volume Mix, Path Curvature, Streak Persistence, and Entropy Order.
IsoPulse transforms raw volume into two decaying reservoirs for buy effort and sell effort using body location and wick geometry, then measures price travel per unit volume for efficiency, and detects volume bursts with a recency memory.
Both engines are mapped into the same unit range and fused by a regime aware mixer. When the tape is orderly the mixer leans toward trend features. When the tape is messy but a true push appears in volume efficiency with bursts the mixer allows IsoPulse to speak louder. The outcome is a single Fusion line that lives in a familiar range with calm behavior in quiet periods and expressive pushes when energy concentrates.
What makes it original and useful
Two reservoir volume split . The script assigns a portion of the bar volume to up effort and down effort using body location and wick geometry together. Effort decays through time using a forgetting factor so memory is present without becoming sticky.
Efficiency of move . Price travel per unit volume is often more informative than raw volume or raw range. The script normalizes both sides and centers the efficiency so it becomes signed fuel when multiplied by flow skew.
Burst detection with recency memory . Percent rank of volume highlights bursts. An exponential memory of how recently bursts clustered converts isolated blips into useful context.
Causal adaptive weighting . The LEGEND features do not receive static weights. The script learns, causally, which features have correlated with future returns on your symbol over a rolling window. Only positive contributions are allowed and weights are normalized for interpretability.
Regime aware fusion . Entropy based order and persistence create a mixer that blends IsoPulse with LEGEND. You see a single line rather than two competing panels, which reduces decision conflict.
How to read the screen in seconds
Fusion area . The pane fills above and below zero with a soft gradient. Deeper fill means stronger conviction. The white Fusion line sits on top for precise crossings.
Entry guides and exit guides . Two entry guides draw symmetrically at the active fused entry level. Two exit guides sit inside at a fraction of the entry. Think of them as an adaptive envelope.
Letters . B prints once when the script flips from flat to long. S prints once when the script flips from flat to short. C prints when a held position ends on the appropriate side. T prints when the structure gate first opens. A prints when the liquidity safety flag first appears.
Price bar paint . Bars tint green while long and red while short on the chart to mirror your virtual position.
HUD . A compact dashboard in the corner shows Fusion, IsoPulse, LEGEND, active entry and exit levels, regime status, current virtual position, and the vacuum z value with its avoid threshold.
What signals actually mean
Buy . A Buy prints when the Fusion line crosses above the active entry level while gates are open and the previous state was flat.
Sell . A Sell prints when the Fusion line crosses below the negative entry level while gates are open and the previous state was flat.
Close . A Close prints when Fusion cools back inside the exit envelope or when an opposite cross would occur or when a gate forces a stop, and the previous state was a hold.
Gates . The Trend gate requires sufficient entropy order or significant persistence. The Avoid gate uses a liquidity vacuum z score. Gates exist to protect you from weak tape and poor liquidity.
Inputs and practical tuning
Every input has a tooltip in the script. This section provides a concise reference that you can keep in mind while you work.
Setup
Core window . Controls statistics across features. Scalping often prefers the thirties or low fifties. Intraday often prefers the fifties to eighties. Swing often prefers the eighties to low hundreds. Smaller responds faster with more noise. Larger is calmer.
Smoothing . Short EMA on noisy features. A small value catches micro shifts. A larger value reduces whipsaw.
Fusion and thresholds
Weight lookback . Sample size for weight learning. Use at least five times the horizon. Larger is slower and more confident. Smaller is nimble and more reactive.
Weight horizon . How far ahead return is measured to assess feature value. Smaller favors quick reversion impulses. Larger favors continuation.
Adaptive thresholds . Entry and exit levels from rolling percentiles of the absolute LEGEND score. This self scales across assets and timeframes.
Entry percentile . Eighty selects the top quintile of pushes. Lower to seventy five for more signals. Raise for cleanliness.
Exit percentile . Mid fifties keeps trades honest without overstaying. Sixty holds longer with wider give back.
Order threshold . Minimum structure to trade. Zero point fifteen is a reasonable start. Lower to trade more. Raise to filter chop.
Avoid if Vac z . Liquidity safety level. One point two five is a good default on liquid markets. Thin markets may prefer a slightly higher setting to avoid permanent avoid mode.
IsoPulse
Iso forgetting per bar . Memory for the two reservoirs. Values near zero point nine eight to zero point nine nine five work across many symbols.
Wick weight in effort split . Balance between body location and wick geometry. Values near zero point three to zero point six capture useful behavior.
Efficiency window . Travel per volume window. Lower for snappy symbols. Higher for stability.
Burst percent rank window . Window for percent rank of volume. Around one hundred to three hundred covers most use cases.
Burst recency half life . How long burst clusters matter. Lower for quick fades. Higher for cluster memory.
IsoPulse gain . Pre compression gain before the atan mapping. Tune until the Fusion line lives inside a calm band most of the time with expressive spikes on true pushes.
Continuation and Reversal guides . Visual rails for IsoPulse that help you sense continuation or exhaustion zones. They do not force events.
Entry sensitivity and exit fraction
Entry sensitivity . Loose multiplies the fused entry level by a smaller factor which prints more trades. Strict multiplies by a larger factor which selects fewer and cleaner trades. Balanced is neutral.
Exit fraction . Exit level relative to the entry level in fused unit space. Values around one half to two thirds fit most symbols.
Visuals and UX
Columns and line . Use both to see context and precise crossings. If you present a very clean chart you can turn columns off and keep the line.
HUD . Keep it on while you learn the script. It teaches you how the gates and thresholds respond to your market.
Letters . B S C T A are informative and compact. For screenshots you can toggle them off.
Debug triggers . Show raw crosses even when gates block entries. This is useful when you tune the gates. Turn them off for normal use.
Quick start recipes
Scalping one to five minutes
Core window in the thirties to low fifties.
Horizon around five to eight.
Entry percentile around seventy five.
Exit fraction around zero point five five.
Order threshold around zero point one zero.
Avoid level around one point three zero.
Tune IsoPulse gain until normal Fusion sits inside a calm band and true squeezes push outside.
Intraday five to thirty minutes
Core window around fifty to eighty.
Horizon around ten to twelve.
Entry percentile around eighty.
Exit fraction around zero point five five to zero point six zero.
Order threshold around zero point one five.
Avoid level around one point two five.
Swing one hour to daily
Core window around eighty to one hundred twenty.
Horizon around twelve to twenty.
Entry percentile around eighty to eighty five.
Exit fraction around zero point six zero to zero point seven zero.
Order threshold around zero point two zero.
Avoid level around one point two zero.
How to connect signals to your risk plan
This is an indicator. You remain in control of orders and risk.
Stops . A simple choice is an ATR multiple measured on your chart timeframe. Intraday often prefers one point two five to one point five ATR. Swing often prefers one point five to two ATR. Adjust to symbol behavior and personal risk tolerance.
Exits . The script already prints a Close when Fusion cools inside the exit envelope. If you prefer targets you can mirror the entry envelope distance and convert that to points or percent in your own plan.
Position size . Fixed fractional or fixed risk per trade remains a sound baseline. One percent or less per trade is a common starting point for testing.
Sessions and news . Even with self scaling, some traders prefer to skip the first minutes after an open or scheduled news. Gate with your own session logic if needed.
Limitations and honest notes
No look ahead . The script is causal. The adaptive learner uses a shifted correlation, crosses are evaluated without peeking into the future, and no lookahead security calls are used. If you enable intrabar calculations a letter may appear then disappear before the close if the condition fails. This is normal for any cross based logic in real time.
No performance promises . Markets change. This is a decision aid, not a prediction machine. It will not win every sequence and it cannot guarantee statistical outcomes.
No dependence on other indicators . The chart should remain clean. You can add personal tools in private use but publications should keep the example chart readable.
Standard candles only for public signals . Non standard chart types can change event timing and produce unrealistic sequences. Use regular candles for demonstrations and publications.
Internal logic walkthrough
LEGEND feature block
Flow . Current return normalized by ATR then smoothed by a short EMA. This gives directional intent scaled to recent volatility.
Tail pressure with volume mix . The relative sizes of upper and lower wicks inside the high to low range produce a tail asymmetry. A volume based mix can emphasize wick information when volume is meaningful.
Path curvature . Second difference of close normalized by ATR and smoothed. This captures changes in impulse shape that can precede pushes or fades.
Streak persistence . Up and down close streaks are counted and netted. The result is normalized for the window length to keep behavior stable across symbols.
Entropy order . Shannon entropy of the probability of an up close. Lower entropy means more order. The value is oriented by Flow to preserve sign.
Causal weights . Each feature becomes a z score. A shifted correlation against future returns over the horizon produces a positive weight per feature. Weights are normalized so they sum to one for clarity. The result is angle mapped into a compact unit.
IsoPulse block
Effort split . The script estimates up effort and down effort per bar using both body location and wick geometry. Effort is integrated through time into two reservoirs using a forgetting factor.
Skew . The reservoir difference over the sum yields a stable skew in a known range. A short EMA smooths it.
Efficiency . Move size divided by average volume produces travel per unit volume. Normalization and centering around zero produce a symmetric measure.
Bursts and recency . Percent rank of volume highlights bursts. An exponential function of bars since last burst adds the notion of cluster memory.
IsoPulse unit . Skew multiplied by centered efficiency then scaled by the burst factor produces the raw IsoPulse that is angle mapped into the unit range.
Fusion and events
Regime factor . Entropy order and streak persistence form a mixer. Low structure favors IsoPulse. Higher structure favors LEGEND. The blend is convex so it remains interpretable.
Blended guides . Entry and exit guides are blended in the same way as the line so they stay consistent when regimes change. The envelope does not jump unexpectedly.
Virtual position . The script maintains state. Buy and Sell require a cross while flat and gates open. Close requires an exit or force condition while holding. Letters print once at the state change.
Disclosures
This script and description are educational. They do not constitute investment advice. Markets involve risk. You are responsible for your own decisions and for compliance with local rules. The logic is causal and does not look ahead. Signals on non standard chart types can be misleading and are not recommended for publication. When you test a strategy wrapper, use realistic commission and slippage, moderate risk per trade, and enough trades to form a meaningful sample, then document those assumptions if you share results.
Closing thoughts
Clarity builds confidence. The Fusion line gives a single view of intent. The letters communicate action without clutter. The HUD confirms context at a glance. The gates protect you from weak tape and poor liquidity. Tune it to your instrument, observe it across regimes, and use it as a consistent lens rather than a prediction oracle. The goal is not to trade every wiggle. The goal is to pick your spots with a calm process and to stand aside when the tape is not inviting.
HTF Cross Breakout [CHE] HTF Cross Breakout — Detects higher timeframe close crossovers for breakout signals, anchors VWAP for trend validation, and flags continuations or traps with visual extensions for delta percent and stop levels.
Summary
This indicator spots moments when the current chart's close price crosses a higher timeframe close, marking potential breakouts only when the current bar shows directional strength. It anchors a volume-weighted average price line from the breakout point to track trend health, updating labels to show if the move continues or reverses into a trap. Extensions add a dotted line linking the breakout level to the current close with percent change display, plus a stop-loss marker at the VWAP end. Signals gain robustness from higher timeframe confirmation and anti-repainting options, reducing noise in live bars compared to simple crossover tools.
Motivation: Why this design?
Traders often face false breakouts from intrabar wiggles on lower timeframes, especially without higher timeframe alignment, leading to whipsaws in volatile sessions. This design uses higher timeframe close as a stable reference for crossover detection, combined with anchored volume weighting to gauge sustained momentum. It addresses these by enforcing bar confirmation and directional filters, providing clearer entry validation and risk points without overcomplicating the chart.
What’s different vs. standard approaches?
Reference baseline
Standard crossover indicators like moving average crosses operate solely on the chart timeframe, ignoring higher timeframe context and lacking volume anchoring.
Architecture differences
- Higher timeframe data pulls via security calls with optional repainting control for stability.
- Anchored VWAP resets at each signal, accumulating from the breakout bar only.
- Label dynamics update in real-time for continuation checks, with extensions for visual delta and stop computation.
- Event-driven line finalization prunes old elements after a set bar extension.
Practical effect
Charts show persistent lines and labels that extend live but finalize cleanly on new events, avoiding clutter. This matters for spotting trap reversals early via label color shifts, and extensions provide quick risk visuals without manual calculations, improving decision speed in trend trades.
How it works (technical)
The indicator first determines a higher timeframe based on user selection, pulling its close price securely. It checks for crossovers or crossunders of the current close against this higher close, but only triggers on confirmed bars with matching directional opens and closes. On a valid event, a horizontal line and label mark the higher close level, while a dashed VWAP line starts accumulating typical price times volume from that bar onward. During the active phase, the breakout line extends to the current bar, the label repositions and updates text based on whether the current close holds above or below the level for bulls or bears. A background tint warns if the close deviates adversely from the current VWAP. Extensions draw a vertical dotted line at the last bar between the breakout level and close, placing a midpoint label with percent difference; separately, a label at the VWAP end shows a computed stop price. Persistent variables track the active state and accumulators, resetting on new events after briefly extending old elements. Repaint risk from security calls is mitigated by confirmed bar gating or user opt-in.
Parameter Guide
Plateau Length (reserved for future, currently unused): Sets a length for potential plateau detection in extensions; default 3, minimum 1. Higher values would increase stability but are not active yet—leave at default to avoid tuning.
Line Width: Controls thickness of breakout, VWAP, and extension lines; default 2, range 1 to 5. Thicker lines improve visibility on busy charts but may obscure price action—use 1 for clean views, 3 or more for emphasis.
+Bars after next HTF event (finalize old, then delete): Extends old lines and labels by this many bars before deletion on new signals; default 20, minimum 0. Shorter extensions keep charts tidy but risk cutting visuals prematurely; longer aids review but builds clutter over time.
Evaluate label only on HTF close (prevents gray traps intrabar): When true, label updates wait for higher timeframe confirmation; default true. Enabling reduces intrabar flips for stabler signals, though it may delay feedback—disable for faster live trading at repaint cost.
Allow Repainting: Permits real-time security data without confirmation offset; default false. False ensures historical accuracy but lags live bars; true speeds updates but can repaint on HTF closes.
Timeframe Type: Chooses HTF method—Auto Timeframe (dynamic steps up), Multiplier (chart multiple), or Manual (fixed string); default Auto Timeframe. Auto adapts to chart scale for convenience; Multiplier suits custom scaling like 5 times current; Manual for precise like 1D on any chart.
Multiplier for Alternate Resolution: Scales chart timeframe when Multiplier type selected; default 5, minimum 1. Values near 1 mimic current resolution for subtle shifts; higher like 10 jumps to broader context, increasing signal rarity.
Manual Resolution: Direct timeframe string like 60 for 1H when Manual type; default 60. Match to trading horizon—shorter for swing, longer for positional—to balance frequency and reliability.
Show Extension 1: Toggles dotted line and delta percent label between breakout level and current close; default true. Disable to simplify for basic use, enable for precise momentum tracking.
Dotted Line Width: Thickness for Extension 1 line; default 2, range 1 to 5. Align with main Line Width for consistency.
Text Size: Size for delta percent label; options tiny, small, normal, large; default normal. Smaller reduces overlap on dense charts; larger aids glance reads.
Decimals for Δ%: Precision in percent change display; default 2, range 0 to 6. Fewer decimals speed reading; more suit low-volatility assets.
Positive Δ Color: Hue for upward percent changes; default lime. Choose contrasting for visibility.
Negative Δ Color: Hue for downward percent changes; default red. Pair with positive for quick polarity scan.
Dotted Line Color: Color for Extension 1 line; default gray. Neutral tones blend well; brighter for emphasis.
Background Transparency (0..100): Opacity for delta label background; default 90. Higher values fade for subtlety; lower solidifies for readability.
Show Extension 2: Toggles stop-loss label at VWAP end; default true. Turn off for entry focus only.
Stop Method: Percent from VWAP end or fixed ticks; options Percent, Ticks; default Percent. Percent scales with price levels; Ticks suits tick-based instruments.
Stop %: Distance as fraction of VWAP for Percent method; default 1.0, step 0.05, minimum 0.0. Tighter like 0.5 reduces risk but increases stops; wider like 2.0 allows breathing room.
Stop Ticks: Tick count offset for Ticks method; default 20, minimum 0. Adjust per asset volatility—fewer for tight control.
Price Decimals: Rounding for stop price text; default 4, range 0 to 10. Match syminfo.precision for clean display.
Text Size: Size for stop label; options tiny, small, normal, large; default normal. Scale to chart zoom.
Text Color: Foreground for stop text; default white. Ensure contrast with background.
Inherit VWAP Color (BG tint): Bases stop label background on VWAP hue; default true. True maintains theme; false allows custom black base.
BG Transparency (0..100): Opacity for stop label background; default 0. Zero for no tint; up to 100 for full fade.
Reading & Interpretation
Breakout lines appear green for bullish crosses or red for bearish, extending live until a new event finalizes them briefly then deletes. Labels start blank, updating to Bull Cont. or Bear Cont. in matching colors if holding the level, or gray Bull Trap/Bear Trap on reversal. VWAP dashes yellow for bulls, orange for bears, sloping with accumulated volume weight—deviations trigger faint red background warnings. Extension 1's dotted vertical shows at the last bar, with midpoint label green/red for positive/negative percent from breakout to close. Extension 2 places a left-aligned label at VWAP end with stop price and method note, tinted to VWAP for context.
Practical Workflows & Combinations
For trend following, enter long on green Bull Cont. labels above VWAP with higher highs confirmation, filtering via rising structure; short on red Bear Cont. below. Pair with volume surges or RSI above 50 for bulls to avoid traps. For exits, trail stops using the Extension 2 level, tightening on warnings or gray labels—aggressive on continuations, conservative post-trap. In multi-timeframe setups, use default Auto on 15m charts for 1H signals, scaling multiplier to 4 for daily context on hourly; test on forex/stocks where volume is reliable, avoiding low-liquidity assets.
Behavior, Constraints & Performance
Signals confirm on bar close with HTF gating when strict mode active, but live bars may update if repainting enabled—opt false for backtest fidelity, true for intraday speed. Security calls risk minor repaints on HTF closes, mitigated by confirmation offsets. Resources cap at 1000 bars back, 50 lines/labels total, with event prunes to stay under budgets—no loops, minimal arrays. Limits include VWAP lag in low-volume periods and dependency on accurate HTF data; gaps or holidays may skew anchors.
Sensible Defaults & Quick Tuning
Defaults suit 5m-1H charts on liquid assets: Auto HTF, no repaint, 1% stops. For choppy markets with excess signals, enable strict eval and bump multiplier to 10 for rarer triggers. If sluggish in trends, shorten extend bars to 10 and allow repainting for quicker visuals. On high-vol like crypto, widen stop % to 2.0 and use Ticks method; for stables like indices, tighten to 0.5% and keep Percent.
What this indicator is—and isn’t
This is a signal visualization layer for breakout confirmation and basic risk marking, best as a filter in discretionary setups. It isn’t a standalone system or predictive oracle—combine with price structure, news awareness, and sizing rules for real edges.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Lucas' Money GlitchHere's a description you can use to publish your indicator to TradingView:
Title: Triple SuperTrend + RSI + Fib BB + Volume Oscillator
Short Description:
Advanced multi-indicator system combining three SuperTrends, RSI, Fibonacci Bollinger Bands, DEMA filter, and Volume Oscillator for precise trade entry and exit signals.
Full Description:
Overview
This comprehensive trading indicator combines multiple proven technical analysis tools to identify high-probability trade setups with built-in risk management through automated take profit levels.
Key Features
📊 Triple SuperTrend System
Uses three SuperTrend indicators with different ATR periods (10, 11, 12) and multipliers (1.0, 2.0, 3.0)
Requires all three SuperTrends to align before generating signals
Reduces false signals and confirms trend strength
📈 Volume Oscillator Filter
Calculates volume momentum using short and long-term moving averages
Requires volume oscillator to be above 20% threshold for trade entries
Ensures trades only occur during periods of strong volume activity
Displayed as a clean histogram in separate pane (green = bullish, red = bearish)
🎯 RSI Confirmation
7-period RSI must be above 50 for buy signals
RSI must be below 50 for sell signals
Prevents counter-trend entries
🌊 200 DEMA Trend Filter
Double Exponential Moving Average acts as major trend filter
Optional: Only buy above DEMA, only sell below DEMA
Can be toggled on/off based on trading style
📐 Fibonacci Bollinger Bands
Uses 2.618 Fibonacci multiplier (Golden Ratio)
200-period basis
Price touching bands triggers exit signals
Helps identify overextended moves
Entry Signals
BUY Signal (Green Triangle):
All three SuperTrends turn bullish simultaneously
RSI > 50
Price above 200 DEMA (if filter enabled)
Volume Oscillator > 20%
SELL Signal (Red Triangle):
All three SuperTrends turn bearish simultaneously
RSI < 50
Price below 200 DEMA (if filter enabled)
Volume Oscillator > 20%
Exit Signals
Automatic Exits Occur When:
Any of the three SuperTrends changes direction
Price touches Fibonacci Bollinger Band (upper or lower)
Take Profit target is reached (1.5x the distance from entry to ST1)
Exit Labels:
🟠 "TP" = Take Profit hit
🟡 "X" = SuperTrend change or BB touch
Visual Elements
Orange Line: Dynamic take profit level based on SuperTrend distance
Green/Red Lines: Three SuperTrend levels (varying opacity)
Purple Bands: Fibonacci Bollinger Bands with shaded area
Blue Line: 200 DEMA
Background Tint: Green when all bullish, red when all bearish
Volume Histogram: Separate pane showing volume oscillator
Dashboard Display
Real-time information table showing:
Current position status (Long/Short/Flat)
RSI value
Volume Oscillator percentage
Overall trend direction
Alert Conditions
Set up custom alerts for:
Buy signals
Sell signals
Take profit hits
Exit signals
Customizable Parameters
SuperTrend Settings:
Individual ATR periods and multipliers for each SuperTrend
Default: ST1(10,1.0), ST2(11,2.0), ST3(12,3.0)
Volume Oscillator:
Short length (default: 5)
Long length (default: 10)
Threshold percentage (default: 20%)
Toggle filter on/off
Other Filters:
RSI length (default: 7)
DEMA length (default: 200)
Fib BB length and multiplier
Take profit multiplier (default: 1.5x)
Best Use Cases
Trend following strategies
Swing trading
Day trading on higher timeframes (15min+)
Works on all markets: Stocks, Forex, Crypto, Futures
Notes
This is an indicator, not an automated strategy
Signals are for informational purposes only
Always practice proper risk management
Test on historical data before live trading
Works best in trending markets
ATH Levels v4# ATH Levels v4
A powerful indicator for tracking All-Time Highs (ATH) and setting customizable price levels based on percentage drops from the ATH. Perfect for cryptocurrency trading, DCA strategies, and risk management.
## Overview
ATH Levels v4 helps traders visualize key support levels calculated as percentage drops from the All-Time High within a configurable lookback period. The indicator also tracks the All-Time Low (ATL) since the last ATH, providing a complete picture of price range dynamics.
## Key Features
### Configurable Percentage Levels
- Define up to 8 custom price levels as percentage drops from ATH
- No longer limited to fixed 10% intervals
- Each level can be set anywhere from 0% to 100% drop
- Default levels: 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%
### ATL Tracking (NEW in v4)
- Automatically tracks the All-Time Low since the last ATH was reached
- Displays ATL price and percentage drop from ATH
- Resets when a new ATH is detected
- Can be toggled on/off
### Portfolio Management
- Allocate pot size percentages to each level
- Visualize dollar amounts for each level based on your total pot size
- Plan your DCA (Dollar Cost Averaging) strategy
- Only displays levels with allocated pot percentages
### Flexible Display Options
- Show/hide level lines
- Hide ATH level for zooming into lower levels
- Configurable lookback period (default 365 days)
- Adjustable right margin positioning for labels
- Color-coded labels with transparency gradient
## How to Use
### Basic Setup
1. Add the indicator to your chart
2. Set your total pot size in dollars
3. Configure the percentage drops for each level (where you want to buy/accumulate)
4. Allocate pot size percentages to each level
### Example DCA Strategy
```
Total Pot Size: $10,000
Level 3 (-30%): 10% pot = $1,000
Level 4 (-40%): 20% pot = $2,000
Level 5 (-50%): 25% pot = $2,500
Level 6 (-60%): 30% pot = $3,000
Level 7 (-70%): 10% pot = $1,000
Level 8 (-80%): 5% pot = $500
```
## Settings
### Display Options
- **Show level lines**: Toggle horizontal lines on/off
- **Hide ATH level**: Hide the ATH label for cleaner charts
- **Show ATL since last ATH**: Display/hide the All-Time Low indicator
- **Days to Lookback**: Period for calculating ATH (default: 365)
- **Margin from last bar**: Spacing between chart and labels (default: 10)
### Level Configuration
- **Level 1-8 % drop from ATH**: Set custom percentage drops (0-100%)
- **Level 1-8 pot %**: Allocate your portfolio percentage to each level (0-100%)
**Note**: Levels only display if they have a pot percentage allocated (>0%)
### Pot Size
- **Pot size**: Total amount in dollars available for the strategy
## Version History
### V4 (October 2025)
- Upgraded to PineScript v6
- Configurable percentage drops from ATH (no longer hardcoded)
- ATL tracking and display since last ATH
- Updated syntax and functions for v6 compatibility
### V3 (May 2020)
- Added option to hide ATH level for better chart zoom
### V2
- Hide/show level lines
- Configurable lookback period
- Configurable right margin
- Only shows levels with pot size % set
### V1
- Initial release with 8 fixed levels
## Use Cases
### Cryptocurrency Trading
- Plan accumulation zones during bear markets
- Set alerts at key percentage drops from ATH
- Track historical ATH and ATL ranges
### Risk Management
- Visualize potential support zones
- Plan position sizing at different levels
- Monitor distance from ATH in real-time
### DCA Strategies
- Automate dollar-cost averaging planning
- Allocate budget across multiple price levels
- Track execution of your DCA plan
## Technical Details
- **Version**: PineScript v6
- **Type**: Indicator
- **Overlay**: Yes
- **Default Timeframe**: Works on all timeframes
- **Calculations**: Based on closing prices within lookback period
## Credits
Original concept inspired by daytask. Enhanced and maintained by SilvesterScorpion.com
## License
This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
---
**Tip**: For best results, use on higher timeframes (4H, Daily, Weekly) to identify major support zones. Combine with volume analysis and other indicators for confirmation.
Triple SuperTrend + RSI + Fib BBTriple SuperTrend + RSI + Fibonacci Bollinger Bands Strategy
📊 Overview
This advanced trading strategy combines the power of three SuperTrend indicators with RSI confirmation and Fibonacci Bollinger Bands to generate high-probability trade signals. The strategy is designed to capture strong trending moves while filtering out false signals through multi-indicator confluence.
🔧 Core Components
Three SuperTrend Indicators
The strategy uses three SuperTrend indicators with progressively longer periods and multipliers:
SuperTrend 1: 10-period ATR, 1.0 multiplier (fastest, most sensitive)
SuperTrend 2: 11-period ATR, 2.0 multiplier (medium sensitivity)
SuperTrend 3: 12-period ATR, 3.0 multiplier (slowest, most stable)
This layered approach ensures that all three timeframe perspectives align before generating a signal, significantly reducing false entries.
RSI Confirmation (7-period)
The Relative Strength Index acts as a momentum filter:
Long signals require RSI > 50 (bullish momentum)
Short signals require RSI < 50 (bearish momentum)
This prevents entries during weak or divergent price action.
Fibonacci Bollinger Bands (200, 2.618)
Uses a 200-period Simple Moving Average with 2.618 standard deviation bands (Fibonacci ratio). These bands serve dual purposes:
Visual representation of price extremes
Automatic exit trigger when price reaches overextended levels
📈 Entry Logic
LONG Entry (BUY Signal)
A LONG position is opened when ALL of the following conditions are met simultaneously:
All three SuperTrend indicators turn green (bullish)
RSI(7) is above 50
This is the first bar where all conditions align (no repainting)
SHORT Entry (SELL Signal)
A SHORT position is opened when ALL of the following conditions are met simultaneously:
All three SuperTrend indicators turn red (bearish)
RSI(7) is below 50
This is the first bar where all conditions align (no repainting)
🚪 Exit Logic
Positions are automatically closed when ANY of these conditions occur:
SuperTrend Color Change: Any one of the three SuperTrend indicators changes direction
Fibonacci BB Touch: Price reaches or exceeds the upper or lower Fibonacci Bollinger Band (2.618 standard deviations)
This dual-exit approach protects profits by:
Exiting quickly when trend momentum shifts (SuperTrend change)
Taking profits at statistical price extremes (Fib BB touch)
🎨 Visual Features
Signal Arrows
Green Up Arrow (BUY): Appears below the bar when long entry conditions are met
Red Down Arrow (SELL): Appears above the bar when short entry conditions are met
Yellow Down Arrow (EXIT): Appears above the bar when exit conditions are met
Background Coloring
Light Green Tint: All three SuperTrends are bullish (uptrend environment)
Light Red Tint: All three SuperTrends are bearish (downtrend environment)
SuperTrend Lines
Three colored lines plotted with varying opacity:
Solid line (ST1): Most responsive to price changes
Semi-transparent (ST2): Medium-term trend
Most transparent (ST3): Long-term trend structure
Dashboard
Real-time information panel showing:
Individual SuperTrend status (UP/DOWN)
Current RSI value and color-coded status
Current position (LONG/SHORT/FLAT)
Net Profit/Loss
⚙️ Customizable Parameters
SuperTrend Settings
ATR periods for each SuperTrend (default: 10, 11, 12)
Multipliers for each SuperTrend (default: 1.0, 2.0, 3.0)
RSI Settings
RSI length (default: 7)
RSI source (default: close)
Fibonacci Bollinger Bands
BB length (default: 200)
BB multiplier (default: 2.618)
Strategy Options
Enable/disable long trades
Enable/disable short trades
Initial capital
Position sizing
Commission settings
💡 Strategy Philosophy
This strategy is built on the principle of confluence trading - waiting for multiple independent indicators to align before taking a position. By requiring three SuperTrend indicators AND RSI confirmation, the strategy filters out the majority of low-probability setups.
The multi-timeframe SuperTrend approach ensures that short-term, medium-term, and longer-term trends are all in agreement, which typically occurs during strong, sustainable price moves.
The exit strategy is equally important, using both trend-following logic (SuperTrend changes) and mean-reversion logic (Fibonacci BB touches) to adapt to different market conditions.
📊 Best Use Cases
Trending Markets: Works best in markets with clear directional bias
Higher Timeframes: Designed for 15-minute to daily charts
Volatile Assets: SuperTrend indicators excel in assets with clear trends
Swing Trading: Hold times typically range from hours to days
⚠️ Important Notes
No Repainting: All signals are confirmed and will not change on historical bars
One Signal Per Setup: The strategy prevents duplicate signals on consecutive bars
Exit Protection: Always exits before potentially taking an opposite position
Visual Clarity: All three SuperTrend lines are visible simultaneously for transparency
🎯 Recommended Settings
While default parameters are optimized for general use, consider:
Crypto/Volatile Markets: May benefit from slightly higher multipliers
Forex: Default settings work well for major pairs
Stocks: Consider longer BB periods (250-300) for daily charts
Lower Timeframes: Reduce all periods proportionally for scalping
📝 Alerts
Built-in alert conditions for:
BUY signal triggered
SELL signal triggered
EXIT signal triggered
Set up notifications to never miss a trade opportunity!
Disclaimer: This strategy is for educational and informational purposes only. Past performance does not guarantee future results. Always backtest thoroughly and practice proper risk management before live trading.
Relative Strength Index Remastered [CHE]Relative Strength Index Remastered — Enhanced RSI with robust divergence detection using price-based pivots and line-of-sight validation to reduce false signals compared to the standard RSI indicator.
Summary
RSI Remastered builds on the classic Relative Strength Index by adding a more reliable divergence detection system that relies on price pivots rather than RSI pivots alone, incorporating a line-of-sight check to ensure the RSI path between points remains clear. This approach filters out many false divergences that occur in the original RSI indicator due to its volatile pivot detection on the RSI line itself. Users benefit from clearer reversal and continuation signals, especially in noisy markets, with optional hidden divergence support for trend confirmation. The core RSI calculation and smoothing options remain familiar, but the divergence logic provides materially fewer alerts while maintaining sensitivity.
Motivation: Why this design?
The standard RSI indicator often generates misleading divergence signals because it detects pivots directly on the RSI values, which can fluctuate erratically in volatile conditions, leading to frequent false positives that confuse traders during ranging or choppy price action. RSI Remastered addresses this by shifting pivot detection to the underlying price highs and lows, which are more stable, and adding a validation step that confirms the RSI line does not cross the direct path between pivot points. This design targets the real problem of over-signaling in the original, promoting more actionable insights without altering the RSI's core momentum measurement.
What’s different vs. standard approaches?
- Reference baseline: The classical TradingView RSI indicator, which uses simple RSI-based pivot detection for divergences.
- Architecture differences:
- Pivot identification on price extremes (highs and lows) instead of RSI values, extracting RSI levels at those points for comparison.
- Addition of a line-of-sight validation that checks the RSI path bar by bar between pivots to prevent signals where the line is interrupted.
- Inclusion of hidden divergence types alongside regular ones, using the same robust framework.
- Configurable drawing of connecting lines between validated pivot RSI points for visual clarity.
- Practical effect: Charts show fewer but higher-quality divergence markers and lines, reducing clutter from the original's frequent RSI pivot triggers; this matters for avoiding whipsaws in intraday trading, where the standard version might flag dozens of invalid setups per session.
Key Comparison Aspects
Aspect: Title/Shorttitle
Original RSI: "Relative Strength Index" / "RSI"
Robust Variant: "Relative Strength Index Remastered " / "RSI RM"
Aspect: Max. Lines/Labels
Original RSI: No specification (Standard: 50/50)
Robust Variant: max_lines_count=200, max_labels_count=200 (for more lines/markers in divergences)
Aspect: RSI Calculation & Plots
Original RSI: Identical: RSI with RMA, Plots (line, bands, gradient fills)
Robust Variant: Identical: RSI with RMA, Plots (line, bands, gradient fills)
Aspect: Smoothing (MA)
Original RSI: Identical: Inputs for MA types (SMA, EMA etc.), Bollinger Bands optional
Robust Variant: Identical: Inputs for MA types (SMA, EMA etc.), Bollinger Bands optional
Aspect: Divergence Activation
Original RSI: input.bool(false, "Calculate Divergence") (disabled by default)
Robust Variant: input.bool(true, "Calculate Divergence") (enabled by default, with tooltip)
Aspect: Pivot Calculation
Original RSI: Pivots on RSI (ta.pivotlow/high on RSI values)
Robust Variant: Pivots on price (ta.pivotlow/high on low/high), RSI values then extracted
Aspect: Lookback Values
Original RSI: Fixed: lookbackLeft=5, lookbackRight=5
Robust Variant: Input: L=5 (Pivot Left), R=5 (Pivot Right), adjustable (min=1, max=50)
Aspect: Range Between Pivots
Original RSI: Fixed: rangeUpper=60, rangeLower=5 (via _inRange function)
Robust Variant: Input: rangeUpper=60 (Max Bars), rangeLower=5 (Min Bars), adjustable (min=1–6, max=100–300)
Aspect: Divergence Types
Original RSI: Only Regular Bullish/Bearish: - Bull: Price LL + RSI HL - Bear: Price HH + RSI LH
Robust Variant: Regular + Hidden (optional via showHidden=true): - Regular Bull: Price LL + RSI HL - Regular Bear: Price HH + RSI LH - Hidden Bull: Price HL + RSI LL - Hidden Bear: Price LH + RSI HH
Aspect: Validation
Original RSI: No additional check (only pivot + range check)
Robust Variant: Line-of-Sight Check: RSI line must not cross the connecting line between pivots (line_clear function with slope calculation and loop for each bar in between)
Aspect: Signals (Plots/Shapes)
Original RSI: - Plot of pivot points (if divergence) - Shapes: "Bull"/"Bear" at RSI value, offset=-5
Robust Variant: - No pivot plots, instead shapes at RSI , offset=-R (adjustable) - Shapes: "Bull"/"Bear" (Regular), "HBull"/"HBear" (Hidden) - Colors: Lime/Red (Regular), Teal/Orange (Hidden)
Aspect: Line Drawing
Original RSI: No lines
Robust Variant: Optional (showLines=true): Lines between RSI pivots (thick for regular, dashed/thin for hidden), extend=none
Aspect: Alerts
Original RSI: Only Regular Bullish/Bearish (with pivot lookback reference)
Robust Variant: Regular Bullish/Bearish + Hidden Bullish/Bearish (specific "at latest pivot low/high")
Aspect: Robustness
Original RSI: Simple, prone to false signals (RSI pivots can be volatile)
Robust Variant: Higher: Price pivots are more stable, line-of-sight filters "broken" divergences, hidden support for trend continuations
Aspect: Code Length/Structure
Original RSI: ~100 lines, simple if-blocks for bull/bear
Robust Variant: ~150 lines, extended helper functions (e.g., inRange, line_clear), var group for inputs
How it works (technical)
The indicator first computes the core RSI value based on recent price changes, separating upward and downward movements over the specified length and smoothing them to derive a momentum reading scaled between zero and one hundred. This value is then plotted in a separate pane with fixed upper and lower reference lines at seventy and thirty, along with optional gradient fills to highlight overbought and oversold zones.
For smoothing, a moving average type is applied to the RSI if enabled, with an option to add bands around it based on the variability of recent RSI values scaled by a multiplier. Divergence detection activates on confirmed price pivots: lows for bullish checks and highs for bearish. At each new pivot, the system retrieves the bar index and values (price and RSI) for the current and prior pivot, ensuring they fall within a configurable bar range to avoid unrelated points.
Comparisons then assess whether the price has made a lower low (or higher high) while the RSI at those points moves in the opposite direction—higher for bullish regular, lower for bearish regular. For hidden types, the directions reverse to capture trend strength. The line-of-sight check calculates the straight path between the two RSI points and verifies that the actual RSI values in between stay entirely above (for bullish) or below (for bearish) that path, breaking the signal if any bar violates it. Valid signals trigger shapes at the RSI level of the new pivot and optional lines connecting the points. Initialization uses built-in functions to track prior occurrences, with states persisting across bars for accurate historical comparisons. No higher timeframe data is used, so confirmation occurs after the right pivot bars close, minimizing live-bar repaints.
Parameter Guide
Length — Controls the period for measuring price momentum changes — Default: 14 — Trade-offs/Tips: Shorter values increase responsiveness but add noise and more false signals; longer smooths trends but delays entries in fast markets.
Source — Selects the price input for RSI calculation — Default: Close — Trade-offs/Tips: Use high or low for volatility focus, but close works best for most assets; mismatches can skew overbought/oversold reads.
Calculate Divergence — Enables the enhanced divergence logic — Default: True — Trade-offs/Tips: Disable for pure RSI view to save computation; essential for signal reliability over the standard method.
Type (Smoothing) — Chooses the moving average applied to RSI — Default: SMA — Trade-offs/Tips: None for raw RSI; EMA for quicker adaptation, but SMA reduces whipsaws; Bollinger Bands option adds volatility context at cost of added lines.
Length (Smoothing) — Period for the smoothing average — Default: 14 — Trade-offs/Tips: Match RSI length for consistency; shorter boosts signal speed but amplifies noise in the smoothed line.
BB StdDev — Multiplier for band width around smoothed RSI — Default: 2.0 — Trade-offs/Tips: Lower narrows bands for tighter signals, risking more touches; higher widens for fewer but stronger breakouts.
Pivot Left — Bars to the left for confirming price pivots — Default: 5 — Trade-offs/Tips: Increase for stricter pivots in noisy data, reducing signals; too high delays confirmation excessively.
Pivot Right — Bars to the right for confirming price pivots — Default: 5 — Trade-offs/Tips: Balances with left for symmetry; longer right ensures maturity but shifts signals backward.
Max Bars Between Pivots — Upper limit on distance for valid pivot pairs — Default: 60 — Trade-offs/Tips: Tighten for short-term trades to focus recent action; widen for swing setups but risks unrelated comparisons.
Min Bars Between Pivots — Lower limit to avoid clustered pivots — Default: 5 — Trade-offs/Tips: Raise to filter micro-moves; too low invites overlapping signals like the original RSI.
Detect Hidden — Includes trend-continuation hidden types — Default: True — Trade-offs/Tips: Enable for full trend analysis; disable simplifies to reversals only, akin to basic RSI.
Draw Lines — Shows connecting lines between valid pivots — Default: True — Trade-offs/Tips: Turn off for cleaner charts; helps visually confirm line-of-sight in backtests.
Reading & Interpretation
The main RSI line oscillates between zero and one hundred, crossing above fifty suggesting building momentum and below indicating weakness; touches near seventy or thirty flag potential extremes. The optional smoothed line and bands provide a filtered view—price above the upper band on the RSI pane hints at overextension. Divergence shapes appear as upward labels for bullish (lime for regular, teal for hidden) and downward for bearish (red regular, orange hidden) at the pivot's RSI level, signaling a mismatch only after validation. Connecting lines, if drawn, slope between points without RSI interference, their color matching the shape type; a dashed style denotes hidden. Fewer shapes overall compared to the standard RSI mean higher conviction, but always confirm with price structure.
Practical Workflows & Combinations
- Trend following: Enter longs on regular bullish shapes near support with higher highs in price; filter hidden bullish for pullback buys in uptrends, pairing with a rising smoothed RSI above fifty.
- Exits/Stops: Use bearish regular as reversal warnings to tighten stops; hidden bearish in downtrends confirms continuation—exit if lines show RSI crossing the path.
- Multi-asset/Multi-TF: Defaults suit forex and stocks on one-hour charts; for crypto volatility, widen pivot ranges to ten; scale min/max bars proportionally on daily for swings, avoiding the original's intraday spam.
Behavior, Constraints & Performance
Signals confirm only after the right pivot bars close, so live bars may show tentative pivots that vanish on close, unlike the standard RSI's immediate RSI-pivot triggers—plan for this delay in automation. No higher timeframe calls, so no security-related repaints. Resources include up to two hundred lines and labels for dense charts, with a loop in validation scanning up to three hundred bars between pivots, which is efficient but could slow on very long histories. Known limits: Slight lag at pivot confirmation in trending markets; volatile RSI might rarely miss fine path violations; not ideal for gap-heavy assets where pivots skip.
Sensible Defaults & Quick Tuning
Start with defaults for balanced momentum and divergence on most timeframes. For too many signals (like the original), raise pivot left/right to eight and min bars to ten to filter noise. If sluggish in trends, shorten RSI length to nine and enable EMA smoothing for faster adaptation. In high-volatility assets, widen max bars to one hundred but disable hidden to focus essentials. For clean reversal hunts, set smoothing to none and lines on.
What this indicator is—and isn’t
RSI Remastered serves as a refined momentum and divergence visualization tool, enhancing the standard RSI for better signal quality in technical analysis setups. It is not a standalone trading system, nor does it predict price moves—pair it with volume, structure breaks, and risk rules for decisions. Use alongside position sizing and broader context, not in isolation.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Enhanced Holt-Winters RSI [BOSWaves]Enhanced Holt-Winters RSI – Next-Level Momentum Smoothing & Signal Precision
Overview
The Enhanced Holt-Winters RSI transforms the classic Relative Strength Index into a robust, lag-minimized momentum oscillator through Holt-Winters triple exponential smoothing. By modeling the level, trend, and cyclical behavior of the RSI series, this indicator delivers smoother, more responsive signals that highlight overbought/oversold conditions, momentum shifts, and high-conviction trading setups without cluttering the chart with noise.
Unlike traditional RSI, which reacts to historical data and produces frequent whipsaws, the Enhanced Holt-Winters RSI filters transient price fluctuations, enabling traders to detect emerging momentum and potential reversal zones earlier.
Theoretical Foundation
The traditional RSI measures relative strength by comparing average gains and losses, but suffers from:
Lag in trend recognition : Signals often arrive after momentum has shifted.
Noise sensitivity : High-frequency price movements generate unreliable crossovers.
Limited insight into structural market shifts : Standard RSI cannot contextualize cyclical or momentum patterns.
The Enhanced Holt-Winters RSI addresses these limitations by applying triple exponential smoothing directly to the RSI series. This decomposes the series into:
Level (Lₜ) : Represents the smoothed central tendency of RSI.
Trend (Tₜ) : Captures rate-of-change in smoothed momentum.
Seasonal Component (Sₜ) : Models short-term cyclical deviations in momentum.
By incorporating these elements, the oscillator produces smoothed RSI values that react faster to emerging trends while suppressing erratic noise. Its internal forecast is mathematical, influencing the smoothed RSI output and signals, rather than being directly plotted.
How It Works
The Enhanced Holt-Winters RSI builds its signal framework through several layers:
1. Base RSI Calculation
Computes standard RSI over the selected period as the primary momentum input.
2. Triple Exponential Smoothing (Holt-Winters)
The RSI is smoothed recursively to extract underlying momentum structure:
Level, trend, and seasonal components are combined to produce a smoothed RSI.
This internal smoothing reduces lag and enhances signal reliability.
3. Momentum Analysis
Short-term momentum shifts are tracked via a moving average of the smoothed RSI, highlighting acceleration or deceleration in directional strength.
4. Volume Confirmation (Optional)
Buy/sell signals can be filtered through a configurable volume threshold, ensuring only high-conviction moves trigger alerts.
5. Visual Output
Colored Candles : Represent overbought (red), oversold (green), or neutral (yellow) conditions.
Oscillator Panel : Plots the smoothed RSI with dynamic color coding for immediate trend context.
Signals : Triangular markers indicate bullish or bearish setups, with stronger signals flagged in extreme zones.
Interpretation
The Enhanced Holt-Winters RSI provides a multi-dimensional perspective on price action:
Trend Strength : Smoothed RSI slope and color coding reflect the direction and momentum intensity.
Momentum Shifts : Rapid changes in the smoothed RSI indicate emerging strength or weakness.
Overbought/Oversold Zones : Highlight areas where price is stretched relative to recent momentum.
High-Conviction Signals : Combined with volume filtering, markers indicate optimal entries/exits.
Cycle Awareness : Smoothing reveals structural patterns, helping traders avoid reacting to noise.
By combining these elements, traders gain early insight into market structure and momentum without relying on raw, lag-prone RSI data.
Strategy Integration
The Enhanced Holt-Winters RSI can be applied across trading styles:
Trend Following
Enter when RSI is aligned with price momentum and color-coded signals confirm trend direction.
Strong slope in the smoothed RSI signals trend continuation.
Reversal Trading
Look for RSI extremes with momentum shifts and strong signal markers.
Compression in oscillator values often precedes reversal setups.
Breakout Detection
Oscillator flattening in neutral zones followed by directional expansion indicates potential breakout conditions.
Multi-Timeframe Confluence
Higher timeframes provide directional bias; lower timeframes refine entry timing using smoothed RSI dynamics.
Technical Implementation Details
Input Source : Close, open, high, low, or price.
Smoothing : Holt-Winters triple exponential smoothing applied to RSI.
Parameters :
Level (α) : Controls smoothing of RSI.
Trend (β) : Adjusts responsiveness to momentum changes.
Seasonal Length : Defines cycles for short-term adjustments.
Delta Smoothing : Reduces choppiness in smoothed RSI difference.
Outputs :
Smoothed RSI
Colored candles and oscillator panel
Buy/Sell signal markers (with optional strength filtering)
Volume Filtering : Optional threshold to confirm signals.
Optimal Application Parameters
Asset-Specific Guidance:
Forex : Use moderate smoothing (α, β) to capture medium-term momentum swings while filtering minor price noise. Works best when combined with volume or volatility filters.
Equities : Balance responsiveness and smoothness to identify sustained sector momentum or rotational shifts; ideal for capturing clean directional transitions.
Cryptocurrency : Increase smoothing parameters slightly to stabilize RSI during extreme volatility; optional volume confirmation can help filter false signals.
Futures/Indices : Lower smoothing sensitivity emphasizes macro momentum and structural trend durability over short-term fluctuations.
Timeframe Optimization:
Scalping (1-5m) : Use higher sensitivity (lower smoothing factors) to react quickly to micro-momentum reversals.
Intraday (15m-1h) : Balance smoothing and responsiveness for detecting short-term acceleration and exhaustion zones.
Swing (4h-Daily) : Apply moderate smoothing to reveal underlying directional persistence and cyclical reversals.
Position (Daily-Weekly) : Use stronger smoothing to isolate dominant momentum trends and filter temporary pullbacks.
Integration Guidelines
Combine with trend filters (EMAs, SuperSmoother MA, ATR-based tools) for confirmation.
Use volume and signal strength markers to filter low-conviction trades.
Slope, color, and signal alignment can guide entry, stop placement, and scaling.
Disclaimer
The Enhanced Holt-Winters RSI is a technical analysis tool, not a guaranteed profit system. Effectiveness depends on proper settings, market structure, and disciplined risk management. Always backtest before live trading.
Squeeze Hour Frequency [CHE]Squeeze Hour Frequency (ATR-PR) — Standalone — Tracks daily squeeze occurrences by hour to reveal time-based volatility patterns
Summary
This indicator identifies periods of unusually low volatility, defined as squeezes, and tallies their frequency across each hour of the day over historical trading sessions. By aggregating counts into a sortable table, it helps users spot hours prone to these conditions, enabling better scheduling of trading activity to avoid or target specific intraday regimes. Signals gain robustness through percentile-based detection that adapts to recent volatility history, differing from fixed-threshold methods by focusing on relative lowness rather than absolute levels, which reduces false positives in varying market environments.
Motivation: Why this design?
Traders often face uneven intraday volatility, with certain hours showing clustered low-activity phases that precede or follow breakouts, leading to mistimed entries or overlooked calm periods. The core idea of hourly squeeze frequency addresses this by binning low-volatility events into 24 hourly slots and counting distinct daily occurrences, providing a historical profile of when squeezes cluster. This reveals time-of-day biases without relying on real-time alerts, allowing proactive adjustments to session focus.
What’s different vs. standard approaches?
- Reference baseline: Classical volatility tools like simple moving average crossovers or fixed ATR thresholds, which flag squeezes uniformly across the day.
- Architecture differences:
- Uses persistent arrays to track one squeeze per hour per day, preventing overcounting within sessions.
- Employs custom sorting on ratio arrays for dynamic table display, prioritizing top or bottom performers.
- Handles timezones explicitly to ensure consistent binning across global assets.
- Practical effect: Charts show a persistent table ranking hours by squeeze share, making intraday patterns immediately visible—such as a top hour capturing over 20 percent of total events—unlike static overlays that ignore temporal distribution, which matters for avoiding low-liquidity traps in crypto or forex.
How it works (technical)
The indicator first computes a rolling volatility measure over a specified lookback period. It then derives a relative ranking of the current value against recent history within a window of bars. A squeeze is flagged when this ranking falls below a user-defined cutoff, indicating the value is among the lowest in the recent sample.
On each bar, the local hour is extracted using the selected timezone. If a squeeze occurs and the bar has price data, the count for that hour increments only if no prior mark exists for the current day, using a persistent array to store the last marked day per hour. This ensures one tally per unique trading day per slot.
At the final bar, arrays compile counts and ratios for all 24 hours, where the ratio represents each hour's share of total squeezes observed. These are sorted ascending or descending based on display mode, and the top or bottom subset populates the table. Background shading highlights live squeezes in red for visual confirmation. Initialization uses zero-filled arrays for counts and negative seeds for day tracking, with state persisting across bars via variable declarations.
No higher timeframe data is pulled, so there is no repaint risk from external fetches; all logic runs on confirmed bars.
Parameter Guide
ATR Length — Controls the lookback for the volatility measure, influencing sensitivity to short-term fluctuations; shorter values increase responsiveness but add noise, longer ones smooth for stability — Default: 14 — Trade-offs/Tips: Use 10-20 for intraday charts to balance quick detection with fewer false squeezes; test on historical data to avoid over-smoothing in trending markets.
Percentile Window (bars) — Sets the history depth for ranking the current volatility value, affecting how "low" is defined relative to past; wider windows emphasize long-term norms — Default: 252 — Trade-offs/Tips: 100-300 bars suit daily cycles; narrower for fast assets like crypto to catch recent regimes, but risks instability in sparse data.
Squeeze threshold (PR < x) — Defines the cutoff for flagging low relative volatility, where values below this mark a squeeze; lower thresholds tighten detection for rarer events — Default: 10.0 — Trade-offs/Tips: 5-15 percent for conservative signals reducing false positives; raise to 20 for more frequent highlights in high-vol environments, monitoring for increased noise.
Timezone — Specifies the reference for hourly binning, ensuring alignment with market sessions — Default: Exchange — Trade-offs/Tips: Set to "America/New_York" for US assets; mismatches can skew counts, so verify against chart timezone.
Show Table — Toggles the results display, essential for reviewing frequencies — Default: true — Trade-offs/Tips: Disable on mobile for performance; pair with position tweaks for clean overlays.
Pos — Places the table on the chart pane — Default: Top Right — Trade-offs/Tips: Bottom Left avoids candle occlusion on volatile charts.
Font — Adjusts text readability in the table — Default: normal — Trade-offs/Tips: Tiny for dense views, large for emphasis on key hours.
Dark — Applies high-contrast colors for visibility — Default: true — Trade-offs/Tips: Toggle false in light themes to prevent washout.
Display — Filters table rows to focus on extremes or full list — Default: All — Trade-offs/Tips: Top 3 for quick scans of risky hours; Bottom 3 highlights safe low-squeeze periods.
Reading & Interpretation
Red background shading appears on bars meeting the squeeze condition, signaling current low relative volatility. The table lists hours as "H0" to "H23", with columns for daily squeeze counts, percentage share of total squeezes (summing to 100 percent across hours), and an arrow marker on the top hour. A summary row above details the peak count, its share, and the leading hour. A label at the last bar recaps total days observed, data-valid days, and top hour stats. Rising shares indicate clustering, suggesting regime persistence in that slot.
Practical Workflows & Combinations
- Trend following: Scan for hours with low squeeze shares to enter during stable regimes; confirm with higher highs or lower lows on the 15-minute chart, avoiding top-share hours post-news like tariff announcements.
- Exits/Stops: Tighten stops in high-share hours to guard against sudden vol spikes; use the table to shift to conservative sizing outside peak squeeze times.
- Multi-asset/Multi-TF: Defaults work across crypto pairs on 5-60 minute timeframes; for stocks, widen percentile window to 500 bars. Combine with volume oscillators—enter only if squeeze count is below average for the asset.
Behavior, Constraints & Performance
Logic executes on closed bars, with live bars updating counts provisionally but finalizing on confirmation; table refreshes only at the last bar, avoiding intrabar flicker. No security calls or higher timeframes, so no repaint from external data. Resources include a 5000-bar history limit, loops up to 24 iterations for sorting and totals, and arrays sized to 24 elements; labels and table are capped at 500 each for efficiency. Known limits: Skips hours without bars (e.g., weekends), assumes uniform data availability, and may undercount in sparse sessions; timezone shifts can alter profiles without warning.
Sensible Defaults & Quick Tuning
Start with ATR Length at 14, Percentile Window at 252, and threshold at 10.0 for broad crypto use. If too many squeezes flag (noisy table), raise threshold to 15.0 and narrow window to 100 for stricter relative lowness. For sluggish detection in calm markets, drop ATR Length to 10 and threshold to 5.0 to capture subtler dips. In high-vol assets, widen window to 500 and threshold to 20.0 for stability.
What this indicator is—and isn’t
This is a historical frequency tracker and visualization layer for intraday volatility patterns, best as a filter in multi-tool setups. It is not a standalone signal generator, predictive model, or risk manager—pair it with price action, news filters, and position sizing rules.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Thanks to Duyck
for the ma sorter
Volume BubblesVolume Bubbles Indicator
Introduction
The Volume Bubbles indicator is a powerful tool designed to visually highlight significant volume spikes on your TradingView charts. It helps traders identify potential areas of whale accumulation (large buying activity) or dumping (large selling activity) by displaying colored bubbles on candles where volume exceeds a customizable threshold. Green bubbles indicate bullish (buy) volume on up candles, suggesting possible accumulation, while red bubbles signal bearish (sell) volume on down candles, indicating potential dumping. The bubble size scales with the volume magnitude, making it easy to spot major market moves at a glance.
This indicator is particularly useful for crypto, forex, and stock traders looking to gauge market sentiment and large player involvement without cluttering the chart. It's built in Pine Script v5 and overlays directly on your price action.
How It Works
The indicator calculates a moving average of volume (default: 20-period SMA) and detects spikes when current volume exceeds this average by a multiplier (default: 2x).
Buy Bubbles (Green): Appear on bullish candles (close >= open) at the low wick, representing potential whale buying or accumulation zones.
Sell Bubbles (Red): Appear on bearish candles (close < open) at the high wick, indicating potential whale selling or dumping zones.
Bubble Size: Dynamically sized based on volume thresholds – huge for >1M, large for 500K-1M, normal for <500K.
Transparency: Increases with volume ratio for better visibility on extreme spikes.
Tooltip:
Hover over a bubble to see detailed info like total volume, average volume, and ratio.
By focusing on these high-volume events, traders can spot key support/resistance levels where whales might be active.
How to Use for Whale Accumulation and Dumping
Whales (large holders) often move markets with high-volume trades. This indicator helps spot them:
Accumulation (Buying): Look for clusters of large green bubbles at price lows or during consolidations. This suggests whales are buying dips, potentially signaling a reversal or uptrend start. Combine with support levels for confirmation.
Dumping (Selling): Watch for big red bubbles at price highs or after rallies. This indicates whales unloading positions, which could lead to downtrends or corrections. Pair with resistance levels.
Tips:
Use on higher timeframes (e.g., 1H+) for reliable signals.
Confirm with other indicators like RSI or MACD to avoid false positives.
In trending markets, buy bubbles in uptrends confirm strength; sell bubbles in downtrends signal continuation.
Credits and Disclaimer
Inspired by volume analysis techniques. This is free to use; feedback welcome! Not financial advice – trade at your own risk.
ALMASTO – Pro Trend & Momentum (v1.1)ALMASTO — Pro Trend & Momentum Strategy
Description:
This strategy is designed for precision trading in both Forex (FX) and Crypto markets.
It combines multi-timeframe trend confirmation (EMA200), momentum filters (RSI, MACD, ADX), and ATR-based dynamic risk management.
ALMASTO — Pro Trend & Momentum Strategy automatically manages take-profit levels, stop-loss, and breakeven adjustments once TP1 is reached — providing a structured and emotion-free trading approach.
Optimal Use
Works best on lower timeframes (5m–15m) with strong liquidity sessions.
Optimized for pairs like EURUSD, XAUUSD, and BTCUSDT.
Built for trend-following setups and momentum reversals with high volatility confirmation.
Recommended Settings
🔹 Forex – 5m
EMA Fast = 34, EMA Slow = 200, HTF = 1H
RSI (14): Long ≥ 55 / Short ≤ 45
MACD (8 / 21 / 5), ADX Len 10 / Min 27
ATR Len 7, Stop Loss = ATR × 2.1
TP1 = 1.1 RR, TP2 = 2.3 RR
Session = 07:00–11:00 & 12:30–16:00 (Exchange Time)
Risk = 0.8% per trade
🔹 Forex – 15m
EMA Fast = 50, EMA Slow = 200, HTF = 4H
RSI (14): Long ≥ 53 / Short ≤ 47
MACD (12 / 26 / 9), ADX Min 24
ATR Len 10, SL = ATR × 1.9
TP1 = 1.2 RR, TP2 = 2.6 RR
Risk = 1.0% per trade
🔹 Crypto – 5m (BTC/USDT)
EMA Fast = 34, EMA Slow = 200, HTF = 4H
RSI (14): Long ≥ 56 / Short ≤ 44
MACD (8 / 21 / 5), ADX Min 30
ATR Len 7, SL = ATR × 2.2
TP1 = 1.0 RR, TP2 = 2.5 RR
Session = 00:00–06:00 & 12:00–22:00 (UTC)
Risk = 0.5% per trade
Core Features
✅ Auto breakeven after TP1
✅ Dual take-profit system (1:1 & 1:2 RR)
✅ ATR-based stop & trailing logic
✅ Filters for session time, volume, and volatility
✅ Candle-body vs ATR size filter to avoid noise
✅ Optional cooldown between trades
Important Notes
Use bar close confirmation only (barstate.isconfirmed) to avoid repainting on lower timeframes.
Adjust commission (0.01–0.03%) and slippage (1–2 ticks) in Strategy Tester for realistic results.
Avoid low-liquidity hours (after 21:00 UTC for FX / after midnight for crypto).
Backtest using realistic broker data (e.g., BlackBull Markets / Bybit / Binance Futures).
Best results occur during London & New York sessions with moderate volatility.
⚠️ Disclaimer
This script is for educational and research purposes only.
It does not constitute financial advice.
Use proper risk management and test thoroughly before using on live accounts.
Developed by KING FX Labs
Built and optimized by Yousef Almasto — combining advanced price-action logic, multi-timeframe EMA structure, and volatility-adaptive ATR management.
Tested across Forex, Gold, and Crypto markets to ensure consistent performance and minimal drawdown.
📈 “Precision Trading. Zero Emotion. Pure Momentum.”
Keltner Channel Enhanced [DCAUT]█ Keltner Channel Enhanced
📊 ORIGINALITY & INNOVATION
The Keltner Channel Enhanced represents an important advancement over standard Keltner Channel implementations by introducing dual flexibility in moving average selection for both the middle band and ATR calculation. While traditional Keltner Channels typically use EMA for the middle band and RMA (Wilder's smoothing) for ATR, this enhanced version provides access to 25+ moving average algorithms for both components, enabling traders to fine-tune the indicator's behavior to match specific market characteristics and trading approaches.
Key Advancements:
Dual MA Algorithm Flexibility: Independent selection of moving average types for middle band (25+ options) and ATR smoothing (25+ options), allowing optimization of both trend identification and volatility measurement separately
Enhanced Trend Sensitivity: Ability to use faster algorithms (HMA, T3) for middle band while maintaining stable volatility measurement with traditional ATR smoothing, or vice versa for different trading strategies
Adaptive Volatility Measurement: Choice of ATR smoothing algorithm affects channel responsiveness to volatility changes, from highly reactive (SMA, EMA) to smoothly adaptive (RMA, TEMA)
Comprehensive Alert System: Five distinct alert conditions covering breakouts, trend changes, and volatility expansion, enabling automated monitoring without constant chart observation
Multi-Timeframe Compatibility: Works effectively across all timeframes from intraday scalping to long-term position trading, with independent optimization of trend and volatility components
This implementation addresses key limitations of standard Keltner Channels: fixed EMA/RMA combination may not suit all market conditions or trading styles. By decoupling the trend component from volatility measurement and allowing independent algorithm selection, traders can create highly customized configurations for specific instruments and market phases.
📐 MATHEMATICAL FOUNDATION
Keltner Channel Enhanced uses a three-component calculation system that combines a flexible moving average middle band with ATR-based (Average True Range) upper and lower channels, creating volatility-adjusted trend-following bands.
Core Calculation Process:
1. Middle Band (Basis) Calculation:
The basis line is calculated using the selected moving average algorithm applied to the price source over the specified period:
basis = ma(source, length, maType)
Supported algorithms include EMA (standard choice, trend-biased), SMA (balanced and symmetric), HMA (reduced lag), WMA, VWMA, TEMA, T3, KAMA, and 17+ others.
2. Average True Range (ATR) Calculation:
ATR measures market volatility by calculating the average of true ranges over the specified period:
trueRange = max(high - low, abs(high - close ), abs(low - close ))
atrValue = ma(trueRange, atrLength, atrMaType)
ATR smoothing algorithm significantly affects channel behavior, with options including RMA (standard, very smooth), SMA (moderate smoothness), EMA (fast adaptation), TEMA (smooth yet responsive), and others.
3. Channel Calculation:
Upper and lower channels are positioned at specified multiples of ATR from the basis:
upperChannel = basis + (multiplier × atrValue)
lowerChannel = basis - (multiplier × atrValue)
Standard multiplier is 2.0, providing channels that dynamically adjust width based on market volatility.
Keltner Channel vs. Bollinger Bands - Key Differences:
While both indicators create volatility-based channels, they use fundamentally different volatility measures:
Keltner Channel (ATR-based):
Uses Average True Range to measure actual price movement volatility
Incorporates gaps and limit moves through true range calculation
More stable in trending markets, less prone to extreme compression
Better reflects intraday volatility and trading range
Typically fewer band touches, making touches more significant
More suitable for trend-following strategies
Bollinger Bands (Standard Deviation-based):
Uses statistical standard deviation to measure price dispersion
Based on closing prices only, doesn't account for intraday range
Can compress significantly during consolidation (squeeze patterns)
More touches in ranging markets
Better suited for mean-reversion strategies
Provides statistical probability framework (95% within 2 standard deviations)
Algorithm Combination Effects:
The interaction between middle band MA type and ATR MA type creates different indicator characteristics:
Trend-Focused Configuration (Fast MA + Slow ATR): Middle band uses HMA/EMA/T3, ATR uses RMA/TEMA, quick trend changes with stable channel width, suitable for trend-following
Volatility-Focused Configuration (Slow MA + Fast ATR): Middle band uses SMA/WMA, ATR uses EMA/SMA, stable trend with dynamic channel width, suitable for volatility trading
Balanced Configuration (Standard EMA/RMA): Classic Keltner Channel behavior, time-tested combination, suitable for general-purpose trend following
Adaptive Configuration (KAMA + KAMA): Self-adjusting indicator responding to efficiency ratio, suitable for markets with varying trend strength and volatility regimes
📊 COMPREHENSIVE SIGNAL ANALYSIS
Keltner Channel Enhanced provides multiple signal categories optimized for trend-following and breakout strategies.
Channel Position Signals:
Upper Channel Interaction:
Price Touching Upper Channel: Strong bullish momentum, price moving more than typical volatility range suggests, potential continuation signal in established uptrends
Price Breaking Above Upper Channel: Exceptional strength, price exceeding normal volatility expectations, consider adding to long positions or tightening trailing stops
Price Riding Upper Channel: Sustained strong uptrend, characteristic of powerful bull moves, stay with trend and avoid premature profit-taking
Price Rejection at Upper Channel: Momentum exhaustion signal, consider profit-taking on longs or waiting for pullback to middle band for reentry
Lower Channel Interaction:
Price Touching Lower Channel: Strong bearish momentum, price moving more than typical volatility range suggests, potential continuation signal in established downtrends
Price Breaking Below Lower Channel: Exceptional weakness, price exceeding normal volatility expectations, consider adding to short positions or protecting against further downside
Price Riding Lower Channel: Sustained strong downtrend, characteristic of powerful bear moves, stay with trend and avoid premature covering
Price Rejection at Lower Channel: Momentum exhaustion signal, consider covering shorts or waiting for bounce to middle band for reentry
Middle Band (Basis) Signals:
Trend Direction Confirmation:
Price Above Basis: Bullish trend bias, middle band acts as dynamic support in uptrends, consider long positions or holding existing longs
Price Below Basis: Bearish trend bias, middle band acts as dynamic resistance in downtrends, consider short positions or avoiding longs
Price Crossing Above Basis: Potential trend change from bearish to bullish, early signal to establish long positions
Price Crossing Below Basis: Potential trend change from bullish to bearish, early signal to establish short positions or exit longs
Pullback Trading Strategy:
Uptrend Pullback: Price pulls back from upper channel to middle band, finds support, and resumes upward, ideal long entry point
Downtrend Bounce: Price bounces from lower channel to middle band, meets resistance, and resumes downward, ideal short entry point
Basis Test: Strong trends often show price respecting the middle band as support/resistance on pullbacks
Failed Test: Price breaking through middle band against trend direction signals potential reversal
Volatility-Based Signals:
Narrow Channels (Low Volatility):
Consolidation Phase: Channels contract during periods of reduced volatility and directionless price action
Breakout Preparation: Narrow channels often precede significant directional moves as volatility cycles
Trading Approach: Reduce position sizes, wait for breakout confirmation, avoid range-bound strategies within channels
Breakout Direction: Monitor for price breaking decisively outside channel range with expanding width
Wide Channels (High Volatility):
Trending Phase: Channels expand during strong directional moves and increased volatility
Momentum Confirmation: Wide channels confirm genuine trend with substantial volatility backing
Trading Approach: Trend-following strategies excel, wider stops necessary, mean-reversion strategies risky
Exhaustion Signs: Extreme channel width (historical highs) may signal approaching consolidation or reversal
Advanced Pattern Recognition:
Channel Walking Pattern:
Upper Channel Walk: Price consistently touches or exceeds upper channel while staying above basis, very strong uptrend signal, hold longs aggressively
Lower Channel Walk: Price consistently touches or exceeds lower channel while staying below basis, very strong downtrend signal, hold shorts aggressively
Basis Support/Resistance: During channel walks, price typically uses middle band as support/resistance on minor pullbacks
Pattern Break: Price crossing basis during channel walk signals potential trend exhaustion
Squeeze and Release Pattern:
Squeeze Phase: Channels narrow significantly, price consolidates near middle band, volatility contracts
Direction Clues: Watch for price positioning relative to basis during squeeze (above = bullish bias, below = bearish bias)
Release Trigger: Price breaking outside narrow channel range with expanding width confirms breakout
Follow-Through: Measure squeeze height and project from breakout point for initial profit targets
Channel Expansion Pattern:
Breakout Confirmation: Rapid channel widening confirms volatility increase and genuine trend establishment
Entry Timing: Enter positions early in expansion phase before trend becomes overextended
Risk Management: Use channel width to size stops appropriately, wider channels require wider stops
Basis Bounce Pattern:
Clean Bounce: Price touches middle band and immediately reverses, confirms trend strength and entry opportunity
Multiple Bounces: Repeated basis bounces indicate strong, sustainable trend
Bounce Failure: Price penetrating basis signals weakening trend and potential reversal
Divergence Analysis:
Price/Channel Divergence: Price makes new high/low while staying within channel (not reaching outer band), suggests momentum weakening
Width/Price Divergence: Price breaks to new extremes but channel width contracts, suggests move lacks conviction
Reversal Signal: Divergences often precede trend reversals or significant consolidation periods
Multi-Timeframe Analysis:
Keltner Channels work particularly well in multi-timeframe trend-following approaches:
Three-Timeframe Alignment:
Higher Timeframe (Weekly/Daily): Identify major trend direction, note price position relative to basis and channels
Intermediate Timeframe (Daily/4H): Identify pullback opportunities within higher timeframe trend
Lower Timeframe (4H/1H): Time precise entries when price touches middle band or lower channel (in uptrends) with rejection
Optimal Entry Conditions:
Best Long Entries: Higher timeframe in uptrend (price above basis), intermediate timeframe pulls back to basis, lower timeframe shows rejection at middle band or lower channel
Best Short Entries: Higher timeframe in downtrend (price below basis), intermediate timeframe bounces to basis, lower timeframe shows rejection at middle band or upper channel
Risk Management: Use higher timeframe channel width to set position sizing, stops below/above higher timeframe channels
🎯 STRATEGIC APPLICATIONS
Keltner Channel Enhanced excels in trend-following and breakout strategies across different market conditions.
Trend Following Strategy:
Setup Requirements:
Identify established trend with price consistently on one side of basis line
Wait for pullback to middle band (basis) or brief penetration through it
Confirm trend resumption with price rejection at basis and move back toward outer channel
Enter in trend direction with stop beyond basis line
Entry Rules:
Uptrend Entry:
Price pulls back from upper channel to middle band, shows support at basis (bullish candlestick, momentum divergence)
Enter long on rejection/bounce from basis with stop 1-2 ATR below basis
Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
Downtrend Entry:
Price bounces from lower channel to middle band, shows resistance at basis (bearish candlestick, momentum divergence)
Enter short on rejection/reversal from basis with stop 1-2 ATR above basis
Aggressive: Enter on first touch; Conservative: Wait for confirmation candle
Trend Management:
Trailing Stop: Use basis line as dynamic trailing stop, exit if price closes beyond basis against position
Profit Taking: Take partial profits at opposite channel, move stops to basis
Position Additions: Add to winners on subsequent basis bounces if trend intact
Breakout Strategy:
Setup Requirements:
Identify consolidation period with contracting channel width
Monitor price action near middle band with reduced volatility
Wait for decisive breakout beyond channel range with expanding width
Enter in breakout direction after confirmation
Breakout Confirmation:
Price breaks clearly outside channel (upper for longs, lower for shorts), channel width begins expanding from contracted state
Volume increases significantly on breakout (if using volume analysis)
Price sustains outside channel for multiple bars without immediate reversal
Entry Approaches:
Aggressive: Enter on initial break with stop at opposite channel or basis, use smaller position size
Conservative: Wait for pullback to broken channel level, enter on rejection and resumption, tighter stop
Volatility-Based Position Sizing:
Adjust position sizing based on channel width (ATR-based volatility):
Wide Channels (High ATR): Reduce position size as stops must be wider, calculate position size using ATR-based risk calculation: Risk / (Stop Distance in ATR × ATR Value)
Narrow Channels (Low ATR): Increase position size as stops can be tighter, be cautious of impending volatility expansion
ATR-Based Risk Management: Use ATR-based risk calculations, position size = 0.01 × Capital / (2 × ATR), use multiples of ATR (1-2 ATR) for adaptive stops
Algorithm Selection Guidelines:
Different market conditions benefit from different algorithm combinations:
Strong Trending Markets: Middle band use EMA or HMA, ATR use RMA, capture trends quickly while maintaining stable channel width
Choppy/Ranging Markets: Middle band use SMA or WMA, ATR use SMA or WMA, avoid false trend signals while identifying genuine reversals
Volatile Markets: Middle band and ATR both use KAMA or FRAMA, self-adjusting to changing market conditions reduces manual optimization
Breakout Trading: Middle band use SMA, ATR use EMA or SMA, stable trend with dynamic channels highlights volatility expansion early
Scalping/Day Trading: Middle band use HMA or T3, ATR use EMA or TEMA, both components respond quickly
Position Trading: Middle band use EMA/TEMA/T3, ATR use RMA or TEMA, filter out noise for long-term trend-following
📋 DETAILED PARAMETER CONFIGURATION
Understanding and optimizing parameters is essential for adapting Keltner Channel Enhanced to specific trading approaches.
Source Parameter:
Close (Most Common): Uses closing price, reflects daily settlement, best for end-of-day analysis and position trading, standard choice
HL2 (Median Price): Smooths out closing bias, better represents full daily range in volatile markets, good for swing trading
HLC3 (Typical Price): Gives more weight to close while including full range, popular for intraday applications, slightly more responsive than HL2
OHLC4 (Average Price): Most comprehensive price representation, smoothest option, good for gap-prone markets or highly volatile instruments
Length Parameter:
Controls the lookback period for middle band (basis) calculation:
Short Periods (10-15): Very responsive to price changes, suitable for day trading and scalping, higher false signal rate
Standard Period (20 - Default): Represents approximately one month of trading, good balance between responsiveness and stability, suitable for swing and position trading
Medium Periods (30-50): Smoother trend identification, fewer false signals, better for position trading and longer holding periods
Long Periods (50+): Very smooth, identifies major trends only, minimal false signals but significant lag, suitable for long-term investment
Optimization by Timeframe: 1-15 minute charts use 10-20 period, 30-60 minute charts use 20-30 period, 4-hour to daily charts use 20-40 period, weekly charts use 20-30 weeks.
ATR Length Parameter:
Controls the lookback period for Average True Range calculation, affecting channel width:
Short ATR Periods (5-10): Very responsive to recent volatility changes, standard is 10 (Keltner's original specification), may be too reactive in whipsaw conditions
Standard ATR Period (10 - Default): Chester Keltner's original specification, good balance between responsiveness and stability, most widely used
Medium ATR Periods (14-20): Smoother channel width, ATR 14 aligns with Wilder's original ATR specification, good for position trading
Long ATR Periods (20+): Very smooth channel width, suitable for long-term trend-following
Length vs. ATR Length Relationship: Equal values (20/20) provide balanced responsiveness, longer ATR (20/14) gives more stable channel width, shorter ATR (20/10) is standard configuration, much shorter ATR (20/5) creates very dynamic channels.
Multiplier Parameter:
Controls channel width by setting ATR multiples:
Lower Values (1.0-1.5): Tighter channels with frequent price touches, more trading signals, higher false signal rate, better for range-bound and mean-reversion strategies
Standard Value (2.0 - Default): Chester Keltner's recommended setting, good balance between signal frequency and reliability, suitable for both trending and ranging strategies
Higher Values (2.5-3.0): Wider channels with less frequent touches, fewer but potentially higher-quality signals, better for strong trending markets
Market-Specific Optimization: High volatility markets (crypto, small-caps) use 2.5-3.0 multiplier, medium volatility markets (major forex, large-caps) use 2.0 multiplier, low volatility markets (bonds, utilities) use 1.5-2.0 multiplier.
MA Type Parameter (Middle Band):
Critical selection that determines trend identification characteristics:
EMA (Exponential Moving Average - Default): Standard Keltner Channel choice, Chester Keltner's original specification, emphasizes recent prices, faster response to trend changes, suitable for all timeframes
SMA (Simple Moving Average): Equal weighting of all data points, no directional bias, slower than EMA, better for ranging markets and mean-reversion
HMA (Hull Moving Average): Minimal lag with smooth output, excellent for fast trend identification, best for day trading and scalping
TEMA (Triple Exponential Moving Average): Advanced smoothing with reduced lag, responsive to trends while filtering noise, suitable for volatile markets
T3 (Tillson T3): Very smooth with minimal lag, excellent for established trend identification, suitable for position trading
KAMA (Kaufman Adaptive Moving Average): Automatically adjusts speed based on market efficiency, slow in ranging markets, fast in trends, suitable for markets with varying conditions
ATR MA Type Parameter:
Determines how Average True Range is smoothed, affecting channel width stability:
RMA (Wilder's Smoothing - Default): J. Welles Wilder's original ATR smoothing method, very smooth, slow to adapt to volatility changes, provides stable channel width
SMA (Simple Moving Average): Equal weighting, moderate smoothness, faster response to volatility changes than RMA, more dynamic channel width
EMA (Exponential Moving Average): Emphasizes recent volatility, quick adaptation to new volatility regimes, very responsive channel width changes
TEMA (Triple Exponential Moving Average): Smooth yet responsive, good balance for varying volatility, suitable for most trading styles
Parameter Combination Strategies:
Conservative Trend-Following: Length 30/ATR Length 20/Multiplier 2.5, MA Type EMA or TEMA/ATR MA Type RMA, smooth trend with stable wide channels, suitable for position trading
Standard Balanced Approach: Length 20/ATR Length 10/Multiplier 2.0, MA Type EMA/ATR MA Type RMA, classic Keltner Channel configuration, suitable for general purpose swing trading
Aggressive Day Trading: Length 10-15/ATR Length 5-7/Multiplier 1.5-2.0, MA Type HMA or EMA/ATR MA Type EMA or SMA, fast trend with dynamic channels, suitable for scalping and day trading
Breakout Specialist: Length 20-30/ATR Length 5-10/Multiplier 2.0, MA Type SMA or WMA/ATR MA Type EMA or SMA, stable trend with responsive channel width
Adaptive All-Conditions: Length 20/ATR Length 10/Multiplier 2.0, MA Type KAMA or FRAMA/ATR MA Type KAMA or TEMA, self-adjusting to market conditions
Offset Parameter:
Controls horizontal positioning of channels on chart. Positive values shift channels to the right (future) for visual projection, negative values shift left (past) for historical analysis, zero (default) aligns with current price bars for real-time signal analysis. Offset affects only visual display, not alert conditions or actual calculations.
📈 PERFORMANCE ANALYSIS & COMPETITIVE ADVANTAGES
Keltner Channel Enhanced provides improvements over standard implementations while maintaining proven effectiveness.
Response Characteristics:
Standard EMA/RMA Configuration: Moderate trend lag (approximately 0.4 × length periods), smooth and stable channel width from RMA smoothing, good balance for most market conditions
Fast HMA/EMA Configuration: Approximately 60% reduction in trend lag compared to EMA, responsive channel width from EMA ATR smoothing, suitable for quick trend changes and breakouts
Adaptive KAMA/KAMA Configuration: Variable lag based on market efficiency, automatic adjustment to trending vs. ranging conditions, self-optimizing behavior reduces manual intervention
Comparison with Traditional Keltner Channels:
Enhanced Version Advantages:
Dual Algorithm Flexibility: Independent MA selection for trend and volatility vs. fixed EMA/RMA, separate tuning of trend responsiveness and channel stability
Market Adaptation: Choose configurations optimized for specific instruments and conditions, customize for scalping, swing, or position trading preferences
Comprehensive Alerts: Enhanced alert system including channel expansion detection
Traditional Version Advantages:
Simplicity: Fewer parameters, easier to understand and implement
Standardization: Fixed EMA/RMA combination ensures consistency across users
Research Base: Decades of backtesting and research on standard configuration
When to Use Enhanced Version: Trading multiple instruments with different characteristics, switching between trending and ranging markets, employing different strategies, algorithm-based trading systems requiring customization, seeking optimization for specific trading style and timeframe.
When to Use Standard Version: Beginning traders learning Keltner Channel concepts, following published research or trading systems, preferring simplicity and standardization, wanting to avoid optimization and curve-fitting risks.
Performance Across Market Conditions:
Strong Trending Markets: EMA or HMA basis with RMA or TEMA ATR smoothing provides quicker trend identification, pullbacks to basis offer excellent entry opportunities
Choppy/Ranging Markets: SMA or WMA basis with RMA ATR smoothing and lower multipliers, channel bounce strategies work well, avoid false breakouts
Volatile Markets: KAMA or FRAMA with EMA or TEMA, adaptive algorithms excel by automatic adjustment, wider multipliers (2.5-3.0) accommodate large price swings
Low Volatility/Consolidation: Channels narrow significantly indicating consolidation, algorithm choice less impactful, focus on detecting channel width contraction for breakout preparation
Keltner Channel vs. Bollinger Bands - Usage Comparison:
Favor Keltner Channels When: Trend-following is primary strategy, trading volatile instruments with gaps, want ATR-based volatility measurement, prefer fewer higher-quality channel touches, seeking stable channel width during trends.
Favor Bollinger Bands When: Mean-reversion is primary strategy, trading instruments with limited gaps, want statistical framework based on standard deviation, need squeeze patterns for breakout identification, prefer more frequent trading opportunities.
Use Both Together: Bollinger Band squeeze + Keltner Channel breakout is powerful combination, price outside Bollinger Bands but inside Keltner Channels indicates moderate signal, price outside both indicates very strong signal, Bollinger Bands for entries and Keltner Channels for trend confirmation.
Limitations and Considerations:
General Limitations:
Lagging Indicator: All moving averages lag price, even with reduced-lag algorithms
Trend-Dependent: Works best in trending markets, less effective in choppy conditions
No Direction Prediction: Indicates volatility and deviation, not future direction, requires confirmation
Enhanced Version Specific Considerations:
Optimization Risk: More parameters increase risk of curve-fitting historical data
Complexity: Additional choices may overwhelm beginning traders
Backtesting Challenges: Different algorithms produce different historical results
Mitigation Strategies:
Use Confirmation: Combine with momentum indicators (RSI, MACD), volume, or price action
Test Parameter Robustness: Ensure parameters work across range of values, not just optimized ones
Multi-Timeframe Analysis: Confirm signals across different timeframes
Proper Risk Management: Use appropriate position sizing and stops
Start Simple: Begin with standard EMA/RMA before exploring alternatives
Optimal Usage Recommendations:
For Maximum Effectiveness:
Start with standard EMA/RMA configuration to understand classic behavior
Experiment with alternatives on demo account or paper trading
Match algorithm combination to market condition and trading style
Use channel width analysis to identify market phases
Combine with complementary indicators for confirmation
Implement strict risk management using ATR-based position sizing
Focus on high-quality setups rather than trading every signal
Respect the trend: trade with basis direction for higher probability
Complementary Indicators:
RSI or Stochastic: Confirm momentum at channel extremes
MACD: Confirm trend direction and momentum shifts
Volume: Validate breakouts and trend strength
ADX: Measure trend strength, avoid Keltner signals in weak trends
Support/Resistance: Combine with traditional levels for high-probability setups
Bollinger Bands: Use together for enhanced breakout and volatility analysis
USAGE NOTES
This indicator is designed for technical analysis and educational purposes. Keltner Channel Enhanced has limitations and should not be used as the sole basis for trading decisions. While the flexible moving average selection for both trend and volatility components provides valuable adaptability across different market conditions, algorithm performance varies with market conditions, and past characteristics do not guarantee future results.
Key considerations:
Always use multiple forms of analysis and confirmation before entering trades
Backtest any parameter combination thoroughly before live trading
Be aware that optimization can lead to curve-fitting if not done carefully
Start with standard EMA/RMA settings and adjust only when specific conditions warrant
Understand that no moving average algorithm can eliminate lag entirely
Consider market regime (trending, ranging, volatile) when selecting parameters
Use ATR-based position sizing and risk management on every trade
Keltner Channels work best in trending markets, less effective in choppy conditions
Respect the trend direction indicated by price position relative to basis line
The enhanced flexibility of dual algorithm selection provides powerful tools for adaptation but requires responsible use, thorough understanding of how different algorithms behave under various market conditions, and disciplined risk management.
JK_Traders_Reality_LibLibrary "JK_Traders_Reality_Lib"
This library contains common elements used in Traders Reality scripts
calcPvsra(pvsraVolume, pvsraHigh, pvsraLow, pvsraClose, pvsraOpen, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor, darkGreyCandleColor, lightGrayCandleColor)
calculate the pvsra candle color and return the color as well as an alert if a vector candle has apperared.
Situation "Climax"
Bars with volume >= 200% of the average volume of the 10 previous chart TFs, or bars
where the product of candle spread x candle volume is >= the highest for the 10 previous
chart time TFs.
Default Colors: Bull bars are green and bear bars are red.
Situation "Volume Rising Above Average"
Bars with volume >= 150% of the average volume of the 10 previous chart TFs.
Default Colors: Bull bars are blue and bear are violet.
Parameters:
pvsraVolume (float) : the instrument volume series (obtained from request.sequrity)
pvsraHigh (float) : the instrument high series (obtained from request.sequrity)
pvsraLow (float) : the instrument low series (obtained from request.sequrity)
pvsraClose (float) : the instrument close series (obtained from request.sequrity)
pvsraOpen (float) : the instrument open series (obtained from request.sequrity)
redVectorColor (simple color) : red vector candle color
greenVectorColor (simple color) : green vector candle color
violetVectorColor (simple color) : violet/pink vector candle color
blueVectorColor (simple color) : blue vector candle color
darkGreyCandleColor (simple color) : regular volume candle down candle color - not a vector
lightGrayCandleColor (simple color) : regular volume candle up candle color - not a vector
@return
adr(length, barsBack)
Parameters:
length (simple int) : how many elements of the series to calculate on
barsBack (simple int) : starting possition for the length calculation - current bar or some other value eg last bar
@return adr the adr for the specified lenght
adrHigh(adr, fromDo)
Calculate the ADR high given an ADR
Parameters:
adr (float) : the adr
fromDo (simple bool) : boolean flag, if false calculate traditional adr from high low of today, if true calcualte from exchange midnight
@return adrHigh the position of the adr high in price
adrLow(adr, fromDo)
Parameters:
adr (float) : the adr
fromDo (simple bool) : boolean flag, if false calculate traditional adr from high low of today, if true calcualte from exchange midnight
@return adrLow the position of the adr low in price
splitSessionString(sessXTime)
given a session in the format 0000-0100:23456 split out the hours and minutes
Parameters:
sessXTime (simple string) : the session time string usually in the format 0000-0100:23456
@return
calcSessionStartEnd(sessXTime, gmt)
calculate the start and end timestamps of the session
Parameters:
sessXTime (simple string) : the session time string usually in the format 0000-0100:23456
gmt (simple string) : the gmt offset string usually in the format GMT+1 or GMT+2 etc
@return
drawOpenRange(sessXTime, sessXcol, showOrX, gmt)
draw open range for a session
Parameters:
sessXTime (simple string) : session string in the format 0000-0100:23456
sessXcol (simple color) : the color to be used for the opening range box shading
showOrX (simple bool) : boolean flag to toggle displaying the opening range
gmt (simple string) : the gmt offset string usually in the format GMT+1 or GMT+2 etc
@return void
drawSessionHiLo(sessXTime, showRectangleX, showLabelX, sessXcolLabel, sessXLabel, gmt, sessionLineStyle)
Parameters:
sessXTime (simple string) : session string in the format 0000-0100:23456
showRectangleX (simple bool)
showLabelX (simple bool)
sessXcolLabel (simple color) : the color to be used for the hi/low lines and label
sessXLabel (simple string) : the session label text
gmt (simple string) : the gmt offset string usually in the format GMT+1 or GMT+2 etc
sessionLineStyle (simple string) : the line stile for the session high low lines
@return void
calcDst()
calculate market session dst on/off flags
@return indicating if DST is on or off for a particular region
timestampPreviousDayOfWeek(previousDayOfWeek, hourOfDay, gmtOffset, oneWeekMillis)
Timestamp any of the 6 previous days in the week (such as last Wednesday at 21 hours GMT)
Parameters:
previousDayOfWeek (simple string) : Monday or Satruday
hourOfDay (simple int) : the hour of the day when psy calc is to start
gmtOffset (simple string) : the gmt offset string usually in the format GMT+1 or GMT+2 etc
oneWeekMillis (simple int) : the amount if time for a week in milliseconds
@return the timestamp of the psy level calculation start time
getdayOpen()
get the daily open - basically exchange midnight
@return the daily open value which is float price
newBar(res)
new_bar: check if we're on a new bar within the session in a given resolution
Parameters:
res (simple string) : the desired resolution
@return true/false is a new bar for the session has started
toPips(val)
to_pips Convert value to pips
Parameters:
val (float) : the value to convert to pips
@return the value in pips
rLabel(ry, rtext, rstyle, rcolor, valid, labelXOffset)
a function that draws a right aligned lable for a series during the current bar
Parameters:
ry (float) : series float the y coordinate of the lable
rtext (simple string) : the text of the label
rstyle (simple string) : the style for the lable
rcolor (simple color) : the color for the label
valid (simple bool) : a boolean flag that allows for turning on or off a lable
labelXOffset (int) : how much to offset the label from the current position
rLabelOffset(ry, rtext, rstyle, rcolor, valid, labelOffset)
a function that draws a right aligned lable for a series during the current bar
Parameters:
ry (float) : series float the y coordinate of the lable
rtext (string) : the text of the label
rstyle (simple string) : the style for the lable
rcolor (simple color) : the color for the label
valid (simple bool) : a boolean flag that allows for turning on or off a lable
labelOffset (int)
rLabelLastBar(ry, rtext, rstyle, rcolor, valid, labelXOffset)
a function that draws a right aligned lable for a series only on the last bar
Parameters:
ry (float) : series float the y coordinate of the lable
rtext (string) : the text of the label
rstyle (simple string) : the style for the lable
rcolor (simple color) : the color for the label
valid (simple bool) : a boolean flag that allows for turning on or off a lable
labelXOffset (int) : how much to offset the label from the current position
drawLine(xSeries, res, tag, xColor, xStyle, xWidth, xExtend, isLabelValid, xLabelOffset, validTimeFrame)
a function that draws a line and a label for a series
Parameters:
xSeries (float) : series float the y coordinate of the line/label
res (simple string) : the desired resolution controlling when a new line will start
tag (simple string) : the text for the lable
xColor (simple color) : the color for the label
xStyle (simple string) : the style for the line
xWidth (simple int) : the width of the line
xExtend (simple string) : extend the line
isLabelValid (simple bool) : a boolean flag that allows for turning on or off a label
xLabelOffset (int)
validTimeFrame (simple bool) : a boolean flag that allows for turning on or off a line drawn
drawLineDO(xSeries, res, tag, xColor, xStyle, xWidth, xExtend, isLabelValid, xLabelOffset, validTimeFrame)
a function that draws a line and a label for the daily open series
Parameters:
xSeries (float) : series float the y coordinate of the line/label
res (simple string) : the desired resolution controlling when a new line will start
tag (simple string) : the text for the lable
xColor (simple color) : the color for the label
xStyle (simple string) : the style for the line
xWidth (simple int) : the width of the line
xExtend (simple string) : extend the line
isLabelValid (simple bool) : a boolean flag that allows for turning on or off a label
xLabelOffset (int)
validTimeFrame (simple bool) : a boolean flag that allows for turning on or off a line drawn
drawPivot(pivotLevel, res, tag, pivotColor, pivotLabelColor, pivotStyle, pivotWidth, pivotExtend, isLabelValid, validTimeFrame, levelStart, pivotLabelXOffset)
draw a pivot line - the line starts one day into the past
Parameters:
pivotLevel (float) : series of the pivot point
res (simple string) : the desired resolution
tag (simple string) : the text to appear
pivotColor (simple color) : the color of the line
pivotLabelColor (simple color) : the color of the label
pivotStyle (simple string) : the line style
pivotWidth (simple int) : the line width
pivotExtend (simple string) : extend the line
isLabelValid (simple bool) : boolean param allows to turn label on and off
validTimeFrame (simple bool) : only draw the line and label at a valid timeframe
levelStart (int) : basically when to start drawing the levels
pivotLabelXOffset (int) : how much to offset the label from its current postion
@return the pivot line series
getPvsraFlagByColor(pvsraColor, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor, lightGrayCandleColor)
convert the pvsra color to an internal code
Parameters:
pvsraColor (color) : the calculated pvsra color
redVectorColor (simple color) : the user defined red vector color
greenVectorColor (simple color) : the user defined green vector color
violetVectorColor (simple color) : the user defined violet vector color
blueVectorColor (simple color) : the user defined blue vector color
lightGrayCandleColor (simple color) : the user defined regular up candle color
@return pvsra internal code
updateZones(pvsra, direction, boxArr, maxlevels, pvsraHigh, pvsraLow, pvsraOpen, pvsraClose, transperancy, zoneupdatetype, zonecolor, zonetype, borderwidth, coloroverride, redVectorColor, greenVectorColor, violetVectorColor, blueVectorColor)
a function that draws the unrecovered vector candle zones
Parameters:
pvsra (int) : internal code
direction (simple int) : above or below the current pa
boxArr (array) : the array containing the boxes that need to be updated
maxlevels (simple int) : the maximum number of boxes to draw
pvsraHigh (float) : the pvsra high value series
pvsraLow (float) : the pvsra low value series
pvsraOpen (float) : the pvsra open value series
pvsraClose (float) : the pvsra close value series
transperancy (simple int) : the transparencfy of the vecor candle zones
zoneupdatetype (simple string) : the zone update type
zonecolor (simple color) : the zone color if overriden
zonetype (simple string) : the zone type
borderwidth (simple int) : the width of the border
coloroverride (simple bool) : if the color overriden
redVectorColor (simple color) : the user defined red vector color
greenVectorColor (simple color) : the user defined green vector color
violetVectorColor (simple color) : the user defined violet vector color
blueVectorColor (simple color) : the user defined blue vector color
cleanarr(arr)
clean an array from na values
Parameters:
arr (array) : the array to clean
@return if the array was cleaned
calcPsyLevels(oneWeekMillis, showPsylevels, psyType, sydDST)
calculate the psy levels
4 hour res based on how mt4 does it
mt4 code
int Li_4 = iBarShift(NULL, PERIOD_H4, iTime(NULL, PERIOD_W1, Li_0)) - 2 - Offset;
ObjectCreate("PsychHi", OBJ_TREND, 0, Time , iHigh(NULL, PERIOD_H4, iHighest(NULL, PERIOD_H4, MODE_HIGH, 2, Li_4)), iTime(NULL, PERIOD_W1, 0), iHigh(NULL, PERIOD_H4,
iHighest(NULL, PERIOD_H4, MODE_HIGH, 2, Li_4)));
so basically because the session is 8 hours and we are looking at a 4 hour resolution we only need to take the highest high an lowest low of 2 bars
we use the gmt offset to adjust the 0000-0800 session to Sydney open which is at 2100 during dst and at 2200 otherwize. (dst - spring foward, fall back)
keep in mind sydney is in the souther hemisphere so dst is oposite of when london and new york go into dst
Parameters:
oneWeekMillis (simple int) : a constant value
showPsylevels (simple bool) : should psy levels be calculated
psyType (simple string) : the type of Psylevels - crypto or forex
sydDST (bool) : is Sydney in DST
@return
adrHiLo(length, barsBack, fromDO)
Parameters:
length (simple int) : how many elements of the series to calculate on
barsBack (simple int) : starting possition for the length calculation - current bar or some other value eg last bar
fromDO (simple bool) : boolean flag, if false calculate traditional adr from high low of today, if true calcualte from exchange midnight
@return adr, adrLow and adrHigh - the adr, the position of the adr High and adr Low with respect to price
drawSessionHiloLite(sessXTime, showRectangleX, showLabelX, sessXcolLabel, sessXLabel, gmt, sessionLineStyle, sessXcol)
Parameters:
sessXTime (simple string) : session string in the format 0000-0100:23456
showRectangleX (simple bool)
showLabelX (simple bool)
sessXcolLabel (simple color) : the color to be used for the hi/low lines and label
sessXLabel (simple string) : the session label text
gmt (simple string) : the gmt offset string usually in the format GMT+1 or GMT+2 etc
sessionLineStyle (simple string) : the line stile for the session high low lines
sessXcol (simple color) : - the color for the box color that will color the session
@return void
msToHmsString(ms)
converts milliseconds into an hh:mm string. For example, 61000 ms to '0:01:01'
Parameters:
ms (int) : - the milliseconds to convert to hh:mm
@return string - the converted hh:mm string
countdownString(openToday, closeToday, showMarketsWeekends, oneDay)
that calculates how much time is left until the next session taking the session start and end times into account. Note this function does not work on intraday sessions.
Parameters:
openToday (int) : - timestamps of when the session opens in general - note its a series because the timestamp was created using the dst flag which is a series itself thus producing a timestamp series
closeToday (int) : - timestamp of when the session closes in general - note its a series because the timestamp was created using the dst flag which is a series itself thus producing a timestamp series
@return a countdown of when next the session opens or 'Open' if the session is open now
showMarketsWeekends (simple bool)
oneDay (simple int)
countdownStringSyd(sydOpenToday, sydCloseToday, showMarketsWeekends, oneDay)
that calculates how much time is left until the next session taking the session start and end times into account. special case of intraday sessions like sydney
Parameters:
sydOpenToday (int)
sydCloseToday (int)
showMarketsWeekends (simple bool)
oneDay (simple int)
LW Outside Day Strategy[SpeculationLab]This strategy is inspired by the “Outside Day” concept introduced by Larry Williams in Long-Term Secrets to Short-Term Trading, and has been extended with configurable risk management tools and realistic backtesting parameters.
Concept
The “Outside Day” is a classic price action pattern that reflects strong market rejection or continuation pressure.
An Outside Bar occurs when the current bar’s high exceeds the previous high and the low falls below the previous low.
A body-size filter ensures only significant candles are included.
Entry Logic
Buy setup: Price closes below the previous low (bullish rejection).
Sell setup: Price closes above the previous high (bearish rejection).
Only confirmed bars are used (no intrabar signals).
Stop-Loss Modes
Prev Low/High: Uses the previous swing point ± ATR-based buffer.
ATR: Dynamic stop based on Average True Range × multiplier.
Fixed Pips: User-defined fixed distance (for forex testing).
Take-Profit Modes
Prev High/Low (PHL): Exits near the opposite swing.
Risk-Reward (RR): Targets a user-defined multiple of the stop distance (default = 2 : 1).
Following Price Open (FPO): Exits on the next bar’s open if price opens in profit (used to test overnight price continuation).
Risk Management & Backtest Settings
Default risk per trade is set at 10% of account equity (user-adjustable).
Commission = 0.1% and slippage = 2 ticks are applied to simulate realistic conditions.
For reliable statistics, test on data that yields over 100 trades.
Suitable for daily and 4-hour timeframes across stocks, forex, and crypto markets.
Visual Elements
Green and red triangles show entry signals.
Stop-loss (red) and take-profit (green) reference lines are drawn for clarity.
Optional alerts notify when a valid setup forms.
Disclaimer
This script is for educational and research purposes only.
It does not constitute financial advice or guarantee profits.
Always backtest thoroughly and manage your own risk.
Enhancements over Classic Outside Bar Models
Adjustable stop and target logic with ATR and buffer multipliers.
“Following Price Open” exit logic for realistic day-end management.
Optimized to avoid repainting and bar-confirmation issues.
Built with realistic trading costs and position sizing.
策略逻辑
外包线识别
当日最高价高于前一日最高价,且当日最低价低于前一日最低价,即形成外包线。
同时过滤掉较小实体的 K 线,仅保留实体显著大于前一根的形态。
方向过滤
收盘价低于前一日最低价 → 视为买入信号。
收盘价高于前一日最高价 → 视为卖出信号。
止损设置(可选参数)
前低/高止损:以形态前低/前高为止损,带有缓冲倍数。
ATR 止损:根据平均波动率(ATR)动态调整。
固定点数止损:按照用户设定的点数作为止损范围。
止盈设置(可选参数)
前高/低止盈(PHL):以前高/前低为目标。
固定盈亏比(RR):根据用户设定的风险回报比自动计算。
隔夜开盘(FPO):若次日开盘价高于进场价(多单)或低于进场价(空单),则平仓。
信号标记
在图表中标注买入/卖出信号(三角形标记)。
绘制止损与目标位参考线。
使用说明
适用周期:建议用于 日线图(Daily)。
适用市场:股票、外汇、加密货币等各类市场均可。
提示:此策略为历史研究与学习用途,不构成投资建议。实际交易请结合自身风险管理。