Trend Trading Indicator

4 901
Trading with the trend only works if you can tell when there actually is one. This indicator runs custom trend formulas on up to 5 timeframes of your choice at the same time and only calls a market trending when the timeframes you picked agree on a direction, so the sideways chop that eats trend traders alive stays filtered out of your signals.

Custom developed by Trend Friend, the indicator features:
  • A master trend that colors your candles by trend direction and turns them gray when the market is ranging
  • 3 levels of strong buy and sell entry crosses
  • Pullback entry signals for joining a strong trend after a dip
  • Strong trend confirmation dots and background coloring for holding positions
  • A bottom panel that scores the trend strength of all 5 timeframes so you can scan charts fast
  • Ranging market filters and a higher timeframe direction filter
  • A trend direction output that other indicators can use as a signal filter
  • 18 alerts that only fire on closed candles


cuplikan

-------------------------------------------------------------------

How the Trend Is Calculated

Each of the 5 timeframes you choose gets its own trend strength score, recalculated on every candle. The score comes from a set of custom formulas that each check a different part of that timeframe's behavior:
  • Range Position - where price sits inside that timeframe's recent trading range
  • Volume Weighted Positioning - where price sits compared to volume weighted price measures built from that timeframe's trading activity
  • Previous Candle Positioning - where price sits compared to that timeframe's last fully completed candle
  • Timeframe Stacking - how that timeframe's trend measures line up against the next timeframe above it


Bullish checks add points to a timeframe's score and bearish checks subtract points, and a score near zero means that timeframe is ranging so it reads as neutral. The exact formulas, point values, thresholds and data window lengths are proprietary and are the reason the source code is closed, but the categories above are what those formulas measure. What makes this script different from a single timeframe trend tool is that all 5 timeframes are scored this way at once and every signal has to pass through them together.

The formulas are built from set amounts of trading time instead of fixed bar counts, so the script needs to know how many hours per day your market trades. That is what the Market Hours setting is for, and it needs to match the symbol you are on for accurate readings.

-------------------------------------------------------------------

Master Trend and Candle Coloring

The master trend is the gate for every signal in this script. Nothing prints until it is active.
  • Candles paint the bullish color when every timeframe you have turned on to affect the master trend signals reads bullish at the same time
  • Candles paint the bearish color when every timeframe you have turned on to affect the master trend signals reads bearish at the same time
  • Candles stay gray when the timeframes disagree or the market is ranging, which is your cue to stand aside


Default colors are aqua for bullish, orange for bearish and gray for neutral, and all 3 are adjustable. Make sure you turn off your chart's candle coloring in the chart settings (gear icon, Symbol tab) so it does not override the indicator's coloring. You can leave borders on so you can still see the live candle during any short painting delays.

cuplikan

-------------------------------------------------------------------

Signal Types

Every signal type below can only fire while the master trend is active, and each type has its own on/off toggle.

Strong Buy and Sell Signals (Crosses) - These fire when a larger than normal candle closes strongly in the trend direction right after price dips into one of the indicator's internal trend levels. There are 3 sizes of crosses, and each bigger size requires price to reclaim a deeper level, so the larger the cross, the stronger the move behind it. Use these as entry points, place your stop loss just beyond the most recent major pivot, and trail your stop as the trade moves in your favor to lock in profits.

Pullback During Strong Trend Signals (Tags) - These need a strong trend on timeframes 3-5, a pullback on the shorter timeframes, and then a strong candle that turns back in the direction of the bigger trend while forming a pivot. The pullback already happened before the signal prints, so you get to join the trend right as the short term pressure flips back in its favor. They appear as label tag shapes above or below the candles.

Strong All Timeframe Trend Signals (Dots and Background) - Two separate strong trend formulas power this signal type. One prints a circle above or below the candle and the other paints the chart background, and when both show at the same time, both formulas agree the trend is strong. Strong trends typically keep running, so use these as confirmation to hold your position instead of second guessing every small candle that goes against you.

