PROTECTED SOURCE SCRIPT
TrendIsYourFriend Strategy (SPY,IWM,VYM,XLK,SPXL,BTC,GOLD,VT...)

Personal disclaimer
Don’t trust this strategy. Don’t trust any other model either just because of its author or a backtest curve. Overfitting is an easy trap, and beginners often fall into it. This script isn’t meant to impress you. It’s meant to survive reality. If it does, maybe it will raise questions and you’ll remember it.
Legal disclaimer
Educational purposes only. Not financial advice. Past performance is not indicative of future results.
Strategy description
What makes this script original
Allowed [Asset:Timeframe]
How to use and form an opinion on it
Share your thoughts in the comments 🚀 if you’d like to discuss its live performance.
Don’t trust this strategy. Don’t trust any other model either just because of its author or a backtest curve. Overfitting is an easy trap, and beginners often fall into it. This script isn’t meant to impress you. It’s meant to survive reality. If it does, maybe it will raise questions and you’ll remember it.
Legal disclaimer
Educational purposes only. Not financial advice. Past performance is not indicative of future results.
Strategy description
- Long-only, trend-based logic with two entry types (trend continuation or excess-move reversion), dynamic stop-losses, and a VIX filter to avoid turbulent markets.
- Minimal number of parameters with enough trades to support robustness.
- For backtest, each trade is sized at $10,000 flat (no compounding, to focus on raw model quality and the regularity of its results over time).
- Fees = $0 (neutral choice, as brokers differ).
- Slippage = $0, deliberate choice: most entries occur on higher timeframes, and some assets start their history on charts at very low prices, which would otherwise distort results.
What makes this script original
- Beyond a classical trend calculation, both excess-move entries and dynamic stop-loss exits also rely on trend logic. Except for the VIX filter, everything comes from trend functions, with very few parameters.
- Pre-configurations are fixed in the code, allowing sincere performance tracking across a dozen [Asset:Timeframe] cases over the medium to long term.
Allowed [Asset:Timeframe]
- SPY (ARCA) — 2-hour chart: S&P 500 ETF, most liquid equity benchmark
- IWM (ARCA) — Daily chart: Russell 2000 ETF, US small caps
- VYM (ARCA) — Daily chart: Vanguard High Dividend Yield ETF
- XLK (ARCA) — Daily chart: Technology Select Sector SPDR
- SPXL (ARCA) — Daily chart: 3× leveraged S&P 500 ETF
- BTCUSD (COINBASE) — 4-hour chart: Bitcoin vs USD
- GOLD (TVC) — Daily chart: Gold spot price
- VT (ARCA) — Daily chart: Vanguard Total World Stock ETF
- PG (NYSE) — Daily chart: Procter & Gamble Co.
- CQQQ (ARCA) — Daily chart: Invesco China Technology ETF
- EWC (ARCA) — Daily chart: iShares MSCI Canada ETF
- EWJ (ARCA) — Daily chart: iShares MSCI Japan ETF
How to use and form an opinion on it
- Works only on the pairs above.
- Feel free to modify the input parameters (slippage, fees, order size, margins, …) to see how the model behaves under your own conditions
- Compare it with a simple Buy & Hold (requires an order size of 100% equity).
- You may also want to look at its time-in-market — the share of time your capital is actually at risk.
- Finally, let me INSIST on this: let it run live for months before forming an opinion!
Share your thoughts in the comments 🚀 if you’d like to discuss its live performance.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Email Trader
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Email Trader
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.