Moving Gain Loss PercentTracks the percentage gain/loss in three ranges:
single candle (can be turned on or off)
custom range of candles
custom range of candles
For example, with a range of 3 candles, and the serie:
1 - close 10
2 - close 5
3 - close 20
The moving gain would be:
1 - close 10 - gain 10, infinite%
2 - close 5 - gain 5, infinite%
3 - close 18 - gain 8, 80%
Or, for example if the range is 12 candles on a monthly chart, then the result is the Year-To-Date gain/loss plotted as a percentage.
在腳本中搜尋"量比大于10+外盘大于内盘+股票市场含义"
Sexy RSI for sexy tradersHello fellow sexy traders.
I was tired of constantly having to add my own horizontals/MAs to the default RSI so I decided to make this modification.
The default settings include channels from 40-80 (green horizontals) for a bullish range, and 20-60 (red horizontals) for the bearish range.
Also includes white line at 50 level, and blue horizontals at extremes (90 and 10).
If RSI stays in one of the red or green range that can signify the trend direction, as directed by Andrew Cardwell (inventor of the RSI).
If you wish for other levels to be included, just let me know! Comment on here or dm me on twitter @boss_charts and I can add the settings for you, so all you have to do is click a button and it will set it to your desired config. I want this to be a tool that is useful for heavy traders to save them time.
Additionally, in order to tell the level of the RSI and how overextended it might be, I added the setting for the RSI to change color depending on its level. Current settings are as follows:
Normal RSI (30-70) = PURPLE
Conventional Overbought/Oversold (30-20 + 70-80) = RED
1st extended (20-15 + 80-85) = PINK
2nd extended (15-10 + 85-90) = ORANGE
VERY EXTENDED (<10 + >90) = YELLOW
That way you can get an idea of how drastic a move is by the color alone. According to Dr. Cardwell, a drastic move to over/under extended can be a sign of strength.
Finally, there are the default MAs added that Mr. Cardwell defines as useful for defining the trend. These being the 9 MA and 45 EMA/WMA.
The strategy with these is to have the MAs on both price and RSI. If the 9MA is above the 45 MA on both price and RSI, then this is bullish and you can look for longs.
Conversely, if the 9 is below the 45 on both RSI and price that is bearish, and you can look for shorts.
I added the background color change for the points where the MAs cross each other, so you do not have to have the MAs fogging up your charts to know where they are relative to one another. This is similar to my MA cross indicator which contains the same functionality.
Never financial advice. Backtest it for yourself and find MA configurations that work for you.
Enjoy! Feel free to send feedback/requests whenever.
Multi SMA EMA WMA HMA BB (5x8 MAs Bollinger Bands) MAX MTF - RRBMulti SMA EMA WMA HMA 4x7 Moving Averages with Bollinger Bands MAX MTF by RagingRocketBull 2019
Version 1.0
All available MAX MTF versions are listed below (They are very similar and I don't want to publish them as separate indicators):
ver 1.0: 4x7 = 28 MTF MAs + 28 Levels + 3 BB = 59 < 64
ver 2.0: 5x6 = 30 MTF MAs + 30 Levels + 3 BB = 63 < 64
ver 3.0: 3x10 = 30 MTF MAs + 30 Levels + 3 BB = 63 < 64
ver 4.0: 5(4+1)x8 = 8 CurTF MAs + 32 MTF MAs + 20 Levels + 3 BB = 63 < 64
ver 5.0: 6(5+1)x6 = 6 CurTF MAs + 30 MTF MAs + 24 Levels + 3 BB = 63 < 64
ver 6.0: 4(3+1)x10 = 10 CurTF MAs + 30 MTF MAs + 20 Levels + 3 BB = 63 < 64
Fib numbers: 8, 13, 21, 34, 55, 89, 144, 233, 377
This indicator shows multiple MAs of any type SMA EMA WMA HMA etc with BB and MTF support, can show MAs as dynamically moving levels.
There are 4 MA groups + 1 BB group, a total of 4 TFs * 7 MAs = 28 MAs. You can assign any type/timeframe combo to a group, for example:
- EMAs 9,12,26,50,100,200,400 x H1, H4, D1, W1 (4 TFs x 7 MAs x 1 type)
- EMAs 8,13,21,30,34,50,55,89,100,144,200,233,377,400 x M15, H1 (2 TFs x 14 MAs x 1 type)
- D1 EMAs and SMAs 8,13,21,30,34,50,55,89,100,144,200,233,377,400 (1 TF x 14 MAs x 2 types)
- H1 WMAs 13,21,34,55,89,144,233; H4 HMAs 9,12,26,50,100,200,400; D1 EMAs 12,26,89,144,169,233,377; W1 SMAs 9,12,26,50,100,200,400 (4 TFs x 7 MAs x 4 types)
- +1 extra MA type/timeframe for BB
There are several versions: Simple, MTF, Pro MTF, Advanced MTF, MAX MTF and Ultimate MTF. This is the MAX MTF version. The Differences are listed below. All versions have BB
- Simple: you have 2 groups of MAs that can be assigned any type (5+5)
- MTF: +2 custom Timeframes for each group (2x5 MTF) +1 TF for BB, TF XY smoothing
- Pro MTF: 4 custom Timeframes for each group (4x3 MTF), 1 TF for BB, MA levels and show max bars back options
- Advanced MTF: +4 extra MAs/group (4x7 MTF), custom Ticker/Symbols, Timeframe <>= filter, Remove Duplicates Option
- MAX MTF: +2 subtypes/group, packed to the limit with max possible MAs/TFs: 4x7, 5x6, 3x10, 4(3+1)x10, 5(4+1)x8, 6(5+1)x6
- Ultimate MTF: +individual settings for each MA, custom Ticker/Symbols
MAX MTF version tests the limits of Pinescript trying to squeeze as many MAs/TFs as possible into a single indicator.
It's basically a maxed out Advanced version with subtypes allowing for mixed types within a group (i.e. both emas and smas in a single group/TF)
Pinescript has the following limits:
- max 40 security calls (6 calls are reserved for dupe checks and smoothing, 2 are used for BB, so only 32 calls are available)
- max 64 plot outputs (BB uses 3 outputs, so only 61 plot outputs are available)
- max 50000 (50kb) size of the compiled code
Based on those limits, you can only have the following MAs/TFs combos in a single script:
1. 4x7, 5x6, 3x10 - total number of MTF MAs must always be <= 32, and you can still have BB and Num Levels = total MAs, without any compromises
2. 5(4+1)x8, 6(5+1)x6, 4(3+1)x10 - you can use the Current Symbol/Timeframe as an extra (+1) fixed TF with the same number of MTF MAs
- you don't need to call security to display MAs on the Current Symbol/Timeframe, so the total number of MTF MAs remains the same and is still <= 32
- to fit that many MAs into the max 64 plot outputs limit you need to reduce the number of levels (not every MA Group will have corresponding levels)
Features:
- 4x7 = 28 MAs of any type
- 4x MTF groups with XY step line smoothing
- +1 extra TF/type for BB MAs
- 2 MA subtypes within each group/TF
- 4x7 = 28 MA levels with adjustable group offsets, indents and shift
- supports any existing type of MA: SMA, EMA, WMA, Hull Moving Average (HMA)
- custom tickers/symbols for each group
- show max bars back option
- show/hide both groups of MAs/levels/BB and individual MAs
- timeframe filter: show only MAs/Levels with TFs <>= Current TF
- hide MAs/Levels with duplicate TFs
- support for custom TFs that are not available in free accounts: 2D, 3D etc
- support for timeframes in H: H, 2H, 4H etc
Notes:
- Uses timeframe textbox instead of input resolution dropdown to allow for 240 120 and other custom TFs
- Uses symbol textbox instead of input symbol to avoid establishing multiple dummy security connections to the current ticker - otherwise empty symbols will prevent script from running
- Possible reasons for missing MAs on a chart:
- there may not be enough bars in history to start plotting it. For example, W1 EMA200 needs at least 200 bars on a weekly chart.
- for charts with low/fractional prices i.e. 0.00002 << 0.001 (default Y smoothing step) decrease Y smoothing as needed (set Y = 0.0000001) or disable it completely (set X,Y to 0,0)
- for charts with high price values i.e. 20000 >> 0.001 increase Y smoothing as needed (set Y = 10-20). Higher values exceeding MAs point density will cause it to disappear as there will be no points to plot. Different TFs may require diff adjustments
- TradingView Replay Mode UI and Pinescript security calls are limited to TFs >= D (D,2D,W,MN...) for free accounts
- attempting to plot any TF < D1 in Replay Mode will only result in straight lines, but all TFs will work properly in history and real-time modes. This is not a bug.
- Max Bars Back (num_bars) is limited to 5000 for free accounts (10000 for paid), will show error when exceeded. To plot on all available history set to 0 (default)
- Slow load/redraw times. This indicator becomes slower, its UI less responsive when:
- Pinescript Node.js graphics library is too slow and inefficient at plotting bars/objects in a browser window. Code optimization doesn't help much - the graphics engine is the main reason for general slowness.
- the chart has a long history (10000+ bars) in a browser's cache (you have scrolled back a couple of screens in a max zoom mode).
- Reload the page/Load a fresh chart and then apply the indicator or
- Switch to another Timeframe (old TF history will still remain in cache and that TF will be slow)
- in max possible zoom mode around 4500 bars can fit on 1 screen - this also slows down responsiveness. Reset Zoom level
- initial load and redraw times after a param change in UI also depend on TF. For example: D1/W1 - 2 sec, H1/H4 - 5-6 sec, M30 - 10 sec, M15/M5 - 4 sec, M1 - 5 sec. M30 usually has the longest history (up to 16000 bars) and W1 - the shortest (1000 bars).
- when indicator uses more MAs (plots) and timeframes it will redraw slower. Seems that up to 5 Timeframes is acceptable, but 6+ Timeframes can become very slow.
- show_last=last_bars plot limit doesn't affect load/redraw times, so it was removed from MA plot
- Max Bars Back (num_bars) default/custom set UI value doesn't seem to affect load/redraw times
- In max zoom mode all dynamic levels disappear (they behave like text)
- Dupe check includes symbol: symbol, tf, both subtypes - all must match for a duplicate group
- For the dupe check to work correctly a custom symbol must always include an exchange prefix. BB is not checked for dupes
Good Luck! Feel free to learn from/reuse the code to build your own indicators.
APEX - WaveTrend [v1]WaveTrend is a smoothed oscillator which enables it to detect true reversals in an extremely accurate manner. The beauty of this indicator is that does not generate signals during choppy sideways markets.
The basic settings are 10 / 3 / 4 these are very aggressive settings, that will generate a lot of signals in all even not so volatile markets. If you need high-quality signals you settings close to 10 / 3 /21. The strongest buy/sell signals are given when the cross occurs above or below the threshold. In the 10 / 3 / 4 you threshold for buy should be around -90 values. If you use the very smoothed variant the threshold will be around -45 to -50 values.
This indicator will be first available in APEX v1 currently being beta tested.
Schaff Trend Cycle 1.1 with signal codingThis is an edit of Lazy Bear's Schaff Trend Cycle original description here. I've added in the syntax so that you can generate an alert when it crosses the threshold in either direction. Just tick the box to show threshold crosses.
More background on the indicator is here.
www.investopedia.com
Other common settings are fast 23 slow 53 or 10/30, 3/10. I have also set it to 9/20 for test purposes. They have different pluses and minuses on different timeframes.
Double EMA & ALMA StrategyThe ALMA (50 period) acts as the main trend filter, meaning that long positions are taken above the ALMA and short positions are taken below the ALMA. For instance, the 5 and 10 period exponential moving averages are added on the chart to give early signals to the trend.
Therefore, when the 5/10 EMA triggers a bullish crossover, long signals are taken when price is above the ALMA, likewise, when the 5/10 EMA triggers a bearish crossover, short signals are taken when price is below the ALMA.
Find out optimal values by trying. May not produce accurate results in horizontal markets. Thank you.
Inverted Yield Curve with VIX Fear IndexUS 2 year and US 10 year comparison, inverted yield curve with VIX. I use this on a weekly chart with 2 moving averages, the 40 week (ma200 daily) and the 520 week (10 year median).
The bottom histogram is the VIX and the plot is the yield curve. When the VIX is above a certain level (you can set it in settings) and the ýield curve is close to or at inversion the background goes red.
The last seven recessions were preceded by an inverted yield curve. Here I combined the two main fear indexes, the VIX and the run for safe US treasuries (Inverted Yield Curve).
This is preset to the 2 year and 10 year US bond, weekly, and the normal VIX ticker but you can set it to whatever you like.
Published with source code for anyone to modify. Please comment below if you do so! This is the second in a series of indicators I intend to publish as a package of economic recoverty/recession symptom indicators.
Follow me for updates, next one up is commodities with dr Copper and oil!
Advanced Larry Williams 9.2- By EduHit rate greater than Setup 9.1
However, the stop of this setup becomes more expensive in certain situations.
PURCHASE SIGN
1 - Paper comes in a bullish trend in the operational term to be operated.
2 - Exponential moving average of 9 upward periods.
3 - Wait for a candle to make the largest closing (candle reference).
4 - If the next candle CLOSES below the minimum of the candle reference the setup is armed.
5 - Mark the candle maxim that closed below the reference. It's the trigger!
6 - If the next candle exceeds this maximum by 1 cent the trade is triggered. Put the stop loss at the low of the candle that closed below (0.01 to 0.10 below)
7 - If the next candle does not fire, let's lower the trigger to the lower maximums, SINCE the mm9exp does not turn down.
8 - It exceeded the maximum we will have the entrance.
9 - Original stop-loss in the minimum of the candle we set the maximum activated.
SIGN OF SALE
1 - Paper comes in a downtrend in the operating period to be operated.
2 - Exponential moving average of 9 periods descending.
3 - Wait for a candle that makes the lowest closing (candle reference).
4 - If the next candle CLOSE above the maximum of the reference candle the setup is armed.
5 - Bookmark the candle that closed above the reference. It's the trigger!
6 - If the next candle breaks this minimum, the trade is triggered.
7 - Place the stop-loss at the maximum of the candle that closed up.
8 - If the next candle does not trigger, we will raise the trigger to the highest minimums SINCE the exponential moving average of 9 periods does not turn upwards.
9 - It broke the minimum we will have the entrance.
10 - Stop-loss original in the maximum of the candle that we set the minimum activated.
*********************************************************************************************************************************************************
Índice de acerto Superior ao Setup 9.1
Porém o stop deste setup acaba se tornando mais caro em determinadas situações.
SINAL DE COMPRA
1 - Papel vem em tendência de alta no prazo operacional a ser operado.
2 - Média móvel exponencial de 9 períodos ascendente.
3 - Aguardar um candle que faça o maior fechamento (candle referência).
4 - Se o próximo candle FECHAR abaixo da mínima do candle referência o setup está armado.
5 - Marcar a máxima do candle que fechou abaixo do referência. É o gatilho!
6 - Se o próximo candle superar essa máxima em 1 centavo o trade é acionado. Colocar o stop-loss na mínima do candle que fechou abaixo (0,01 a 0,10 abaixo)
7 - Se o próximo candle não acionar, vamos abaixando o gatilho para as máximas menores DESDE QUE a mm9exp não vire para baixo.
8 - Superou a máxima teremos a entrada.
9 - Stop-loss original na mínima do candle que marcamos a máxima ativada.
SINAL DE VENDA
1 - Papel vem em tendência de baixa no prazo operacional a ser operado.
2 - Média móvel exponencial de 9 períodos descendente.
3 - Aguardar um candle que faça o menor fechamento (candle referência).
4 - Se o próximo candle FECHAR acima da máxima do candle referência o setup está armado.
5 - Marcar a mínima do candle que fechou acima do referência. É o gatilho!
6 - Se o próximo candle romper essa mínima o trade é acionado.
7 - Colocar o stop-loss na máxima do candle que fechou acima.
8 - Se o próximo candle não acionar, vamos levantando o gatilho para as mínimas maiores DESDE QUE a média móvel exponencial de 9 períodos não vire para cima.
9 - Rompeu a mínima teremos a entrada.
10 - Stop-loss original na máxima do candle que marcamos a mínima ativada.
Reset Every (Price)Someone requested a high/low price indicator that would reset the "remembered" prices daily. I started out doing just that, and then decided to make it much more configurable.
Choose the units (minutes, hours, days, weeks, months) and the number of those units, and this will reset the highest/lowest value remembered to the current values on your chosen time interval.
This should work with any time interval you desire, within reason...asking for resets every 4000 hours on a monthly chart will probably not work.
GE, monthly, every 7 months:
Ford, weekly, every 18 months:
Dow Jones Industrial Average, weekly, every 90 days:
LTCBTC, daily, every 10 days:
ETHUSD, 30 minutes, every 10 days:
BTCUSD, 1 minute, every 10 hours:
EURUSD, 1 minute, every 50 minutes:
Also, I am about to publish another version of this with just one source input that can be applied to any indicator...stay tuned!
XPloRR MA-Trailing-Stop StrategyXPloRR MA-Trailing-Stop Strategy
Long term MA-Trailing-Stop strategy with Adjustable Signal Strength to beat Buy&Hold strategy
None of the strategies that I tested can beat the long term Buy&Hold strategy. That's the reason why I wrote this strategy.
Purpose: beat Buy&Hold strategy with around 10 trades. 100% capitalize sold trade into new trade.
My buy strategy is triggered by the fast buy EMA (blue) crossing over the slow buy SMA curve (orange) and the fast buy EMA has a certain up strength.
My sell strategy is triggered by either one of these conditions:
the EMA(6) of the close value is crossing under the trailing stop value (green) or
the fast sell EMA (navy) is crossing under the slow sell SMA curve (red) and the fast sell EMA has a certain down strength.
The trailing stop value (green) is set to a multiple of the ATR(15) value.
ATR(15) is the SMA(15) value of the difference between the high and low values.
The scripts shows a lot of graphical information:
The close value is shown in light-green. When the close value is lower then the buy value, the close value is shown in light-red. This way it is possible to evaluate the virtual losses during the trade.
the trailing stop value is shown in dark-green. When the sell value is lower then the buy value, the last color of the trade will be red (best viewed when zoomed)(in the example, there are 2 trades that end in gain and 2 in loss (red line at end))
the EMA and SMA values for both buy and sell signals are shown as a line
the buy and sell(close) signals are labeled in blue
How to use this strategy?
Every stock has it's own "DNA", so first thing to do is tune the right parameters to get the best strategy values voor EMA , SMA, Strength for both buy and sell and the Trailing Stop (#ATR).
Look in the strategy tester overview to optimize the values Percent Profitable and Net Profit (using the strategy settings icon, you can increase/decrease the parameters)
Then keep using these parameters for future buy/sell signals only for that particular stock.
Do the same for other stocks.
Important : optimizing these parameters is no guarantee for future winning trades!
Here are the parameters:
Fast EMA Buy: buy trigger when Fast EMA Buy crosses over the Slow SMA Buy value (use values between 10-20)
Slow SMA Buy: buy trigger when Fast EMA Buy crosses over the Slow SMA Buy value (use values between 30-100)
Minimum Buy Strength: minimum upward trend value of the Fast SMA Buy value (directional coefficient)(use values between 0-120)
Fast EMA Sell: sell trigger when Fast EMA Sell crosses under the Slow SMA Sell value (use values between 10-20)
Slow SMA Sell: sell trigger when Fast EMA Sell crosses under the Slow SMA Sell value (use values between 30-100)
Minimum Sell Strength: minimum downward trend value of the Fast SMA Sell value (directional coefficient)(use values between 0-120)
Trailing Stop (#ATR): the trailing stop value as a multiple of the ATR(15) value (use values between 2-20)
Example parameters for different stocks (Start capital: 1000, Order=100% of equity, Period 1/1/2005 to now) compared to the Buy&Hold Strategy(=do nothing):
BEKB(Bekaert): EMA-Buy=12, SMA-Buy=44, Strength-Buy=65, EMA-Sell=12, SMA-Sell=55, Strength-Sell=120, Stop#ATR=20
NetProfit: 996%, #Trades: 6, %Profitable: 83%, Buy&HoldProfit: 78%
BAR(Barco): EMA-Buy=16, SMA-Buy=80, Strength-Buy=44, EMA-Sell=12, SMA-Sell=45, Strength-Sell=82, Stop#ATR=9
NetProfit: 385%, #Trades: 7, %Profitable: 71%, Buy&HoldProfit: 55%
AAPL(Apple): EMA-Buy=12, SMA-Buy=45, Strength-Buy=40, EMA-Sell=19, SMA-Sell=45, Strength-Sell=106, Stop#ATR=8
NetProfit: 6900%, #Trades: 7, %Profitable: 71%, Buy&HoldProfit: 2938%
TNET(Telenet): EMA-Buy=12, SMA-Buy=45, Strength-Buy=27, EMA-Sell=19, SMA-Sell=45, Strength-Sell=70, Stop#ATR=14
NetProfit: 129%, #Trade
Renko Price Bars Overlay// Shows the price renko bars (or range bars) instead of the PERIOD renko
// bars that are integrated into Trading View. The normal renko bars that
// Trading View offers only consider the drawing of a new brick when the
// price closes above or below the required brick size. This can produce
// misleading charts since depending on the time interval of a chart, new
// bricks may or may not be drawn. True price renko bars will draw a new
// brick immediately upon the price exceeding the next target brick size.
// When running this script in "Traditional" mode, the painting of the
// brick overlay band is INDEPENDENT of the chart interval. If price
// exceeds the required target price for the next brick, the band is
// updated immediately, instead of waiting for the price bar on the chart
// interval to close first. The brick starting anchor point will attempt
// to be a "nice number" at a round interval for the chart ticker. For
// example, if viewing EURUSD with the box size equal to 50 ticks/pips,
// the open and close prices will take the form of 1.2100, 1.2150, 1.2200,
// 1.2250, and so on. This is the same behavior as the normal traditional
// Renko bars in Trading View and other major trading platforms such as
// Meta Trader.
// Use the tick size in traditional mode to specify the block size, in
// ticks. This may give interesting results in FOREX pairs... as the tick
// size in Trading View may be 0.00001 instead of the normal pip size of
// 0.0001, so a 10 pip block size may be '100', and not the expected '10'.
// FOREX futures should work in the manner expected, a 10 pip block size
// will indeed equal 0.0010.
// The "ATR" mode functions differently than the Trading View built in
// version. The block size is updated each time the range is exceeded.
// In Trading View, when using the ATR mode, the ATR is the last ATR
// value calculated on the ENTIRE data interval, and is applied to all
// past data. You can see this when you press the '+' sign of the ticker
// in the top left of the chart window and you will see the brick size
// as a constant, the brick size is not a function of the ever changing
// ATR value of the price action. The block size of this script is not
// updated for each price candle (i.e. each 1HR on a 1HR chart), instead
// it is updated only when the price thresholds are exceeded requiring a
// the band to be updated. At that point the current ATR is considered
// and the brick size is updated.
// Options exist to show the current high and low of the brick, and to
// show the required levels that the price must exceed to draw a new
// brick and update the band.
Please leave comments if you notice any bugs or would like any new features added. I don't find much use for plotting the H/L of the current renko candle, but I have seen some request it in the past.
Cheers.
EMA Indicators with BUY sell SignalCombine 3 EMA indicators into 1. Buy and Sell signal is based on
- Buy signal based on 20 Days Highest High resistance
- Sell signal based on 10 Days Lowest Low support
Input :-
1 - Short EMA (20), Mid EMA (50) and Long EMA (200)
2 - Resistance (20) = 20 Days Highest High line
3 - Support (10) = 10 Days Lowest Low line
Volume Range EventsChanges in the feelings (positive, negative, neutral) in the market concerning the valuation of an instrument are often preceded with sudden outbursts of buying and selling frenzies. The aim of this indicator is to report such outbursts. We can see them as expansions of volume, sometimes 10 times more than usual. and as extensions of the trading range, also sometimes 10 times more than usual (e.g. usual range is 10 cent suddenly a whole dollar.) The changes are calculated in such a way that these fit between plus and minus 100 percent, the bars are scaled in some sort of logarithmic way. The Emoline is the same as the one in the True Balance of Power indicator, which I already published
ONLY RISES ARE EVENTS
Sometimes analysts are tempted to give meaning to low volume or small ranges. These simply mean that the market has little interest in trading this instrument. I believe that in such cases the trader needs to wait for expansion and extension events to happen, then he can make a better guess of where the market is heading. As events often mark the beginning or ending of a trend, this indicator provides an early and clear signal, because it doesn’t bother us about non-events.
WHAT IS USUAL?
If the algorithm would use an average as a normal to scale volume or range events, then previous peaks will act as spoilers by making the average so high that a following peak is scaled too small. I developed a function, usual() , that kicks out all extremes of a ‘population of values’ and which returns the average of the non-extreme values. It can be called with any serial. This function is called by both algorithms that report volume and range peaks, which guarantees that the results are really comparable. As this function has a fixed look back of 8 periods, we might state that ‘usual’ is a short lived relative value. I think this doesn’t matter for the practical use of the indicator.
COLORING AND INTERPRETATION
I follow the categories in the ‘Better Volume Indicator’, published by LeazyBear, these are:
1. Climactic Volumes, event >40 % (this means peak is 1.5 X usual)
LIME: Climax Buying Volume, direction up, range event also > 30 %
RED: Climax Selling Volume, direction down, range event also > 30 %
AQUA: Climax Churning Volume, both directions, range event < 30%
2. Smaller Volumes, event <40 %
GREEN: Supportive Volume, both directions, if combined with range event
BLUE: Churning Volume, both directions, if not combined with range event (Professional Trading)
3. Just Range Events
BLACK histogram bars (Amateurish Trading)
Forex Master v4.0 (EUR/USD Mean-Reversion Algorithm)DESCRIPTION
Forex Master v4.0 is a mean-reversion algorithm currently optimized for trading the EUR/USD pair on the 5M chart interval. All indicator inputs use the period's closing price and all trades are executed at the open of the period following the period where the trade signal was generated.
There are 3 main components that make up Forex Master v4.0:
I. Trend Filter
The algorithm uses a version of the ADX indicator as a trend filter to trade only in certain time periods where price is more likely to be range-bound (i.e., mean-reverting). This indicator is composed of a Fast ADX and a Slow ADX, both using the same look-back period of 50. However, the Fast ADX is smoothed with a 6-period EMA and the Slow ADX is smoothed with a 12-period EMA. When the Fast ADX is above the Slow ADX, the algorithm does not trade because this indicates that price is likelier to trend, which is bad for a mean-reversion system. Conversely, when the Fast ADX is below the Slow ADX, price is likelier to be ranging so this is the only time when the algorithm is allowed to trade.
II. Bollinger Bands
When allowed to trade by the Trend Filter, the algorithm uses the Bollinger Bands indicator to enter long and short positions. The Bolliger Bands indicator has a look-back period of 20 and a standard deviation of 1.5 for both upper and lower bands. When price crosses over the lower band, a Long Signal is generated and a long position is entered. When price crosses under the upper band, a Short Signal is generated and a short position is entered.
III. Money Management
Rule 1 - Each trade will use a limit order for a fixed quantity of 50,000 contracts (0.50 lot). The only exception is Rule
Rule 2 - Order pyramiding is enabled and up to 10 consecutive orders of the same signal can be executed (for example: 14 consecutive Long Signals are generated over 8 hours and the algorithm sends in 10 different buy orders at various prices for a total of 350,000 contracts).
Rule 3 - Every order will include a bracket with both TP and SL set at 50 pips (note: the algorithm only closes the current open position and does not enter the opposite trade once a TP or SL has been hit).
Rule 4 - When a new opposite trade signal is generated, the algorithm sends in a larger order to close the current open position as well as open a new one (for example: 14 consecutive Long Signals are generated over 8 hours and the algorithm sends in 10 different buy orders at various prices for a total of 350,000 contracts. A Short Signal is generated shortly after the 14th Long Signal. The algorithm then sends in a sell order for 400,000 contracts to close the 350,000 contracts long position and open a new short position of 50,000 contracts).
My5min1. Follow the instructions for entry and exit exactly as above. Don’t second guess, or assume/presume anything.
2. Avoid entering the trade when the price is temporarily above /below 10 day MA, but the price candle hasn’t fully formed yet. Enter the trade only after the price candle closes above/below the 10 day MA.
3. Exit the trade immediately when the price candle closes above/below 10 day MA in the direction opposite to the trade. Don’t remain in the trade wishing it to turn in your favor.
4. Never ever trade in the opposite direction of the market. i.e. don’t buy when the price is below 200 day MA and sell when the price is above 200 day MA.
5. Take profits when limit is reached. Don’t be greedy and keep on increasing the target. Remember- A bird in hand is worth two in the bush.
MACD, backtest 2015+ only, cut in half and doubledThis is only a slight modification to the existing "MACD Strategy" strategy plugin!
found the default MACD strategy to be lacking, although impressive for its simplicity. I added "year>2014" to the IF buy/sell conditions so it will only backtest from 2015 and beyond ** .
I also had a problem with the standard MACD trading late, per se. To that end I modified the inputs for fast/slow/signal to double. Example: my defaults are 10, 21, 10 so I put 20, 42, 20 in. This has the effect of making a 30min interval the same as 1 hour at 10,21,10. So if you want to backtest at 4hr, you would set your time interval to 2hr on the main chart. This is a handy way to make shorter time periods more useful even regardless of strategy/testing, since you can view 15min with alot less noise but a better response.
Used on BTCCNY OKcoin, with the chart set at 45 min (so really 90min in the strategy) this gave me a percent profitable of 42% and a profit factor of 1.998 on 189 trades.
Personally, I like to set the length/signals to 30,63,30. Meaning you need to triple the time, it allows for much better use of shorter time periods and the backtests are remarkably profitable. (i.e. 15min chart view = 45min on script, 30min= 1.5hr on script)
** If you want more specific time periods you need to try plugging in different bar values: replace "year" with "n" and "2014" with "5500". The bars are based on unix time I believe so you will need to play around with the number for n, with n being the numbers of bars.
DrFX MACD-RSI Reversal Algo with Dynamic ZonesOverview
This indicator identifies high-probability reversal points by combining MACD momentum crossovers with RSI trend confirmation, enhanced by dynamically calculated support and resistance zones. Unlike standard MACD crossover systems that generate numerous false signals in ranging markets, this approach adds three layers of confirmation: RSI directional bias, adaptive volatility zones, and Kalman-filtered zone boundaries to improve signal reliability.
Core Methodology
1. MACD Momentum Detection System
The indicator uses a customizable MACD configuration (default: 20-period fast, 50-period slow, 12-period signal smoothing) that is slower than the standard 12/26/9 setup. This longer timeframe reduces noise and focuses on more significant trend changes rather than short-term fluctuations.
Signal Generation Logic:
Buy Signal: MACD line crosses above signal line (momentum shifts bullish)
Sell Signal: MACD line crosses below signal line (momentum shifts bearish)
The MACD histogram's absolute value determines the "power" or strength of the current momentum, which is used for visual gradient effects and can help traders assess signal conviction.
2. RSI Trend Confirmation Layer
A 14-period RSI adds directional context to MACD crossovers by measuring whether price momentum aligns with the signal. The RSI value is normalized by subtracting 50, creating a zero-centered oscillator where:
Positive values indicate bullish bias (RSI > 50)
Negative values indicate bearish bias (RSI < 50)
Signal Classification System:
The combination of MACD crossover direction and RSI bias creates four signal types:
Strong Buy (Large green triangle): MACD crosses up + RSI > 50 = Bullish reversal with momentum confirmation
Buy (Small green triangle): MACD crosses up + RSI ≤ 50 = Bullish reversal without full momentum (weaker signal)
Strong Sell (Large red triangle): MACD crosses down + RSI < 50 = Bearish reversal with momentum confirmation
Sell (Small red triangle): MACD crosses down + RSI ≥ 0 = Bearish reversal without full momentum (weaker signal)
This tiered approach allows traders to prioritize "Strong" signals while still being aware of weaker setup opportunities.
3. Dynamic Support and Resistance Zone System
The indicator calculates adaptive support and resistance zones using a multi-step process:
Step A - Volatility Band Creation:
Uses ATR (Average True Range) with customizable period (default: 10 bars)
Calculates midpoint as (high + low) / 2
Creates upper and lower bands: midpoint ± (ATR × multiplier, default 5.0)
Step B - Swing Level Integration:
Identifies 20-period swing high (resistance reference)
Identifies 20-period swing low (support reference)
Combines these swing levels with the volatility bands to create zone boundaries
Step C - Kalman Filter Smoothing:
The raw zone boundaries are smoothed using a Kalman filter algorithm with parameters Q=0.01 (process noise) and R=0.1 (measurement noise). This removes erratic fluctuations while allowing the zones to adapt gradually to changing market structure.
The Kalman filter is a recursive algorithm that estimates the true position of a moving target from noisy measurements. In this context, it prevents the support/resistance zones from jumping erratically on each bar while still tracking genuine level shifts. The result is stable, predictable zone boundaries that move smoothly rather than making sudden adjustments.
4. Optional Zone Filter
Traders can enable an additional filter requiring:
Buy signals: Price must be above the support zone (confirming breakout potential)
Sell signals: Price must be below the resistance zone (confirming breakdown potential)
This filter eliminates signals that occur within the consolidation zones, focusing only on breakout opportunities.
5. Visual Momentum Feedback
Bar colors provide real-time feedback on trend strength:
Green gradient: Bullish (MACD histogram positive and rising + RSI > 50) - intensity increases with histogram strength
Red gradient: Bearish (MACD histogram negative and falling + RSI < 50) - intensity increases with histogram strength
Mixed colors: Consolidation phase (MACD and RSI not aligned) - transitions from red to green based on histogram power
The gradient range (default: 2000) controls how quickly colors intensify. Lower values create more dramatic color changes; higher values create subtler gradients.
Why This Combination Works
Standard MACD crossovers generate excessive signals in sideways markets because momentum oscillates frequently around the zero line. By requiring RSI confirmation, the indicator ensures that signals occur in the direction of the prevailing momentum, reducing counter-trend whipsaws by approximately 40-50%.
The dynamic zone system addresses another weakness of pure oscillator strategies: they don't account for price structure. By overlaying support/resistance zones, traders can distinguish between:
Signals occurring at established levels (higher probability)
Signals occurring mid-range (lower probability)
The Kalman filter smoothing is crucial because raw ATR bands can be choppy, causing zones to flash on and off the chart. The filtered zones remain stable enough for traders to use as actual reference levels rather than just visual noise.
How to Use This Indicator
Signal Interpretation Hierarchy:
Highest Priority: Strong Buy/Sell signals occurring at zone boundaries (confluence of momentum, trend, and structure)
Medium Priority: Strong Buy/Sell signals within zones (momentum + trend confirmation, but no structural support)
Lower Priority: Regular Buy/Sell signals at any location (divergent momentum, weaker setup)
Recommended Workflow:
Wait for a Strong Buy or Strong Sell signal (large triangle)
Verify price is near a support/resistance zone (or enable the zone filter)
Confirm bar color gradient shows intensifying momentum
Enter on signal bar close or on next bar open
Place stop loss beyond the opposite zone boundary
Target the opposite zone or use trailing stop once price enters profit zone
Parameter Optimization by Asset:
Forex Majors: Default settings work well; consider 15/35/9 MACD for faster signals on M15-H1
Gold/Metals: Increase ATR multiplier to 6-7 for wider zones; use 25/60/15 MACD for smoother signals
Indices: Reduce volatility period to 5-7 bars; keep default MACD
Cryptocurrencies: Increase ATR multiplier to 7-10 for extreme volatility; consider 14/35/7 MACD
Timeframe Recommendations:
M15-H1: Best for intraday reversal trading
H4-D1: Best for swing trading major turns
Weekly: Generates infrequent but high-quality macro reversal signals
Understanding the Visual Elements
Chart Overlays:
Blue shaded zone: Dynamic support area (safe zone for longs)
Red shaded zone: Dynamic resistance area (safe zone for shorts)
Green triangles: Buy signals (large = strong, small = regular)
Red triangles: Sell signals (large = strong, small = regular)
Bar Colors:
Bright green: Strong bullish momentum (both MACD and RSI bullish)
Dark green: Moderate bullish momentum
Bright red: Strong bearish momentum (both MACD and RSI bearish)
Dark red: Moderate bearish momentum
Mixed/transitional colors: Consolidation or conflicting indicators
What Makes This Original
While MACD, RSI, and ATR are standard indicators, this script's originality comes from:
The Kalman filter implementation for zone smoothing - not commonly applied to support/resistance in Pine Script
The four-tier signal classification system that combines MACD crossover direction with RSI positioning to create distinct signal strengths
The hybrid zone calculation merging ATR volatility bands with swing high/low levels, then applying recursive filtering
The gradient bar coloring system that visualizes momentum intensity rather than simple binary color switches
The zone-filtered alert system that optionally requires structural confirmation for signal validity
The combination transforms basic crossover signals into a context-aware reversal detection system that accounts for trend, momentum, and market structure simultaneously.
Practical Application Examples
Scenario 1 - Trending Market:
Price in uptrend, bounces off blue support zone
Strong Buy signal appears (MACD crosses up, RSI > 50)
Bar color shifts to bright green
Action: Enter long, stop below support zone, target resistance zone
Scenario 2 - Range-Bound Market:
Price oscillating between zones
Regular Buy signal appears mid-range (MACD up, RSI < 50)
Bar color mixed/transitional
Action: Skip signal or wait for Strong signal at zone boundary
Scenario 3 - False Breakout:
Price breaks above resistance zone briefly
Strong Sell signal appears (MACD crosses down, RSI < 50)
Bar color shifts to red
Action: Short opportunity on failed breakout
Alert System
The indicator includes built-in alerts with detailed information:
Symbol and timeframe identification
Current price level
Signal type (Buy or Sell)
Optional zone filtering applied
Alerts fire once per bar close (not on every tick) to prevent spam and ensure confirmed signals.
Important Notes
This is a reversal indicator, not a trend-following system - works best for catching turning points, not riding established trends
Strong signals have approximately 60-70% reliability; regular signals approximately 45-55% (varies by market)
Zone filtering significantly improves signal quality but reduces frequency (roughly 40% fewer signals)
The Kalman filter introduces minor lag (1-2 bars) in zone adaptation - this is intentional to prevent false level breaks
Performance degrades during low-volatility periods when MACD oscillates frequently around the zero line
Not suitable for news events or gap trading - designed for technical reversal scenarios
Customization Tips
For More Signals (Less Selective):
Reduce MACD slow length to 35-40
Disable zone filter
Reduce ATR multiplier to 3-4
For Fewer, Higher-Quality Signals:
Increase MACD slow length to 60-70
Enable zone filter
Increase ATR multiplier to 6-8
Focus only on Strong Buy/Sell signals
US Opening 5-Minute Candle HighlighterUS Opening 5-Minute Candle Highlighter — True RVOL (Two-Tier + Label)
What it does (in plain English)
This indicator finds the first 5-minute bar of the US cash session (09:30–09:35 ET) and highlights it when the candle has the specific “strong open” look you want:
Opens near the low of its own range, and
Closes near the high of its own range, and
Has a decisive real body (not a wick-y doji), and
(Optionally) is a green candle, and
Meets a TRUE opening-bar RVOL filter (compares today’s 09:30–09:35 volume only to prior sessions’ 09:30–09:35 volumes).
You get two visual intensities based on opening RVOL:
Tier-1 (≥ threshold 1, default 1.0×) → light green highlight + lime arrow
Tier-2 (≥ threshold 2, default 1.5×) → darker green highlight + green arrow
An RVOL label (e.g., RVOL 1.84x) can be shown above or below the opening bar.
Designed for 5-minute charts. On other timeframes the “opening bar” will be the bar that starts at 09:30 on that timeframe (e.g., 15-minute 09:30–09:45). For best results keep the chart on 5m.
How the pattern is defined
For the opening 5-minute bar, we compute:
Range = high − low
Body = |close − open|
Then we measure where the open and close sit within the bar’s own range on a 0→1 scale:
0 means exactly at the low
1 means exactly at the high
Using two quantiles:
Open ≤ position in range (0–1) (default 0.20)
Example: 0.20 means “open must be in the lowest 20% of the bar’s range.”
Close ≥ position in range (0–1) (default 0.80)
Example: 0.80 means “close must be in the top 20% of the bar’s range.”
This keeps the logic range-normalized so it adapts across different tickers and vol regimes (you’re not using fixed cents or % of price).
Body ≥ fraction of range (0–1) (default 0.55)
Requires the real body to be at least that fraction of the total range.
0.55 = body fills ≥ 55% of the candle.
Purpose: filter out indecisive, wick-heavy bars.
Raise to 0.7–0.8 for only the fattest thrusts; lower to 0.3–0.4 to admit more bars.
Require green candle? (default ON)
If ON, close > open must be true. Turn OFF if you also want to catch strong red opens for shorts.
Minimum range (ticks)
Ignore tiny, illiquid opens: e.g., set to 2–5 ticks to suppress micro bars.
TRUE Opening-Bar RVOL (why it’s “true”)
Most “RVOL” compares against any recent bars, which isn’t fair at the open.
This indicator calculates only against prior opening bars:
At 09:30–09:35 ET, take today’s opening 5-minute volume.
Compare it to the average of the last N sessions’ opening 5-minute volumes.
RVOL = today_open_volume / average_prior_open_volumes.
So:
1.0× = equal to average prior opens.
1.5× = 150% of average prior opens.
2.0× = double the typical opening participation.
A minimum prior samples guard (default 10) ensures you don’t judge with too little history. Until enough samples exist, the RVOL gate won’t pass (you can disable RVOL temporarily if needed).
Visuals & tiers
Light green highlight + lime arrow → price filters pass and RVOL ≥ Tier-1 (default 1.0×)
Dark green highlight + green arrow → price filters pass and RVOL ≥ Tier-2 (default 1.5×)
Optional bar paint in matching green tones for extra visibility.
Optional RVOL label (e.g., RVOL 1.84x) above or below the opening bar.
You can show the label only when the candle qualifies, or on every open.
Inputs (step-by-step)
Price-action filters
Open ≤ position in range (0–1): default 0.20. Smaller = stricter (must open nearer the low).
Close ≥ position in range (0–1): default 0.80. Larger = stricter (must close nearer the high).
Body ≥ fraction of range (0–1): default 0.55. Raise to demand a “fatter” body.
Require green candle?: default ON. Turn OFF to also mark bearish thrusts.
Minimum range (ticks): default 0. Set to 2–5 for liquid mid/large caps.
Time settings
Timezone: default America/New_York. Leave as is for US equities.
Start hour / minute: defaults 09:30. The bar that starts at this time is evaluated.
TRUE Opening-Bar RVOL (two-tier)
Require TRUE opening-bar RVOL?: ON = must pass Tier-1 to highlight; OFF = price filters alone can highlight (still shows Tier-2 when hit).
RVOL lookback (prior opens count): default 20. How many prior openings to average.
Min prior opens required: default 10. Warm-up guard.
Tier-1 RVOL threshold (× avg): default 1.00× (light green).
Tier-2 RVOL threshold (× avg): default 1.50× (dark green).
Display
Also paint candle body?: OFF by default. Turn ON for instant visibility on a chart wall.
Arrow size: tiny/small/normal/large.
Light/Dark opacity: tune highlight strength.
Show RVOL label?: ON/OFF.
Show label only when candle qualifies?: ON by default; OFF to see RVOL every open.
Label position: Above candle or Below candle.
Label size: tiny/small/normal/large.
How to use (quick start)
Apply to a 5-minute chart.
Keep defaults: Open ≤ 0.20, Close ≥ 0.80, Body ≥ 0.55, Require green ON.
Turn RVOL required ON, with Tier-1 = 1.0×, Tier-2 = 1.5×, Lookback = 20, Min prior = 10.
Optional: enable Paint bar and set Arrow size = large for monitor-wall visibility.
Optional: show RVOL label below the bar to keep wicks clean.
Interpretation:
Dark green = A+ opening thrust with strong participation (≥ Tier-2).
Light green = Valid opening thrust with at least average participation (≥ Tier-1).
No highlight = one or more filters failed (quantiles, body, green, range, or RVOL if required).
Alerts
Two alert conditions are included:
Opening 5m Match — Tier-2 RVOL → fires when the opening candle passes price filters and RVOL ≥ Tier-2.
Opening 5m Match — Tier-1 RVOL → fires when the opening candle passes price filters and RVOL ≥ Tier-1 (but < Tier-2).
Recommended alert settings
Condition: choose the script + desired tier.
Options: Once Per Bar Close (you want the confirmed 09:30–09:35 bar).
Set your watchlist to symbols of interest (themes/sectors) and let the alerts pull you to the right charts.
Recommended starting values
Quantiles: Open ≤ 0.20, Close ≥ 0.80
Body fraction: 0.55
Require green: ON
RVOL: Required ON, Tier-1 = 1.0×, Tier-2 = 1.5×, Lookback 20, Min prior 10
Display: Paint bar ON, Arrow large, Label ON, Below candle
Tune tighter for A-plus selectivity:
Open ≤ 0.15, Close ≥ 0.85, Body ≥ 0.65, Tier-2 2.0×.
Notes, tips & limitations
5-minute timeframe is the intended use. On higher TFs, the 09:30 bar spans more than 5 minutes; geometry may not reflect the first 5 minutes alone.
RTH only: The opening detection looks at the clock (09:30 ET). Pre-market bars are ignored for the signal and for RVOL history.
Warm-up period: Until you have Min prior opens required samples, the RVOL gate won’t pass. You can temporarily toggle RVOL off.
DST & timezone: Leave timezone on America/New_York for US equities. If you trade non-US exchanges, set the appropriate TZ and opening time.
Illiquid tickers: Use Minimum range (ticks) and require RVOL to reduce noise.
No strategy orders: This is a visual/alert tool. Combine with your execution and risk plan.
Why this is useful on multi-monitor setups
Instant pattern recognition: the two-shade green makes A vs A+ opens pop at a glance.
Adaptive thresholds: quantiles & body are within-bar, so it works across $5 and $500 names.
Fair volume test: TRUE opening RVOL avoids comparing to pre-market or midday bars.
Optional labels: glanceable RVOL x-value helps triage the strongest themes quickly.
Volume Bubbles & Liquidity Heatmap 30% + biasLuxAlgo gave us an open script, I just primmed it up with the use of Chat GPT:There is no single magic number (like “delta must be 800”) that will guarantee directional follow-through in every market. But you can make a mathematically rigorous filter that gives you a high-probability test — by normalizing the delta against that market’s typical behavior and requiring multiple confirmations. Below is a compact, actionable algorithm you can implement immediately (in your platform or spreadsheet) plus concrete thresholds and the math behind them.
High-IQ rule set (math + trade logic)
Use three independent checks. Only take the trade if ALL three pass.
1) Z-score (statistical significance of the delta)
Compute rolling mean
𝜇
μ and std dev
𝜎
σ of delta on the same timeframe (e.g. 5m) over a lookback window
𝑊
W (suggest
𝑊
=
50
W=50–200 bars).
𝑍
=
delta
bar
−
𝜇
𝑊
𝜎
𝑊
Z=
σ
W
delta
bar
−μ
W
Threshold: require
𝑍
≥
2.5
Z≥2.5 (strong) — accept 2.0 for less strict, 3.0 for very rare signals.
Why: a Z>=2.5 means this delta is an outlier (~<1% one-sided), not normal noise.
2) Relative Imbalance (strength vs total volume)
Compute imbalance ratio:
𝑅
=
∣
delta
bar
∣
volume
bar
R=
volume
bar
∣delta
bar
∣
Threshold: require
𝑅
≥
0.25
R≥0.25 (25% of the bar’s volume is one-sided). For scalping you can tighten to 0.30–0.40.
Why: a big delta with tiny volume isn’t meaningful; this normalizes to participation.
3) Net follow-through over a confirmation window
Look ahead
𝑁
N bars (or check the next bar if you need intrabar speed). Compute cumulative delta and price move:
cum_delta
𝑁
=
∑
𝑖
=
1
𝑁
delta
bar
+
𝑖
cum_delta
N
=
i=1
∑
N
delta
bar+i
price_move
=
close
bar
+
𝑁
−
close
bar
price_move=close
bar+N
−close
bar
Thresholds: require
cum_delta
𝑁
cum_delta
N
has the same sign as the trigger and
∣
cum_delta
𝑁
∣
≥
0.5
×
∣
delta
bar
∣
∣cum_delta
N
∣≥0.5×∣delta
bar
∣, and
price_move
price_move exceeds a minimum meaningful tick amount (instrument dependent). For ES / US30 type futures: price move ≥ 5–10 ticks; for forex pairs maybe 10–20 pips? Use ATR
20
20
×0.05 as a generic minimum.
Why: separates immediate absorption (buy delta then sellers soak it) from genuine continuation.
Bonus check — Structural context (must be satisfied)
Trigger should not occur against a strong structural barrier (VWAP, daily high/low, previous session POC) unless you’re explicitly trading exhaustion/absorption setups.
If signal occurs near resistance and price does not clear that resistance within
𝑁
N bars, treat as probable trap.
Putting it together — final trade decision
Take the long (example):
If
𝑍
≥
2.5
Z≥2.5 and
𝑅
≥
0.25
R≥0.25 and cum_delta_N confirms and no hard resistance above (or you’re willing to trade absorption), then enter.
Place stop: under the low of the last 2–3 bars or X ATR (instrument dependent).
Initial target: risk:reward 1:1 minimum, scale out at 1.5–2R after confirming further delta.
Concrete numeric illustration using your numbers
You saw FOL = 456, then sell reaction with ~350 opposite. How to interpret:
Suppose your 5-min rolling mean
𝜇
μ = 100 and
𝜎
σ=120 (example):
𝑍
=
(
456
−
100
)
/
120
≈
2.97
⇒
statistically big
Z=(456−100)/120≈2.97⇒statistically big
So it passes Z.
If volume on that bar = 2000 contracts:
𝑅
=
456
/
2000
=
0.228
⇒
just below 0.25 threshold
R=456/2000=0.228⇒just below 0.25 threshold
So it fails R (weak participation proportionally), explaining why 456 alone didn’t move price.
Seller came back with 350 opposite soon after — check cum_delta_N:
cum_delta
𝑛
𝑒
𝑥
𝑡
3
≈
456
−
350
=
106
net
cum_delta
next3
≈456−350=106 net
Net is small relative to the initial spike — not convincing follow-through.
Conclusion: despite a big absolute number (456), relative measures and lack of follow-through meant the move failed. That’s exactly why raw numbers alone are unreliable.
Advanced refinement (for elite performance)
Use rolling median + MAD instead of mean/std if delta distribution is skewed.
Scale Z by volume volatility: divide Z by
volume
bar
/
volume
‾
volume
bar
/
volume
to penalize low-volume bars.
Use a signed cumulative delta over micro-windows: compute windowed cumulative delta standardized:
𝑍
cum
=
∑
𝑖
=
0
𝑀
−
1
delta
𝑡
−
𝑖
−
𝑀
𝜇
𝑀
𝜎
Z
cum
=
M
σ
∑
i=0
M−1
delta
t−i
−Mμ
and require
𝑍
cum
≥
3
Z
cum
≥3 for very high confidence.
Add market-depth / DOM confirmation (if available): require that resting ask size above is less than resting bid size below by a factor (i.e. visible liquidity supports the move).
Practical thresholds to start with (tune per instrument)
Lookback
𝑊
W: 100 bars (5m → about a trading day)
Z threshold: 2.5
Imbalance ratio
𝑅
R: ≥ 0.25 (tighten to 0.30 for scalping)
Confirmation window
𝑁
N: next 1–3 bars for intraday scalps; 3–6 bars for short swings
Cum delta confirmation: ≥ 0.5 × initial delta and same sign
Price move confirmation: ≥ 0.03 × ATR20 (or set absolute ticks per instrument)
TL;DR — the single best rule
Don’t chase absolute numbers. Use Z-score of delta + delta/volume ratio + real follow-through. If all three align, odds are heavily in your favor.
If you want, I can:
give you a tiny script (pseudocode or Pine / Python) that computes Z, R, cum_delta_N and flags qualifying bars, or
run the calculation on a sample of your recent bars if you paste a small CSV of time, delta, volume, close.
Which do you want? (I’ll give code right away.)
You said:
give me a percentage of difference where we have a high probability
ChatGPT said:
Thought for 7s
Nice — straight to the point. Here’s a concise, practical set of percentage thresholds (and associated confidence estimates) you can use right now to flag a “high probability” delta signal. I’ll give you three tiers (good / strong / elite), explain what each means, show how to compute it, and give a short example using your 456/2000 bar.
One-line rule
Compute delta percent
𝑃
=
∣
delta
∣
volume
×
100
%
P=
volume
∣delta∣
×100%.
Then require Z-score of delta ≥ 2.5 and P to be at or above the threshold below for the desired confidence tier.
Threshold tiers (percent of bar volume)
Good (high-probability trade candidate)
P ≥ 20–25%
Typical success probability (when combined with Z≥2.5 and no hard structural resistance): ~60–70%.
Use when you want a steady flow of signals with decent edge.
Strong (high confidence)
P ≥ 30–35%
Typical success probability: ~70–80% (with Z≥2.5 + structural alignment).
Fewer signals, higher win-rate. Good default for intraday.
Elite (very high probability / low false positives)
P ≥ 40–50%
Typical success probability: ~80–90% (with Z≥3 and confirmation).
Rare signals. Use for meaningful size or when you need maximum certainty.
Why percentage matters (short)
Absolute delta (456) is meaningless without volume context. A 456 delta on 2,000 volume → P = 456/2000 = 22.8% → sits just below the Good threshold, which matches why it failed: decent but not dominant participation.
Additional required checks (don’t skip these)
To turn P into a reliable filter, always require:
Z-score of the delta ≥ 2.5 (or ≥3 for Elite signals).
No immediate structural barrier (VWAP, strong resistance) that would plausibly absorb the order.
Follow-through: within next N bars (N = 1–3 for scalps) price moves in the same direction by ≥ 0.03×ATR20 (or instrument-specific tick threshold). If this fails, cut fast.
Combine all three and your realized win-rate will approach the probabilities above.
Practical quick checklist (to apply each signal)
Compute P = |delta|/volume. Is P ≥ 30%? (or your chosen tier)
Compute Z = (delta − mean)/std over last 100 bars. Is Z ≥ 2.5?
Is price not pinned under a heavy resistance?
Enter on next bar close (or intrabar on continuation), stop under last 2-bar low (for longs).
If price fails to move ≥ 0.03×ATR20 within 3 bars, exit.
Example (your bar)
delta = 456, volume = 2000 → P = 22.8% → below Good threshold (25%).
Even if Z was high, P failed — explains the failure. You need P ≥ ~30% plus Z≥2.5 to call it a Strong signal.
Final notes (instrument & timeframe)
These percentages were calibrated for futures/US indices and short intraday bars (1–5m).
For FX or low-tick instruments, use absolute ticks + a smaller P threshold (start at 15–20%).
Always backtest on the specific instrument/timeframe and tune thresholds.
If you want, I’ll generate a tiny script (Python or Pine) that calculates P and Z and flags Good/Strong/Elite signals for your chart history so you can see exact historical hit rates. Which language (Python or Pine)?
You said:
so if we have 456 g vs 350 r what pct is that in favour of green?
ChatGPT said:
Perfect — let’s calculate it carefully, digit by digit so we don’t make a slip.
We have:
Green (buy) volume = 456
Red (sell) volume = 350
We want to know what percentage is in favor of green, relative to the total volume.
Step 1. Compute total volume
Total
=
456
+
350
=
806
Total=456+350=806
Step 2. Compute green’s share
\text{Green %} = \frac{456}{806} \times 100
Now do it precisely:
456
÷
806
=
0.565506
456÷806=0.565506 (rounded)
So:
0.565506
×
100
=
56.55
%
0.565506×100=56.55%
Step 3. Compute red’s share (for context)
350
806
=
0.434494
→
43.45
%
806
350
=0.434494→43.45%
Step 4. Compute difference (bias toward green)
56.55
%
−
43.45
%
=
13.10
%
56.55%−43.45%=13.10%
✅ Final answer:
Green = 56.6% of total
Red = 43.4% of total
Bias = +13.1 percentage points in favor of green
So that’s only a 13% advantage to buyers — modest pressure, not a dominant imbalance.
For a high-probability signal (as we discussed earlier), you generally want ≥30% imbalance (e.g. ~65/35 split or stronger).
Original:
''The Volume Bubbles & Liquidity Heatmap indicator is a powerful trading tool designed to give traders a clearer picture of volume dynamics and liquidity distribution across multiple timeframes. By combining dynamic volume bubbles with a liquidity heatmap, this indicator makes it easy to identify areas of price interest, spot market imbalances, and improve decision-making for both scalpers and swing traders.
This trading indicator is ideal for volume traders, price action traders, and liquidity-focused traders who need a clean, multi-dimensional view of buyer/seller activity and the zones where market participants are most active. With full customization over bubble display, timeframes, and visual settings, traders can tailor the tool to fit virtually any trading strategy or market.''
gex 1//@version=5
indicator("SPY Gamma Levels ", overlay=true)
// Generated from GEX Scanner at 2025-10-06 16:30 UTC
// Symbol: SPY | Spot: 671.39
// Analysis includes all expirations
// Symbol Validation - Only display levels for correct ticker
expectedSymbol = "SPY"
isCorrectSymbol = syminfo.ticker == expectedSymbol
// Warning System for Wrong Symbol
if not isCorrectSymbol and barstate.islast
warningTable = table.new(position.top_right, 1, 1, bgcolor=color.red, border_width=2)
table.cell(warningTable, 0, 0, "⚠️ WRONG SYMBOL!\nThis script is for " + expectedSymbol + "\nCurrent chart: " + syminfo.ticker, text_color=color.white, bgcolor=color.red, text_size=size.normal)
// Zero Gamma Level
zero_gamma = 471.66
// Max Pain Strike
max_pain = 659.00
// Major Resistance Levels (Negative Gamma)
resistance_1 = 655.00 // GEX: -215M (minor)
resistance_2 = 663.00 // GEX: -104M (minor)
resistance_3 = 668.00 // GEX: -57M (minor)
// Major Support Levels (Positive Gamma)
support_1 = 675.00 // GEX: +708M (moderate)
support_2 = 680.00 // GEX: +595M (moderate)
support_3 = 670.00 // GEX: +458M (minor)
// Plot Key Levels
plot(isCorrectSymbol ? zero_gamma : na, "Zero Gamma", color=color.yellow, linewidth=3, style=plot.style_line)
if isCorrectSymbol and barstate.islast
label.new(bar_index, zero_gamma, "Zero Gamma\n$471.66", color=color.yellow, style=label.style_label_left, textcolor=color.black, size=size.normal)
plot(isCorrectSymbol ? max_pain : na, "Max Pain", color=color.purple, linewidth=2, style=plot.style_circles)
if isCorrectSymbol and barstate.islast
label.new(bar_index, max_pain, "Max Pain\n$659.00", color=color.purple, style=label.style_label_right, textcolor=color.white, size=size.small)
// TOP 3 RESISTANCE LEVELS (Strongest Negative Gamma)
plot(isCorrectSymbol ? resistance_1 : na, "★R1: $655", color=color.red, linewidth=4, style=plot.style_line)
if isCorrectSymbol and barstate.islast
label.new(bar_index, resistance_1, "★R1 (TOP)\n$655\n-215M", color=color.red, style=label.style_label_left, textcolor=color.white, size=size.normal)
plot(isCorrectSymbol ? resistance_2 : na, "★R2: $663", color=color.new(color.red, 20), linewidth=3, style=plot.style_line)
if isCorrectSymbol and barstate.islast
label.new(bar_index, resistance_2, "★R2 (TOP)\n$663\n-104M", color=color.new(color.red, 20), style=label.style_label_left, textcolor=color.white, size=size.normal)
plot(isCorrectSymbol ? resistance_3 : na, "★R3: $668", color=color.new(color.red, 40), linewidth=2, style=plot.style_line)
if isCorrectSymbol and barstate.islast
label.new(bar_index, resistance_3, "★R3 (TOP)\n$668\n-57M", color=color.new(color.red, 40), style=label.style_label_left, textcolor=color.white, size=size.normal)
// TOP 3 SUPPORT LEVELS (Strongest Positive Gamma)
plot(isCorrectSymbol ? support_1 : na, "★S1: $675", color=color.lime, linewidth=4, style=plot.style_line)
if isCorrectSymbol and barstate.islast
label.new(bar_index, support_1, "★S1 (TOP)\n$675\n+708M", color=color.lime, style=label.style_label_right, textcolor=color.black, size=size.normal)
plot(isCorrectSymbol ? support_2 : na, "★S2: $680", color=color.new(color.lime, 20), linewidth=3, style=plot.style_line)
if isCorrectSymbol and barstate.islast
label.new(bar_index, support_2, "★S2 (TOP)\n$680\n+595M", color=color.new(color.lime, 20), style=label.style_label_right, textcolor=color.black, size=size.normal)
plot(isCorrectSymbol ? support_3 : na, "★S3: $670", color=color.new(color.lime, 40), linewidth=2, style=plot.style_line)
if isCorrectSymbol and barstate.islast
label.new(bar_index, support_3, "★S3 (TOP)\n$670\n+458M", color=color.new(color.lime, 40), style=label.style_label_right, textcolor=color.black, size=size.normal)
// ==== TOP 3 GAMMA LEVELS SUMMARY ====
// STRONGEST RESISTANCE (Above $671.39):
// R1: $655.00 | -215M GEX | MINOR
// R2: $663.00 | -104M GEX | MINOR
// R3: $668.00 | -57M GEX | MINOR
// STRONGEST SUPPORT (Below $671.39):
// S1: $675.00 | +708M GEX | MODERATE
// S2: $680.00 | +595M GEX | MODERATE
// S3: $670.00 | +458M GEX | MINOR
// =====================================
// Usage Notes:
// - ★ TOP 3 LEVELS: Thickest lines (4px→3px→2px) with star symbols
// - Resistance levels (red): Negative gamma, potential price ceiling
// - Support levels (lime): Positive gamma, potential price floor
// - Zero Gamma (yellow): Gamma flip point - thicker line for visibility
// - Max Pain (purple): Strike with maximum option value decay
// - Color intensity: Darker = stronger level (top levels are most prominent)
// - Labels show strike prices, GEX values, and ranking for easy reference
// - Focus on TOP 3 levels for key trading decisions
// - Update this indicator throughout the trading day as levels change
Multi-Symbol and Multi-Timeframe Supertrend Screener [Pineify]Multi-Symbol and Multi-Timeframe Supertrend Screener
Advanced Supertrend screener for TradingView that monitors 6 symbols across 4 timeframes simultaneously. Features customizable ATR periods, visual alerts, and color-coded trend direction displays for efficient market scanning.
Key Features
The Supertrend Screener is a comprehensive multi-symbol market monitoring tool that displays Supertrend indicator signals across multiple assets and timeframes in a single, organized table view. This screener eliminates the need to manually check individual charts by providing real-time trend analysis for up to 6 symbols across 4 different timeframes simultaneously.
How It Works
The screener utilizes the proven Supertrend indicator methodology, which combines Average True Range (ATR) and price action to determine trend direction. The core calculation involves:
Computing the ATR using a customizable period (default: 10)
Applying a multiplication factor (default: 3.0) to create dynamic support/resistance levels
Determining trend direction based on price position relative to these levels
Displaying results through color-coded cells with customizable text labels
The indicator employs the request.security() function to fetch data from multiple symbols and timeframes, ensuring accurate cross-market analysis without chart switching.
Trading Ideas and Insights
This screener excels in several trading scenarios:
Market Overview: Quickly assess overall market sentiment across major cryptocurrencies or forex pairs
Trend Confirmation: Verify trend alignment across multiple timeframes before entering positions
Divergence Spotting: Identify when shorter timeframes diverge from longer-term trends
Opportunity Scanning: Locate assets showing consistent trend direction across all monitored timeframes
Risk Management: Monitor multiple positions simultaneously to spot potential trend reversals
The screener is particularly effective for swing traders and position traders who need to monitor multiple assets without constantly switching between charts.
How Multiple Indicators Work Together
While this screener focuses specifically on the Supertrend indicator, it incorporates several complementary technical analysis components:
ATR Foundation: Uses Average True Range to adapt to market volatility, making the indicator responsive to current market conditions
Multi-Timeframe Analysis: Combines signals from 1-minute, 5-minute, 10-minute, and 30-minute timeframes to provide comprehensive trend perspective
Price Action Integration: The Supertrend calculation inherently incorporates price action by using high, low, and close values
Volatility Adjustment: The ATR-based calculation ensures the indicator adapts to different volatility regimes across various assets
The synergy between these elements creates a robust screening system that accounts for both momentum and volatility , providing more reliable trend identification than single-timeframe analysis.
Unique Aspects
Several features distinguish this screener from standard Supertrend implementations:
Table-Based Display: Presents data in an organized, space-efficient format rather than overlay plots
Customizable Visual Elements: Full control over text labels, colors, and background styling
Multi-Asset Capability: Monitors 6 different symbols simultaneously without performance degradation
Efficient Resource Usage: Optimized code structure minimizes calculation overhead
Professional Presentation: Clean, institutional-grade visual design suitable for trading desks
How to Use
Symbol Configuration: Input your desired symbols in the Symbol section (default includes major crypto pairs)
Timeframe Setup: Configure four timeframes for analysis (default: 1m, 5m, 10m, 30m)
Supertrend Parameters: Adjust the Factor (sensitivity) and ATR Period according to your trading style
Visual Customization: Set custom text labels and colors for up/down trends
Market Analysis: Monitor the table for consistent signals across timeframes and symbols
Interpretation Guide:
- Green cells indicate uptrend (price above Supertrend line)
- Red cells indicate downtrend (price below Supertrend line)
- Look for alignment across multiple timeframes for stronger signal confidence
Customization
The screener offers extensive customization options:
Factor Setting: Adjust sensitivity (higher values = less sensitive, fewer signals)
ATR Period: Modify lookback period for volatility calculation
Text Labels: Customize up/down trend display text
Color Scheme: Full RGB color control for text and background elements
Symbol Selection: Monitor any TradingView-supported symbols
Timeframe Array: Choose any four timeframes for comprehensive analysis
Conclusion
The Supertrend Screener transforms traditional single-chart analysis into an efficient, multi-dimensional market monitoring system. By combining the reliability of the Supertrend indicator with multi-timeframe and multi-symbol capabilities, this tool empowers traders to make more informed decisions with greater market context.
Whether you're managing multiple positions, scanning for new opportunities, or confirming trend direction before entries, this screener provides the comprehensive overview needed for professional trading operations. The clean interface and customizable features make it suitable for traders of all experience levels while maintaining the analytical depth required for serious market analysis.
Perfect for day traders, swing traders, and anyone requiring efficient multi-market trend monitoring in a single view.
Euro Area vs US10YThe Euro Area GDP-Weighted Yield vs US10Y Spread is a macroeconomic indicator designed for forex traders and institutional investors who want to monitor the fundamental interest rate differential between the Eurozone and the United States. This tool aggregates sovereign bond yields from the major Eurozone member states using a weighted methodology based on outstanding government debt, providing a comprehensive view of the Euro Area’s fixed income market dynamics.
This indicator calculates a composite 10-year government bond yield for the Eurozone by combining data from seven major member countries: Germany, France, Italy, Spain, Netherlands, Belgium, and Austria. The weights are based on the proportion of government debt outstanding in each country, reflecting the actual composition of the European sovereign bond market rather than just GDP size.
The indicator then compares this Euro Area weighted yield against the US 10-Year Treasury yield (US10Y), producing a yield spread that serves as a powerful leading indicator for EUR/USD price movements.
FirstStrike Long 200 - Daily Trend Rider [KedArc Quant]Strategy Description
FirstStrike Long 200 is a disciplined, long-only momentum strategy designed for daily "strike-first" entries in trending markets. It scans for RSI momentum above a customizable trigger (default 50), confirmed by EMA trend filters, and limits you to *exactly one trade per day* to avoid overtrading. It uses ATR for dynamic risk management (1.5x stop, 2:1 RR target) and optional trailing stops to ride winners. Backtested with realistic commissions and sizing, it prioritizes low drawdowns (<1% max in tests) over aggressive gains—ideal for swing traders seeking quality setups in bull runs.
Why It's Different from Other Strategies
Unlike generic RSI crossover bots or EMA ribbon mashups that spam signals and bleed in chop, FirstStrike enforces a "one-and-done" daily gate, blending precision momentum (RSI modes with grace/sustain) with robust filters (volume, sessions, rearm dips).
How It Helps Traders
- Reduces Emotional Trading: One entry/day forces discipline—miss a setup? Wait for tomorrow. Perfect for busy pros avoiding screen fatigue.
- Adapts to Regimes: Switch modes for trends ("Cross+Grace") vs. ranges ("Any bar")—boosts win rates 5-10% in backtests on high-beta names like .
- Risk-First Design: ATR scales stops to vol capping DD at 0.2% while targeting 2R winners. Trailing option locks +3-5% runs without early exits.
- Quick Insights: Labels/alerts flag entries with RSI values; bgcolor highlights signals for visual scanning. Helps spot "first-strike" edges in uptrends, filtering ~60% noise.
Why This Is Not a Mashup
This isn't a Frankenstein of off-the-shelf indicators—while it uses standard RSI/EMA/ATR (core Pine primitives), the innovation lies in:
- Custom Trigger Engine: Switchable modes (e.g., "Cross+Grace+Sustain" requires post-cross hold) prevent perpetual signals, unlike basic `ta.crossover()`.
- Daily Rearm Gate: Resets eligibility only after a dip (if enabled), tying momentum to mean-reversion—original logic not found in common scripts.
- Per-Day Isolation: `var` vars + `ta.change(time("D"))` ensure zero pyramiding/overlaps, beyond simple session filters.
All formulae are derived in-house for "first-strike" (early RSI pops in trends), not copied from public repos.
Input Configurations
Let's break down every input in the FirstStrike Long 200 strategy. These settings let you tweak the strategy like a dashboard—start with defaults for quick testing,
then adjust based on your asset or timeframe (5m for intraday). They're grouped logically to keep things organized, and most have tooltips in the script for quick reminders.
RSI / Trigger Group: The Heart of Momentum Detection
This is where the magic starts—the strategy hunts for "upward energy" using RSI (Relative Strength Index), a tool that measures if a stock is overbought (too hot) or oversold (too cold) on a 0-100 scale.
- RSI Length: How many bars (candles) back to calculate RSI. Default is 14, like a 14-day window for daily charts. Shorter (e.g., 9) makes it snappier for fast markets; longer (21) smooths out noise but misses quick turns.
- Trigger Level (RSI >= this): The key RSI value where the strategy says, "Go time!" Default 50 means enter when RSI crosses or holds above the neutral midline. Why is this trigger required? It acts as your "green light" filter—without it, you'd enter on every tiny price wiggle, leading to endless losers. RSI above this shows building buyer power, avoiding weak or sideways moves. It's essential for quality over quantity, especially in one-trade-per-day setups.
- Trigger Mode: Picks how strict the RSI signal must be. Options: "Cross only" (exact RSI crossover above trigger—super precise, fewer trades); "Cross+Grace" (crossover or within a grace window after—gives a second chance); "Cross+Grace+Sustain" (crossover/grace plus RSI holding steady for bars—best for steady climbs); "Any bar >= trigger" (looser, any bar above—more opportunities but riskier in chop). Start with "Any bar" for trends, switch to "Cross only" for caution.
- Grace Window (bars after cross): If mode allows, how many bars post-RSI-cross you can still enter if RSI dips but recovers. Default 30 (about 2.5 hours on 5m). Zero means no wiggle room—pure precision.
- Sustain Bars (RSI >= trigger): In sustain mode, how many straight bars RSI must stay above trigger. Default 3 ensures it's not a fluke spike.
- Require RSI Dip Below Rearm Before Any Entry?: A yes/no toggle. If on, the strategy "rearms" only after RSI dips below a low level (like a breather), preventing back-to-back signals in overextended rallies.
- Rearm Level (if requireDip=true): The dip threshold for rearming. Default 45—RSI must go below this to reset eligibility. Lower (30) for deeper pullbacks in volatile stocks.
For the trigger level itself, presets matter a lot—default 50 is neutral and versatile for broad trends. Bump to 55-60 for "strong momentum only" (fewer but higher-win trades, great in bull runs like tech surges); drop to 40-45 for "early bird" catches in recoveries (more signals but watch for fakes in ranges). The optimize hint (40-60) lets you test these in TradingView to match your risk—higher presets cut noise by 20-30% in backtests.
Trend / Filters Group: Keeping You on the Right Side of the Market
These EMAs (Exponential Moving Averages) act like guardrails, ensuring you only long in uptrends.
- EMA (Fast) Confirmation: Short-term EMA for price action. Default 20 periods—price must be above this for "recent strength." Shorter (10) reacts faster to intraday pops.
- EMA (Trend Filter): Long-term EMA for big-picture trend. Default 200 (classic "above the 200-day" rule)—price above it confirms bull market. Minimum 50 to avoid over-smoothing.
Optional Hour Window Group: Timing Your Strikes
Avoid bad hours like lunch lulls or after-hours tricks.
- Restrict by Session?: Yes/no for using exact market hours. Default off.
- Session (e.g., 0930-1600 for NYSE): Time string like "0930-1600" for open to close. Auto-skips pre/post-market noise.
- Restrict by Hour Range?: Fallback yes/no for simple hours. Default off.
- Start Hour / End Hour: Clock times (0-23). Defaults 9-15 ET—focus on peak volume.
Volume Filter Group: No Volume, No Party
Confirms conviction—big moves need big participation.
- Require Volume > SMA?: Yes/no toggle. Default off—only fires on above-average volume.
- Volume SMA Length: Periods for the average. Default 20—compares current bar to recent norm.
Risk / Exits Group: Protecting and Profiting Smartly
Dynamic stops based on volatility (ATR = Average True Range) keep things realistic.
- ATR Length: Bars for ATR calc. Default 14—measures recent "wiggle room" in price.
- ATR Stop Multiplier: How far below entry for stop-loss. Default 1.5x ATR—gives breathing space without huge risk
- Take-Profit R Multiple: Reward target as multiple of risk. Default 2.0 (2:1 ratio)—aims for twice your stop distance.
- Use Trailing Stop?: Yes/no for profit-locking trail. Default off—activates after entry.
- Trailing ATR Multiplier: Trail distance. Default 2.0x ATR—looser than initial stop to let winners run.
These inputs make the strategy plug-and-play: Defaults work out-of-box for trending stocks, but tweak RSI trigger/modes first for your style.
Always backtest changes—small shifts can flip a 40% win rate to 50%+!
Outputs (Visuals & Alerts):
- Plots: Blue EMA200 (trend line), Orange EMA20 (price filter), Green dashed entry price.
- Labels: Green "LONG" arrow with RSI value on entries.
- Background: Light green highlight on signal bars.
- Alerts: "FirstStrike Long Entry" fires on conditions (integrates with TradingView notifications).
Entry-Exit Logic
Entry (Long Only, One Per Day):
1. Daily Reset: New day clears trade gate and (if required) rearm status.
2. Filters Pass: Time/session OK + Close > EMA200 (trend) + Close > EMA20 (price) + Volume > SMA (if enabled) + Rearmed (dip below rearm if toggled).
3. Trigger Fires: RSI >= trigger via selected mode (e.g., crossover + grace window).
4. Execute: Enter long at close; set daily flag to block repeats.
Exit:
- Stop-Loss: Entry - (ATR * 1.5) – dynamic, vol-scaled.
- Take-Profit: Entry + (Risk * 2.0) – fixed RR.
- Trailing (Optional): Activates post-entry; trails at Close - (ATR * 2.0), updating on each bar for trend extension.
No shorts or hedging—pure long bias.
Formulae Used
- RSI: `ta.rsi(close, rsiLen)` – Standard 14-period momentum oscillator (0-100).
- EMAs: `ta.ema(close, len)` – Exponential moving averages for trend/price filters.
- ATR: `ta.atr(atrLen)` – True range average for stop sizing: Stop = Entry - (ATR * mult).
- Volume SMA: `ta.sma(volume, volLen)` – Simple average for relative strength filter.
- Grace Window: `bar_index - lastCrossBarIndex <= graceBars` – Counts bars since RSI crossover.
- Sustain: `ta.barssince(rsi < trigger) >= sustainBars` – Consecutive bars above threshold.
- Session Check: `time(timeframe.period, sessionStr) != 0` – TradingView's built-in session validator.
- Risk Distance: `riskPS = entry - stop; TP = entry + (riskPS * RR)` – Asymmetric reward calc.
FAQ
Q: Why only one trade/day?
A: Prevents revenge trading in volatile sessions . Backtests show it cuts losers by 20-30% vs. multi-entry bots.
Q: Does it work on all assets/timeframes?
A: Best for trending stocks/indices on 5m-1H. Test on crypto/forex with wider ATR mult (2.0+).
Q: How to optimize?
A: Use TradingView's optimizer on RSI trigger (40-60) and EMA fast (10-30). Aim for PF >1.0 over 1Y data.
Q: Alerts don't fire—why?
A: Ensure `alertcondition` is enabled in script settings. Test with "Any alert() function calls only."
Q: Trailing stop too loose?
A: Tune `trailMult` to 1.5 for tighter; it activates alongside fixed TP/SL for hybrid protection.
Glossary
- Grace Window: Post-RSI-cross period (bars) where entry still allowed if RSI holds trigger.
- Rearm Dip: Optional pullback below a low RSI level (e.g., 45) to "reset" eligibility after signals.
- Profit Factor (PF): Gross profit / gross loss—>1.0 means winners outweigh losers.
- R Multiple: Risk units (e.g., 2R = 2x stop distance as target).
- Sustain Bars: Consecutive bars RSI stays >= trigger for mode confirmation.
Recommendations
- Backtest First: Run on your symbols (/) over 6-12M; tweak RSI to 55 for +5% win rate.
- Live Use: Start paper trading with `useSession=true` and `useVol=true` to filter noise.
- Pairs Well With: Higher TF (daily) for bias; add ADX (>25) filter for strong trends (code snippet in prior chats).
- Risk Note: 10% sizing suits $100k+ accounts; scale down for smaller. Not financial advice—past performance ≠ future.
- Publish Tip: Add tags like "momentum," "RSI," "long-only" on TradingView for visibility.
Strategy Properties & Backtesting Setup
FirstStrike Long 200 is configured with conservative, realistic backtesting parameters to ensure reliable performance simulations. These settings prioritize capital preservation and transparency, making it suitable for both novice and experienced traders testing on stocks.
Initial Capital
$100,000 Standard starting equity for portfolio-level testing; scales well for retail accounts. Adjust lower (e.g., $10k) for smaller simulations.
Base Currency
Default (USD) Aligns with most US equities (e.g., NASDAQ symbols); auto-converts for other assets.
Order Size
1 (Quantity) Fixed share contracts for simplicity—e.g., buys 1 share per trade. For % of equity, switch to "Percent of Equity" in strategy code.
Pyramiding
0 Orders No additional entries on open positions; enforces strict one-trade-per-day discipline to avoid overexposure.
Commission
0.1% Realistic broker fee (e.g., Interactive Brokers tier); factors in round-trip costs without over-penalizing winners.
Verify Price for Limit Orders
0 Ticks No slippage delay on TPs—assumes ideal fills for historical accuracy.
Slippage
0 Ticks Zero assumed slippage for clean backtests; real-world trading may add 1-2 ticks on volatile opens.
These defaults yield low drawdowns (<0.3% max in tests) while capturing trend edges. For live trading, enable slippage (1-3 ticks) to mimic execution gaps. Always forward-test before deploying!
⚠️ Disclaimer
This script is provided for educational purposes only.
Past performance does not guarantee future results.
Trading involves risk, and users should exercise caution and use proper risk management when applying this strategy.