Trend Strength Score Signals (Bottom Panel Background) - When the combined score of every timeframe you have turned on reaches a high share of the maximum possible score, the bottom panel background paints in the trend direction to tell you the trend is strong across the board.

cuplikan

-------------------------------------------------------------------

Trend Strength Score Panel

The bottom panel plots the live score of each timeframe as its own colored oscillator: green for bullish, red for bearish and gray for ranging. A label next to each one shows the timeframe, the current score out of the maximum possible and a Buy, Sell or Wait reading.
  • Scan through your watchlist and the panel instantly shows which markets are trending on every timeframe and which ones are dead
  • Read the short term and long term trends in one glance without switching chart timeframes
  • When the long term timeframes agree but the short term scores are moving against them, watch for the short term scores to flip back in the long term direction and look for entries with the bigger trend in those areas


cuplikan

-------------------------------------------------------------------

Signal Filters

Timeframe Toggles - Each of the 5 timeframes has a toggle for whether the master trend uses it. Keep at least timeframes 1 and 2 on. The more timeframes you turn on, the fewer signals you get, because every signal has to pass more timeframes before it can print. Keeping just the lower timeframes on gives more signals for short term trading, and leaving them all on saves the signals for markets that are trending on every timeframe at once.

Ranging Market Filters - 3 independent filters, and each one watches whichever of your 5 timeframes you point it at. When a watched timeframe reads as ranging, all signals are blocked until it starts trending again. The reason for this is that signals given in sideways markets fail more often, so these filters keep you flat while the market decides on a direction. Use 1, 2 or all 3, and make sure you look through historical data to see how each combination changes the signals before trading with it.

Signals Only Allowed In Direction Of Timeframes 4 & 5 - Turn this on to block any signal that goes against your 2 longest timeframes, and it works even if timeframes 4 and 5 are turned off in the master trend toggles. Markets tend to move faster and cleaner with the long term trend and chop hard against it, so this filter helps you stay on the side the bigger money is pushing. It is off by default.

-------------------------------------------------------------------

Sending Trend Direction To Other Indicators

The script plots a value named Trend Direction To Send To External Indicators: 1 when the master trend is bullish, -1 when it is bearish and 0 when there is no trend. Any indicator on the same chart with an input.source() filter can read this value, so you can block other indicators from giving buy signals during downtrends, sell signals during uptrends, or any signals at all while the market is ranging. The plot sits at the bottom of the list in the Style tab so it stays out of your way.

-------------------------------------------------------------------

Alerts

Every alert in this script fires only on closed candles, so you are never alerted on a signal that could still change before the candle closes. There are 18 alerts:
  • Strong Buy Signal 1, 2 and 3 plus Strong Sell Signal 1, 2 and 3 - individual alerts for each cross size
  • Any Of The 3 Strong Buy Signals Fired and Any Of The 3 Strong Sell Signals Fired - combined alerts that make it easy to cover multiple tickers
  • Bullish Trend and Bearish Trend - fires while the master trend is trending in that direction
  • Strong Bullish Trend and Strong Bearish Trend - fires when either of the strong all timeframe trend checks is active
  • Strong Bullish Trend + Pullback and Strong Bearish Trend + Pullback - the pullback entry signals
  • Bullish Trend Score and Bearish Trend Score - the combined score signals
  • No Longer Trending Bullish and No Longer Trending Bearish - fires when the master trend ends, useful as an exit warning


Set these up through TradingView's alert menu so you can get notified about strong trends on markets you do not have charts open for.

-------------------------------------------------------------------

Higher Timeframe Data, Signal Confirmation and Repainting

Everything on a closed candle is final. Once a candle closes, its colors, signals, scores and background coloring are locked in permanently and can never be removed, moved or repainted afterward. Every signal you see on closed candles printed in real time and stayed there.

The live candle updates in real time. All of the checks also run on the current, still forming candle so you can catch moves early, which means a signal or candle color can appear and then change if conditions change before that candle closes. If you only want confirmed signals, wait for the candle to close with the signal still showing. Every alert is already coded to fire only on closed candles, so alerts never fire on unconfirmed signals.

How higher timeframe data is handled. The internal measures for each timeframe are built 2 ways, and neither one repaints. The rolling data windows behind the scores only take in data from candles that have fully closed, so each data sample is added once and never changed. The previous candle values for each timeframe come only from the last fully completed candle of that timeframe, which is locked historical data that only updates when a new candle of that timeframe finishes. The script does not use lookahead to read future data anywhere.

Warm up on new charts. A timeframe's score reads 0 and shows neutral until a full window of data has loaded for it, so early chart history shows gray candles and neutral scores instead of readings built from partial data. On very low chart timeframes, especially seconds charts, older history stays neutral because TradingView limits how much lower timeframe data is available. A score built from half a data window is not a score you should trade off of, so the script waits for the full window instead.

-------------------------------------------------------------------

Settings Overview

  • Market Hours - Stocks (6.5 hours a day, 5 days a week), Futures/Forex (23 hours a day, 5 days a week) or Crypto (24 hours a day, 7 days a week). Set this to match your symbol.
  • Candle Coloring - Master trend coloring on/off plus the bullish, bearish and neutral colors
  • Higher Timeframe Direction Filter - The Signals Only Allowed In Direction Of Timeframes 4 & 5 toggle
  • Timeframes #1-#5 - Each of the 5 slots has its timeframe, a toggle for whether the master trend uses it and a toggle for its score plot in the bottom panel
  • Ranging Market Filters - 3 filters, each with an on/off toggle and a dropdown to pick which timeframe it watches
  • Signal Toggles - Separate on/off switches for the strong buy/sell crosses, the pullback signals, the strong all timeframe trend signals and the trend strength score signals
  • Background Colors - The buy and sell colors used by the background signals
  • Trend Score Labels - Labels on/off, text color, label offset in bars and the up, down and neutral label colors


-------------------------------------------------------------------

Markets and Chart Timeframes

The indicator works on every chart timeframe, including seconds charts and custom timeframes like 45 minute or 3 hour. The one rule is that all 5 of your trend timeframes must be set higher than your chart timeframe.
  1. Set Timeframe #1 higher than your chart. If you trade the 1 minute or 5 minute chart, set it to 15, 60 or 240.
  2. Set each timeframe after that one step higher than the one before it so they run in order from 1 to 5. Example: 15, 60, 240, 1D, 1W or 240, 1D, 1W, 1M, 3M.
  3. Keep all 5 in order even if some are turned off, because several signal types use all 5 timeframes and the script compares each timeframe to the next one up.


The timeframe options for each slot are 5, 10, 15, 60, 240, 1D, 1W, 1M, 3M, 6M and 12M.

If one of your timeframes is set at or below your chart timeframe, a warning shows in the bottom panel telling you exactly which timeframe to increase. That timeframe reads neutral and blocks signals until you fix it, and the rest of the script keeps running instead of erroring out.

The indicator works on stocks, crypto, forex, futures and any other market, just make sure the Market Hours setting matches the market you are on. Keep in mind the calculations need volume data, so symbols with no volume data at all, such as some indices, will not produce trend readings or signals. Trade the volume backed version of those tickers instead.

-------------------------------------------------------------------

Important Notes and Limitations

  • Turn off your chart's candle coloring (gear icon, Symbol tab) so it does not override the master trend coloring. Leaving borders on lets you see the live candle during any short painting delays.
  • All 5 timeframes must be higher than your chart timeframe and kept in ascending order from 1 to 5, even when some are turned off.
  • The Market Hours setting must match your symbol or the readings will not be accurate.
  • Long stretches with no signals are normal when the market is moving sideways. That is the indicator keeping you out of the chop on purpose, not something being broken.
  • Symbols without volume data will not produce trend readings or signals.
  • Early chart history and very low chart timeframes show neutral readings while the data windows fill, as covered in the repainting section above.
  • No indicator is right all of the time and past results never guarantee future performance, so treat every signal as one piece of your decision and manage your risk on every trade.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.