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.
Tìm kiếm tập lệnh với "a股近10年第二天溢价的股票"
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.
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.
VWAP Deviation Oscillator [BackQuant]VWAP Deviation Oscillator
Introduction
The VWAP Deviation Oscillator turns VWAP context into a clean, tradeable oscillator that works across assets and sessions. It adapts to your workflow with four VWAP regimes plus two rolling modes, and three deviation metrics: Percent, Absolute, and Z-Score. Colored zones, optional standard deviation rails, and flexible plot styles make it fast to read for both trend following and mean reversion.
What it does
This tool measures how far price is from a chosen VWAP and expresses that gap as an oscillator. You can view the deviation as raw price units, percent, or standardized Z-Score. The plot can be a histogram or a line with optional fills and sigma bands, so you can quickly spot polarity shifts, overbought and oversold conditions, and strength of extension.
VWAP modes track a session VWAP that resets (4H, Daily, Weekly) or a rolling VWAP that updates continuously over a fixed number of bars or days.
Deviation modes let you choose the lens: Percent, Absolute, or Z-Score. Each highlights different aspects of stretch and mean pressure.
Visual encoding uses a 10-zone color palette to grade the magnitude of deviation on both sides of zero.
Volatility guards compute mode-specific sigma so thresholds are stable even when volatility compresses.
Why this works
VWAP is a high signal anchor used by institutions to gauge fair participation. Deviations around VWAP cluster in regimes: mild oscillations within a band, decisive pushes that signal imbalance, and standardized extremes that often precede either continuation or snapback. Expressing that distance as a single time series adds clarity: bias is the oscillator’s sign, risk context is its magnitude, and regime is the way it behaves around sigma lines.
How to use it
Trend following
Favor the side of the zero line. Bullish when the oscillator is above zero and making higher swing highs. Bearish when below zero and making lower swing lows. Use +1 sigma and +2 sigma in your mode as strength tiers. Pullbacks that hold above zero in uptrends, or below zero in downtrends, are often continuation entries.
Mean reversion
Fade stretched readings when structure supports it. Look for tests of +2 sigma to +3 sigma that fail to progress and roll back toward zero, or the mirror on the downside. Z-Score mode is best when you want standardized gates across assets. Percent mode is intuitive for intraday scalps where a given percent stretch tends to mean revert.
Session playbook
Use Daily or Weekly VWAP for intraday or swing context. Rolling modes help when the asset lacks clean session boundaries or when you want a continuous anchor that adapts to liquidity shifts.
Key settings
VWAP computation
VWAP Mode = 4 Hours, Daily, Weekly, Rolling (Bars), Rolling (Days). Session modes reset the VWAP when a new session begins. Rolling modes compute VWAP over a fixed trailing window.
Rolling (Lookback: Bars) controls the trailing bar count when using Rolling (Bars).
Rolling (Lookback: Days) converts days to bars at runtime and uses that trailing span.
Use Close instead of HLC3 switches the price reference. HLC3 is smoother. Close makes the anchor track settlement more tightly.
Deviation measurement
Deviation Mode
Percent : 100 * (Price / VWAP - 1). Good for uniform scaling across instruments.
Absolute : Price - VWAP. Good when price units themselves matter.
Z-Score : Standardizes the absolute residual by its own mean and standard deviation over Z/Std Window . Ideal for cross-asset comparability and regime studies.
Z/Std Window sets the mean and standard deviation window for Z-Score mode.
Volatility controls
Percent Mode Volatility Lookback estimates sigma for percent deviations.
Absolute Mode Volatility Lookback estimates sigma for absolute deviations.
Minimum Sigma Guard (pct pts) prevents the percent sigma from collapsing to near zero in extremely quiet markets.
Visualization
Plot Type = Histogram or Line. Histogram emphasizes impulse and polarity changes. Line emphasizes trend waves and divergences.
Positive Color / Negative Color define the palette for line mode. Histogram uses a 10-bucket gradient automatically.
Show Standard Deviations plots symmetric rails at ±1, ±2, ±3 sigma in the current mode’s units.
Fill Line Oscillator and Fill Opacity add a soft bias band around zero for line mode.
Line Width affects both the oscillator and the sigma rails.
Reading the zones
The oscillator’s color and height map deviation to nine graded buckets on each side of zero, with deeper greens above and deeper reds below. In Percent and Absolute modes, those buckets are scaled by their mode-specific sigma. In Z-Score mode the bucket edges are fixed at 0.5, 1.0, 2.0, and 2.8.
0 to +1 sigma weak positive bias, usually rotational.
+1 to +2 sigma constructive impulse. Pullbacks that hold above zero often continue.
+2 to +3 sigma strong expansion. Watch for either trend continuation or exhaustion tells.
Beyond +3 sigma statistical extreme. Requires structure to avoid fading too soon.
Mirror logic applies on the negative side.
Suggested workflows
Trend continuation checklist
Pick a session VWAP that matches your timeframe, for example Daily for intraday or Weekly for position trades.
Wait for the oscillator to hold the correct side of zero and for a sequence of higher swing lows in the oscillator (uptrend) or lower swing highs (downtrend).
Buy pullbacks that stabilize between zero and +1 sigma in an uptrend. Sell rallies that stabilize between zero and -1 sigma in a downtrend.
Use the next sigma band or a prior price swing as your target reference.
Mean reversion checklist
Switch to Z-Score mode for standardized thresholds.
Identify tests of ±2 sigma to ±3 sigma that fail to extend while price meets support or resistance.
Enter on a polarity change through the prior histogram bar or a small hook in line mode.
Fade back to zero or to the opposite inner band, then reassess.
Notes on the three modes
Percent is easy to reason about when you care about proportional stretch. It is well suited to intraday and multi-asset dashboards.
Absolute tracks cash distance from VWAP. This is useful when instruments have tight ticks and you plan risk in price units.
Z-Score standardizes the residual and is best for quant studies, cross-asset comparisons, and threshold research that must be scale invariant.
What the alerts can tell you
Polarity changes at zero can mark the start or end of a leg.
Crosses of ±1 sigma identify overbought or oversold in the current mode’s units.
Zone changes signal an upgrade or downgrade in deviation strength.
Troubleshooting and edge cases
If your instrument has long flat periods, keep Minimum Sigma Guard above zero in Percent mode so the rails do not vanish.
In Rolling modes, very short windows will respond quickly but can whip around. Session modes smooth this by resetting at well known boundaries.
If Z-Score looks erratic, increase Z/Std Window to stabilize the estimate of mean and sigma for the residual.
Final thoughts
VWAP is the anchor. The deviation oscillator is the narrative. By separating bias, magnitude, and regime into a simple stream you can execute faster and review cleaner. Pick the VWAP mode that matches your horizon, choose the deviation lens that matches your risk framework, and let the color graded zones guide your decisions.
3/4-Bar GRG / RGR Pattern (Conditional 4th Candle)This indicator can be used to identify the Green-Red-Green or Red-Green-Red pattern.
It is a price action indicator where a price action which identifies the defeat of buyers and sellers.
If the buyers comprehensively defeat the sellers then the price moves up and if the sellers defeat the buyers then the price moves down.
In my trading experience this is what defines the price movement.
It is a 3 or 4 candle pattern, beyond that i.e, 5 or more candles could mean a very sideways market and unnecessary signal generation.
How does it work?
Upside/Green signal
Say candle 1 is Green, which means buyers stepped in, then candle 2 is Red or a Doji, that means sellers brought the price down. Then if candle 3 is forming to be Green and breaks the closing of the 1st candle and opening of the 2nd candle, then a green arrow will appear and that is the place where you want to take your trade.
Here the buyers defeated the sellers.
Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
Important - We need to enter the trade as soon as the price moves above the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close. Ignore wicks.
I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
I call it the +-+ or GRG pattern.
Stop loss can be candle 2's mid for safe traders (that includes me) or candle 2's body low for risky traders.
Back testing suggests that body low will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
Downside/Red signal
Say candle 1 is Red, which means sellers stepped in, then candle 2 is Green or a Doji, that means buyers took the price up. Then if candle 3 is forming to be Red and breaks the closing of the 1st candle and opening of the 2nd candle then a Red arrow will appear and that is the place where you want to take your trade.
Sometimes candle 3 falls short but candle 4 breaks candle 1's closing and candle 2's opening price. We can enter on candle 4.
We need to enter the trade as soon as the price moves below the candle 1 and 2's body and should not wait for the 3rd or 4th candle to close.
I have restricted it to 4 candles and that is all that is needed. More than that is a longer sideways market.
I call it the -+- or RGR pattern.
Stop loss can be candle 2's mid for safe traders ( that includes me) or candle 2's body high for risky traders.
Back testing suggests that body high will be useless and result in more points in loss because for the bigger move this point will not be touched, so why not get out faster.
Important Settings
You can enable or disable the 4th candle signal to avoid the noise, but at times I have noticed that the 4th candle gives a very strong signal or I can say that the strong signal falls on the 4th candle. This is mostly a coincidence.
You can also configure how many previous bars should the signal be generated for. 10 to 30 is good enough. To backtest increase it to 2000 or 5000 for example.
Rest are self explanatory.
Pointers
If after taking the trade, the next candle moves in your direction and closes strong bullish or bearish, then move SL to break even and after that you can trail it.
If a upside trade hits SL and immediately a down side trade signal is generated on the next candle then take it. Vice versa is true.
Trades need to be taken on previous 2 candle's body high or low combined and not the wicks.
The most losses a trader takes is on a sideways day and because in our strategy the stop loss is so small that even on a sideways day we'll get out with a little profit or worst break even.
Hold targets for longer targets and don't panic.
If last 3-4 days have been sideways then there is a good probability that day will be trending so we can hold our trade for longer targets. Target to hold the trade for whole day and not exit till the day closes.
In general avoid trading in the middle of the day for index and stocks. Divide the day into 3 parts and avoid the middle.
Use Support/Resistance, 10, 20, 50, 200 EMA/SMA, Gaps, Whole/Round numbers(very imp) for identifying targets.
Trail your SL.
For indexes I would use 5 min and 15 min timeframe.
For commodities and crypto we can use higher timeframe as well. Look for signals during volatile time durations and avoid trading the whole day. Signal usually gives good targets on those times.
If a GRG or RGR pattern appears on a daily timeframe then this is our time to go big.
Minimum Risk to Reward should be 1:2 and for longer targets can be 1:4 to 1:10.
Trade with small lot size. Money management will happen automatically.
With small lot size and correct Risk-Re ward we can be very profitable. Don't trade with big lot size.
Stay in the market for longer and collect points not money.
Very imp - Watch market and learn to generate a market view.
Very imp - Only 4 candles are needed in trading - strong bullish, strong bearish, hammer, inverse hammer and doji.
Go big on bearish days for option traders. Puts are better bought and Calls are better sold.
Cluster of green signals can lead to bigger move on the upside and vice versa for red signals.
Most of this is what I learned from successful traders (from the top 2%) only the indicator is mine.
WaveTrend Oscillator v3 [JopAlgo]WaveTrend Oscillator v3 — reversal focus with confirmation, not guesswork
Core idea
WaveTrend (WT) gives you a smoothed oscillator pair (WT1 and WT2) with overbought/oversold rails and a momentum histogram. This v3 adds two filters so reversals are earned, not guessed:
Heikin-Ashi trend check → only take crosses with candle bias
Reversal Confidence Score (RCS) → only fire when momentum vs ATR is strong enough
Add an optional divergence check so you only act when price and oscillator disagree into extremes.
What you’ll see
WT1 (green) and WT2 (red)
Histogram = WT1 − WT2 (gray columns)
Rails: Overbought = +60, Oversold = −60, and the Zero line
Labels when all conditions align → Smart Buy (below) or Smart Sell (above)
Read it fast → Are we near +60/−60? Did WT1 cross WT2? Is the histogram expanding in that direction? Did a Smart label print?
How the signals are built
A signal prints only if all are true:
Cross → Bull: WT1 crosses up WT2; Bear: WT1 crosses down WT2
Extreme → Bull: WT1 below −60; Bear: WT1 above +60
RCS filter → |WT1 − WT2| scaled by ATR must be > threshold (default 80)
Heikin-Ashi agreement → HA close vs open points the same way as the cross
Divergence (lookback N) → Bull: oscillator makes lower low while price doesn’t; Bear: oscillator higher high while price doesn’t
Result → a reversal-grade setup, not a continuation ping.
How to use it (simple playbook)
Direction filter
If you want a pure reversal tool, keep the default rails (+60/−60) → you’ll wait for true extremes.
If you want more frequency, relax the rails (e.g., +50/−50) or lower RCS (e.g., 70 → 65). More signals → more noise.
Entry logic
Long reversal template
→ Price drives down into a value area edge (VAL/LVN)
→ WT1 < −60, WT1 ↗ WT2, RCS > threshold, HA bias up, bullish divergence
→ Enter on reclaim of the level or on the first higher-low after the cross
Short reversal template
→ Price pushes into VAH/HVN
→ WT1 > +60, WT1 ↘ WT2, RCS > threshold, HA bias down, bearish divergence
→ Enter on rejection and lower-high after the cross
Location first (always)
Use Volume Profile v3.2 (VAH/VAL/POC/LVNs) for where to act
Use Anchored VWAP (session/weekly/event) for who has control
No level → no trade. A WT flip into a level is better than one mid-range.
Risk & targets
Stops → beyond the sweep extreme or beyond the reclaimed level
Targets → ladder to next Fib/VP nodes (POC/HVNs, VA mid), then trail behind swings or the WT zero-line reclaim
Settings that matter (and how to tune)
WT Length (default 10) → core smoothing of the channel
→ Lower = faster turns; higher = calmer oscillator
WT EMA Smoothing (default 21) and Signal Smoothing (default 3)
→ Increase to reduce chop; decrease to react earlier
Overbought / Oversold (default +60/−60)
→ Tighten to +50/−50 for more frequent reversals; widen to +70/−70 for only the strongest
RCS Threshold (default 80)
→ Down to 70 for earlier triggers; up to 90 for only the punchiest turns
Divergence Lookback (default 5)
→ Shorter finds more local divs; longer finds bigger swings
Starter presets
Intraday (15m–1H) → WT 10/21, signal 3, rails ±60, RCS 80, div 5
Swing (2H–4H) → WT 14/28, signal 3–5, rails ±60/±70, RCS 85–90, div 7–9
Pattern cheat sheet
Double-dip divergence → oscillator prints a lower low near −60 while price holds a higher low → high-quality long if RCS/HA agree
Zero-line reclaim after a smart long → momentum shift; use it to trail stops or add on retest
Failure signal → cross fires but RCS < threshold or histogram shrinks back toward 0 into a level → stand down or cut quick
Overbought drift → WT pinned near +60/+70 without cross down → trend grind; don’t fade blindly
Best combos (kept simple)
Volume Profile v3.2 → take WT reversals at VAH/VAL/LVNs; target POC/HVNs
Anchored VWAP → WT cross with an AVWAP reclaim/reject is higher quality
CVDv1 (optional) → prefer flows that align with the reversal; avoid if absorption is fighting you
Common mistakes this helps you avoid
Fading every spike without RCS/HA confirmation
Taking reversals mid-range, far from levels
Treating divergence as timing (it’s context; you still need the cross + filter)
Ignoring the zero-line behavior after entry (weak follow-through)
Disclaimer
This indicator and write-up are for education only, not financial advice. Trading involves risk; results vary by market, venue, and settings. Test first, act at defined levels, and manage risk. No guarantees or warranties are provided.
Directional Indicator Crossovers [JopAlgo]Directional Indicator Crossovers — read trend intent at a glance, on any timeframe
Most traders ask two questions before they click: who’s in control right now and is control getting stronger or weaker?
The Directional Indicator (DI) answers the first one cleanly. +DI tracks upward directional movement; –DI tracks downward directional movement. When +DI crosses above –DI, buyers have the initiative; when –DI crosses above +DI, sellers do. DI Xover focuses on that simple, tradeable signal—the crossover—and keeps the pane uncluttered so you can layer it with your location/flow tools.
(If you add screenshots: image #1 can label +DI, –DI and a bullish crossover; image #2 can show a failed crossover in chop next to a successful one at a strong level.)
What you’re seeing (and how it’s built)
This indicator plots two lines in a separate pane:
+DI (green): smoothed positive directional movement.
–DI (red): smoothed negative directional movement.
Under the hood (length = 14 by default):
It measures how much today’s high exceeded yesterday’s high (up move) and how much today’s low fell below yesterday’s low (down move).
It keeps only the dominant side each bar (if up > down and up > 0 → up counts; vice-versa for down).
It normalizes by True Range (so moves are scaled by volatility) and smooths with RMA (so you don’t get jitter).
It raises alerts when +DI crosses above –DI (bullish) or –DI crosses above +DI (bearish).
How to read it, fast:
Cross up = buyers just took initiative.
Cross down = sellers just took initiative.
Wider distance between the lines = stronger control.
Lines braided/tight = balance/chop → expect more fake crosses.
DI is about directional control. It doesn’t tell you where to trade—that’s your location (e.g., Volume Profile, AVWAP). Use DI as a timing/confirmation layer, not as a standalone level generator.
Using DI Crossovers on any timeframe
The framework doesn’t change; only your expectations do as you zoom.
Scalping (1–5m)
Treat crossovers as triggers at levels. If price is tagging VAL/VAH/LVN (from Volume Profile v3.2) or Anchored VWAP, a fresh +DI cross up is your green light for a quick long; –DI cross up flips that logic for shorts.
Avoid taking every crossover mid-range—wait for location first.
In fast tape, require the lines to separate for 1–2 bars after the cross before you click.
Intraday (15m–1H)
In trend days, the first pullback into your level (POC/VA boundary/AVWAP) that prints a fresh +DI cross up is often the cleanest add/entry.
In balance days, fade DI crosses at edges back to POC—only if your flow tool isn’t screaming absorption against you.
Swing (2H–4H)
Look for confluence: at Weekly AVWAP or composite VAL/VAH, a DI crossover that stays separated for several bars is a solid momentum confirmation.
Failed crossover (lines recross quickly) near a level is a useful fail signal—expect a move back into value.
Position (1D–1W)
Use fewer, bigger signals: a weekly DI cross at Monthly/Quarterly AVWAP or at composite value edges marks a regime change.
Add on pullbacks when the controlling DI stays dominant (distance holds or widens).
Entries, exits, and risk (simple rules)
Entry (with level): wait for price to reach your level (e.g., VAL/VAH or AVWAP), then take the trade with the DI cross in that direction.
Filter: skip crosses when the two lines are braided (tiny separation) unless you’re trading a tight scalp with strict risk.
Exit / reduce: if your trade was based on a bullish cross, consider reducing when –DI recaptures +DI or the lines flatten at your target HVN/POC.
Stops: put them beyond the level (not just on a DI recross), but treat a fast recross as a warning to tighten.
Settings that actually matter (and how to tune them)
DI Length (default 14):
Shorter (7–10) = faster signals, more noise (good for scalps with filters).
Longer (20–30) = fewer but stronger signals (good for swing/position).
If you often see flip-flops, lengthen the setting or take crosses only at VP/AVWAP levels.
Pro tip: Define a minimum separation rule for yourself (e.g., after a cross, require the gap between +DI and –DI to increase on the next bar). You don’t need extra code for this—just enforce it visually.
What to look for (pattern cheatsheet)
Cross + hold at a level: The lines cross at your level and keep separating → high-quality entry in that direction.
Sneaky fail: Cross, then immediate recross back → treat it as a fade signal back into value (especially near VAH/VAL).
Strength confirmation: After a breakout, +DI stays above –DI on pullbacks → trend is healthy; buy dips at AVWAP/POC.
Pre-move tell: DI lines unbraid and begin diverging before price leaves a range; wait for location + trigger.
Combining DI Xover with other tools
Cumulative Volume Delta v1 (CVDv1):
Use DI for direction, and CVDv1 for quality. A bullish DI cross with ALIGN OK + Imbalance strong + no Absorption is a far better long than DI alone.
If DI crosses up but CVDv1 flags Absorption (red), don’t chase—look for the fail/reclaim instead.
Volume Profile v3.2 :
Let VP choose the battleground (POC/VAH/VAL/LVNs). Take the DI crossover at those references.
Classic: bearish DI cross at VAH → fade toward POC; bullish DI cross at VAL → rotate to POC—assuming CVDv1 isn’t vetoing with Absorption.
Anchored VWAP :
Treat reclaims/rejections of AVWAP as the location and DI cross as the trigger.
Example: price reclaims Weekly AVWAP, then on the next pullback, a +DI cross up confirms the add.
Common pitfalls this helps you avoid
Trading crosses in the middle of nowhere. DI is a trigger, not a level; wait for VP/AVWAP.
Chasing every wiggle. When the lines are braided, you’re likely in balance—expect fake crosses.
Ignoring flow. A DI cross against CVDv1 Absorption is often a trap; quality > quantity.
Practical defaults to start with
Length: 14
Timeframes: Works out of the box on 15m–4H. For 1–5m scalps try 10–12; for daily/weekly swings try 20–30.
Process: Only act on crosses at levels (VP v3.2 / Anchored VWAP), and prefer those where CVDv1 says ALIGN OK and no Absorption.
Alerts (what they tell you)
Bullish DI Crossover: +DI crossed above –DI → buyers just took initiative. Look to your chart for location and CVDv1 quality before entering.
Bearish DI Crossover: –DI crossed above +DI → sellers took initiative. Same rule: confirm at a level with flow.
Open source & disclaimer
This indicator is published open source so traders can learn, adapt, and build rules they trust. No tool guarantees outcomes; risk management remains essential.
Disclaimer — Not Financial Advice.
The “Directional Indicator Crossovers ” indicator and this description are provided for educational purposes only and do not constitute financial or investment advice. Trading involves risk, including possible loss of capital. makes no warranties and assumes no responsibility for any trading decisions or outcomes resulting from the use of this script. Past performance is not indicative of future results.
AutoDay MA (Session-Normalized)📊 AutoDay MA (Session-Normalized Moving Average)
⚡ Daily power, intraday precision.
AutoDay MA automatically converts any N-day moving average into the exact equivalent on your current intraday timeframe.
💡 Concept inspired by Brian Shannon (Alphatrends) – mapping daily MAs onto intraday charts by normalizing session minutes.
🛠 How it works
Set Days (N) (e.g., 5, 10, 20).
Define Session Minutes per Day (⏱ 390 = US RTH, 🌍 1440 = 24h).
The indicator detects your chart’s timeframe and computes:
Length = (Days × SessionMinutes) / BarMinutes
Applies your chosen MA type (📐 SMA / EMA / RMA / WMA) with rounding (nearest, up, down).
Displays all details in a clear corner info panel.
✅ Why use it
Consistency 🔄: Same 5-day smoothing across all intraday charts.
Session-aware 🕒: Works for equities, futures, FX, crypto.
Transparency 🔍: Always shows the math & final MA length.
Alerts built-in 🔔: Cross up/down vs. price.
📈 Examples
5-Day on 1m → 1950-period MA
5-Day on 15m → 130-period MA
5-Day on 65m → 30-period MA
10-Day on 24h/15m (crypto) → 960-period MA
3SMA (1H only) by tophengzkyThis script plots three Simple Moving Averages (SMA 10, 20, 50), but they are only visible when the chart timeframe is set to 1 hour (1H).
It helps traders focus on higher timeframe trend direction without cluttering charts on other timeframes.
SMA1 = 10 (white)
SMA2 = 20 (yellow)
SMA3 = 200 (red)
Works only on 1H timeframe
Useful for swing traders and intraday traders who rely on hourly trend confirmation.
why 1 hr only? the only purpose of this is just to know the bias of the market weather it will reverse or it will continue the trend. As long as the price action did not cross this 3 SMA's the trend will continue.
as a trend trader it is very useful this strategy.. make it simple!
自定义均线(多色 & 分级线宽)Title: Multi-Color Moving Average Suite (MA5…MA4320) — Pine v6
Summary (1–2 lines):
An overlay indicator that plots a full ladder of SMA lines from MA5 up to MA4320. Each MA has a unique color, and line width scales with period (short = thin, mid = medium, long = thick) to make trend structure easy to read at a glance.
What it does
• Plots 16 simple moving averages: 5, 10, 20, 30, 60, 120, 160, 240, 480, 720, 960, 1440, 1750, 2880, 4320.
• Distinct colors for every MA to avoid confusion when lines cluster.
• Period-based thickness:
• Short-term (<60) = thin,
• Mid-term (60–160) = medium,
• Long-term (≥240) = thick (capped; no unlimited growth).
• Designed for quick trend reading across intraday to multi-year cycles (especially useful for 24/7 markets like crypto).
How to use
1. Add the indicator to any chart (works on all symbols/timeframes).
2. Use the thin/medium/thick visual hierarchy to identify short-/mid-/long-term bias and crossovers.
3. On very low timeframes, consider hiding some ultra-long MAs if your chart has insufficient history.
Notes
• Built with Pine Script v6; uses ta.sma(close, length) only (no repainting).
• Very long MAs (e.g., 2880/4320) require enough bars; they will display na until sufficient history loads.
• No inputs/alerts by default—kept intentionally simple for clarity. (Easy to extend with toggles, custom colors, EMA/WMA options, alerts, etc.)
Credits
Author: TraderFinsher (customized multi-MA visualization with color and thickness hierarchy).
⸻
标题: 多色均线系统(MA5…MA4320)— Pine v6
摘要(1–2 句):
这是一个叠加在价格上的 SMA 均线组,从 MA5 到 MA4320。为每条均线设置了 独立颜色,并按 周期长度分级线宽(短=细、中=中等、长=较粗),让趋势结构一眼可读。
功能说明
• 绘制 16 条简单移动平均线:5、10、20、30、60、120、160、240、480、720、960、1440、1750、2880、4320。
• 全部不同颜色,避免密集时混淆。
• 线宽随周期分级:
• 短期(<60)= 细,
• 中期(60–160)= 中等,
• 长期(≥240)= 粗(封顶,不再无限加粗)。
• 适合从日内到多年周期的 趋势快速判读(对加密等 24/7 市场尤为友好)。
使用建议
1. 将指标添加到任意品种/周期。
2. 结合细/中/粗的视觉层级,判断短/中/长趋势与均线交叉。
3. 在较低周期下,如果历史数据不足,可隐藏部分超长均线。
注意事项
• 使用 Pine v6,仅调用 ta.sma(close, length),不重绘。
• 超长均线需要足够历史数据,未满足前会显示 na。
• 默认不含参数和告警,追求简洁清晰(后续可扩展开关、自定义颜色/线宽、EMA/WMA 选项与告警等)。
致谢
作者:TraderFinsher(基于颜色与线宽层级的多均线可视化)。
Long Elite Squeeze (LES 2.1) NV/CDV AI LindsayLES 2.1 — Long Elite Squeeze
Creator: Hunter Hammond •: Elite × FineFir H.H (AI “Lindsay”)
Discord: elitexfinefir
LES (“Long Elite Squeeze”) is a momentum + flow-aware long strategy built for small-float, high-velocity stocks. It blends a classic squeeze engine (BB/KC), adaptive RVOL/RSI gating, VWAP slope, ADX trend filtering, WaveTrend timing, and new Net-Volume/CVD flow exits—all wrapped with on-chart HUDs, a trade tracker, trap detection, and a lightweight AI selector to adapt entries to live conditions.
Who it’s for (and where it thrives)
LES 2.1 is tuned for the morning session and stocks that can really move:
Top Pre-Market and Day Gainers
Highest or Top Volume on Day
Float: ≤ 40M
Price: ≤ $20
Volume: ≥ 5× the 30-day average (intraday RVOL pop)
Catalyst: ideally a fresh news driver / “day gainer”
Timeframe: 1-minute (designed & tuned for 1m). Works on 2m/3m/5m, but wasn’t specifically designed for them (see tuning tips below).
Evolution at a glance
LES 1.0 — The foundation
Squeeze engine using Bollinger vs. Keltner to detect expansion (“squeeze OFF”).
EMA – ATR offset line (dynamic risk anchor) with EMA as trend filter.
RSI guard for overheated moves.
RVOL confirmation using average volume lookback.
WaveTrend (WT + Signal) to time entries/exits.
Basic buy/sell logic + simple on-chart labels.
LES 2.0 — Quality-of-life & timing upgrades
AI Lindsay assistant v2 (periodic / contextual commentary).
VWAP Slope Detector with sensitivity modes (Loose → Very Strict).
Manual defaults pre-tuned for ease of use.
Double-EMA trailing (visual take-profit helper).
Improved on-chart commentary and Trade Summary (10:30am snapshot).
AI Version Suggester (V1/V2/V3 modes) with stickiness/cooldown.
Trap Detector Pro (sweep, VWAP reject, blow-off, etc.) with scored severity.
Trade Tracker HUD + Entry Checklist HUD.
Overall stability & UX polish.
LES 2.1 — Flow-based exit superpowers
New Flow Exit: integrates 1m Net Volume and 5m CVD-style pressure:
1m NetVol window (rolling sum of signed volume)
5m CVD window (downsampled, smoothed)
Debounce (consecutive red bars to avoid one-tick fakes)
Optional ATR Guard (only exit if the move is meaningful vs ATR)
Cooldown after a flow exit to avoid re-chop
Chart labels: “SELL (NV/CVD)” when flow triggers
Keeps you in good trends, but kicks you out when aggressive sellers actually show up.
How the engine works (plain English)
Market prep: We confirm trend & energy using EMA/ATR, RSI, RVOL, Squeeze OFF, and Price > VWAP.
Entry mode (V1/V2/V3):
V1 — Balanced trades (default “safe” behavior)
V2 — Fast trades (more aggressive when action heats up)
V3 — Trending trades (stricter; waits for strong slope & trend)
You can pick a version manually or let the AI Suggester switch modes based on slope/ADX/RVOL/acceleration (with a cooldown so it doesn’t flip-flop).
Entry timing: WaveTrend and squeeze momentum improve timing while VWAP slope avoids buying flat tape.
Risk anchor: The EMA – (ATR × Multiplier) “offset line” is your dynamic stop/line in the sand.
Exits:
Base exits (version-aware): WT crossback, momentum fade, price losing offsetLine or EMA.
Flow Exit (2.1): If 1m NetVol and 5m CVD both turn decisively red (with debounce and optional ATR guard), close—no arguing.
Entry rules (exactly what has to be true)
Buy (Core) — fires when all are true:
Not already in a trade
Close > EMA and Close > OffsetLine (offsetLine = EMA − ATR × Mult)
RVOL confirmed (meets dynamic RVOL multiplier)
RSI below the overbought ceiling (version-aware slack in V3)
Squeeze OFF (BBs expanded outside Keltner)
Price > VWAP (toggleable)
Extra for V3 (Trending trades):
VWAP slope gate passes (and, if set, VWAP must be green)
ADX strong (≥ 25 by design, ≥ 20 baseline)
Minimum slopePctPerBar met (default V3 expects ≥ 0.05%/bar)
AI Suggester (optional):
Scores V1/V2/V3 from conditions like ADX, VWAP slope, RVOL, intrabar acceleration, then locks a pick for aiSwitchCoolBars bars.
On-chart help:
Checklist HUD lights up ✅/❌ for each gate (EMA, ATR, RVOL, RSI, VWAP, Slope, etc.).
Trade Quality Rating (🌟x/10) appears on buy bars if enabled.
Exit rules (every sell condition)
Base sells (V1/V2):
WaveTrend crossback (signal crosses over WT) OR
Momentum fade (two darker squeeze momentum bars) OR
Close < OffsetLine OR Close < EMA
Base sells (V3):
Close < OffsetLine OR Close < EMA (trend-respecting; ignores WT/momentum so you’re not shaken out early)
Flow Exit (2.1, applies to all versions if enabled):
In trade AND Flow Exit enabled
1m NetVol window is red (and ≥ Min |NetVol|)
5m CVD (smoothed) is red
**Deb
*** FYI: Play with settings until it fits your style, everything thats set default when script is loaded is what I run currently. I made LES 2.1 more customizable than ever to meet every trades style and execution. LES 2.1 with Lindsay upgrade new AI trade tracking feature (when enabled) and risk management LES 2.1 is something special to meet many challenges a trader faces everyday.
Market Mode Risk IndicatorMarket Mode Risk Indicator v1.1
This custom indicator helps traders gauge market risk sentiment by monitoring Exponential Moving Average (EMA) or Simple Moving Average (SMA) crossovers on key indices like BIST 100 (for Turkish markets), NASDAQ Composite (tech-focused US), or Dow Jones Industrial Average (industrial US). It dynamically categorizes the market into three actionable modes based on the index's position relative to layered MAs, providing a quick visual snapshot without cluttering your chart.
Risk Modes Explained:
RISK OFF (Red): Index closes below the Long MA (default 50 periods) – signals bearish caution; time to tighten stops or reduce exposure.
RISK TEST (Orange): Index above Medium MA1 (21 periods) and Extra Long MA (55 periods), but below Short MA (10 periods) and above Long MA – a transitional "test" phase; watch for confirmation before entering.
RISK ON (Green): Index above all MAs (Short, Medium, Long, Extra Long) – bullish green light; favorable for longs or momentum plays.
How It Works:
The core logic uses boolean checks on the index's close price against user-defined MA lengths. For example:
It pulls live data from your selected index via request.security.
Computes MAs with ternary operators for EMA (ta.ema) or SMA (ta.sma) based on your choice.
Mode detection relies on AND/OR conditions (e.g., aboveShort and aboveMed1 and aboveLong and aboveExtraLong for RISK ON) to filter noise and focus on meaningful shifts.
No lookahead bias – all calculations are historical and real-time compatible. Defaults (10/21/50/55) are inspired by common Fibonacci-inspired periods for balanced sensitivity.
Alerts fire only on mode transitions (e.g., from RISK OFF to ON) to prevent spam, using alertcondition with dynamic messages including price and ticker.
Customization Options:
Index & MA Settings: Switch EMA/SMA; tweak lengths (min 1 period) for your timeframe (e.g., shorter for intraday).
Display: Position the table (top/bottom, left/right); toggle MA values on/off.
Looks: Background/border/text colors, transparency (0-100%) for theme matching.
Built in Pine Script v5 for efficiency – lightweight, no repaints.
Usage Tips:
Add to any stock chart (e.g., GARAN for BIST analysis).
Select your index in settings; refresh chart if switching MA type.
Use on daily/4H timeframes for swing trading; alerts via email/SMS for hands-free monitoring.
Pro Tip: Combine with volume or RSI for confirmation – RISK ON + rising volume = stronger buy signal.