Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Two-Week Swing Stock Advisor

A TradingView Pine Script indicator designed for short-term swing trading and portfolio simulation.

The script combines trend analysis, momentum, relative strength, volume flow, volatility control, position scaling, profit protection, and simulated account tracking in one chart-based tool.

Features

  • Fast and slow EMA trend analysis
  • Weekly trend confirmation
  • RSI and MACD momentum filters
  • Relative strength comparison against a market benchmark
  • OBV-based volume flow analysis
  • ATR volatility filtering
  • Probe entries, starter buys, add-on buys, and full-position buys
  • Partial exits and full exits
  • Initial stop-loss protection
  • Breakeven and profit-lock logic
  • Drawdown and climax-run protection
  • Strong-trend hold mode
  • Simulated cash, position value, equity, and trade history
  • Buy-and-hold benchmark comparison
  • On-chart decision, portfolio, and trade-log panels
  • TradingView alert conditions

Main File

two_week_swing_stock_advisor_english.pine

Strategy Structure

The indicator uses several groups of signals to evaluate entries and exits.

Trend

The script analyzes:

  • Fast EMA
  • Slow EMA
  • Weekly EMA
  • Daily and weekly trend alignment
  • Trend repair and continuation
  • Golden-cross and breakdown conditions

Momentum

Momentum confirmation includes:

  • RSI direction and level
  • MACD line and signal relationship
  • MACD histogram improvement
  • Breakout and pullback behavior

Market and Data Filters

The strategy can evaluate:

  • Market benchmark health
  • Relative strength
  • Volume flow
  • ATR-based volatility
  • Bull-market confirmation
  • Capital-preservation conditions

The default market benchmark is:

NASDAQ:QQQ

Position Management

The simulated portfolio can use staged position sizing:

  • Probe Buy
  • Starter Buy
  • Add Buy
  • Full Buy
  • Partial Exit
  • Full Exit

Default target allocations are configurable from the indicator settings.

Risk Management

The script includes:

  • Initial maximum-loss protection
  • Breakeven protection
  • Profit giveback control
  • Profit-lock activation
  • Major drawdown exits
  • Climax-run protection
  • Trend-break exits
  • Strong Hold Mode for sustained bullish trends

Installation

  1. Open TradingView.
  2. Open a chart.
  3. Select Pine Editor.
  4. Copy the contents of two_week_swing_stock_advisor_english.pine.
  5. Paste the code into the editor.
  6. Click Save.
  7. Click Add to chart.

Recommended Use

This script is primarily designed for daily charts and approximately two-week swing-trading analysis.

Before relying on its output:

  • Review all settings for the selected asset.
  • Load enough historical chart data.
  • Confirm that the simulation start date is visible in the chart history.
  • Test the logic on multiple assets and market regimes.
  • Compare the simulated result with the buy-and-hold benchmark.
  • Avoid treating individual labels as standalone trading instructions.

Important Settings

Setting Purpose
Fast EMA Measures short-term trend
Slow EMA Measures broader trend
Weekly EMA Confirms higher-timeframe direction
Minimum Buy Score Controls entry strictness
Minimum Add Score Controls add-on entry strictness
Minimum Exit Score Controls exit sensitivity
Minimum Holding Bars Prevents premature exits
Initial Capital Starting value for the simulation
Simulation Start Date Defines when simulated trading begins
Market Benchmark Reference symbol for market filtering
Capital Preservation Mode Restricts entries in weak conditions
Strong Hold Minimum Score Controls sustained-trend holding behavior

Alerts

The script provides alert conditions for:

  • Starter Buy
  • Add Buy
  • Full Buy
  • Risk Warning
  • Partial Exit
  • Full Exit

To create an alert:

  1. Add the indicator to a TradingView chart.
  2. Click Alerts.
  3. Select this indicator under Condition.
  4. Choose the desired signal.
  5. Configure the alert frequency and notification method.

Notes

  • This is an indicator(), not a TradingView strategy().
  • Portfolio results are internally simulated by the script.
  • Simulated trades do not include every real-world execution factor.
  • Slippage, taxes, liquidity, spreads, and brokerage restrictions may materially affect actual results.
  • The script should be tested and validated before any practical use.

Disclaimer

This project is provided for educational, research, and software-development purposes only.

It does not constitute financial, investment, legal, or tax advice. No result, signal, label, alert, or simulated performance should be interpreted as a recommendation to buy or sell any security.

Past or simulated performance does not guarantee future results. You are responsible for your own research, risk management, and trading decisions.

License

No license has been granted unless a separate license file is added to this repository.

All rights are reserved by the repository owner.

About

A TradingView Pine Script indicator for two-week swing trading with staged entries, exits, risk management, market filters, and portfolio simulation.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors