Indicator · Pine Script v5 · On the chart

2 Week Swing Stock Advisor - Position Mode

by HmZ9874

This overlay indicator scores stock swing setups from fast and slow EMAs, a weekly EMA, RSI and MACD momentum, relative strength versus a benchmark, OBV volume flow, and ATR volatility.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code620
Settings40inputs
LicenceNone stated
Last update3 months ago9 Jul 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

2 Week Swing Stock Advisor - Position Mode suggests probe, starter, add-on, and full buys plus partial and full exits, then simulates cash, position size, equity, and a buy-and-hold comparison on the price chart. Settings change score thresholds, holding time, staged allocations, stop, breakeven, and profit-giveback rules. It is an indicator, so it does not place live orders.

Details

Published by

HmZ9874 on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Oscillators & momentum, Moving averages, Volatility & bands

Markets

Stocks

Timeframes

H4 and above

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast EMAint20fastLen
Slow EMAint60slowLen
Higher TimeframetimeframeWweeklyTf
Weekly EMAint20weeklyEmaLen
Exit Confirmation Barsint3exitConfirmBars
Minimum Buy Scoreint4minBuyScore
Minimum Add Scoreint4minAddScore
Minimum Exit Scoreint4minExitScore
Signal Cooldown Barsint5cooldownBars
Minimum Holding Barsint15minHoldBars
Full Buy Scoreint5bigBuyScore
Partial Exit Minimum Profit %float8.0smallExitProfitPct
Show all 40 settings
SettingTypeDefaultVariable
Partial Exit Profit Giveback %float35.0smallExitGivebackPct
Full Exit Maximum Loss %float18.0fullExitLossPct
Initial Cash $float1000.0initialCapital
Simulation Start Date: 2026-01-01time1767225600000simulationStart
History Start Grace Daysint7historyGraceDays
Starter Buy Target Position %float25.0smallBuyTargetPct
Turnaround Probe Target Position %float8.0turnProbeTargetPct
Add-on Buy Target Position %float50.0addBuyTargetPct
Full Buy Target Position %float100.0bigBuyTargetPct
Partial Exit Sell Percentage %float50.0smallExitSellPct
Allow Partial ExitbooltrueallowSmallExit
Allow Direct Full Buy From CashboolfalsedirectBigBuyAllowed
Simulation Rule: One Trade Per DaybooltrueoneTradePerDay
Minimum Valid Trade Value $float1.0minTradeValue
Initial Maximum Loss %float15.0initialStopPct
Profit Protection Activation %float30.0profitProtectStartPct
Maximum Profit Giveback %float70.0profitGivebackPct
Breakeven Buffer %float1.0breakevenBufferPct
Major Drawdown %float35.0majorDrawdownPct
Profit Lock Activation %float10.0profitLockStartPct
Profit Lock Giveback %float28.0profitLockGivebackPct
Climax Run Threshold %float20.0climaxRunPct
Climax Drawdown Full Exit %float8.0climaxDrawdownPct
Show Watch WarningbooltrueshowSoftWarning
Strong Hold Minimum Scoreint6strongHoldScoreNeeded
Strong Hold Allowed Drawdown %float18.0strongHoldDrawdownPct
Strong Hold Activation Profit %float8.0strongHoldMinProfitPct
Market BenchmarksymbolNASDAQ:QQQmarketSymbol
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

114 stars

ADX Strategy (original) is an overlay indicator that identifies trend-following trade signals using the Average Directional Index (ADX) combined with a Simple Moving Average filter. A long signal is generated when the ADX rises above a user-defined trend level

Indicator v4 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of ADX Strategy (original)
56 stars

Double Screened Decision is a multi-timeframe trend and momentum indicator overlaid directly on the price chart. It dynamically selects a higher timeframe based on the active chart resolution to evaluate higher-timeframe MACD, Bollinger Bands, RSI, and Stochas

Indicator v5 TrendMoving averages Repaints
Updated 4 months ago · None stated GitHub repository of Double Screened Decision
24 stars

This indicator plots Bollinger Bands on the price chart alongside a baseline moving average to identify trend-aligned swing setups. It calculates trend bias by comparing the Bollinger Bands basis to a customizable moving average, such as a 200 EMA. Trade signa

Indicator v5 Volatility & bandsOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Bollinger Band Swing

Index Intraday Analyst

by chris-c-thomas
14 stars

Index Intraday Analyst overlays CBOE cash indices such as SPX, NDX, RUT, and DJX. It plots a multi-EMA ribbon, a session-anchored TWAP with standard-deviation bands, and session levels such as prior-day high, low, and close, the opening range, and the high and

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · MIT GitHub repository of Index Intraday Analyst

RePaNoCHa V4

by wocclyl
9 stars

RePaNoCHa V4 is an overlay alert indicator that plots a Tillson T3 moving average on the price chart and colors it by whether the line is rising or falling. It combines that slope with a range filter, ADX, parabolic SAR, RSI, and MACD to mark long and short si

Indicator v4 TrendOscillators & momentum
Updated 7 years ago · MIT GitHub repository of RePaNoCHa V4

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers