MSL.
Get access
Buy Sell Signals
OverviewGet access

Signals and trade management

Buy Sell Signals

Adaptive-rail BUY and SELL signals with entry, stop, and three targets, plus a breakeven stop after TP1.

Included inPro

In short

What it is
A trend overlay with an adaptive rail and an ATR envelope. A confirmed close beyond the envelope prints BUY or SELL and draws the whole trade: entry, stop, three targets at 0.5, 1.0, and 1.5R, and one fixed rule for the stop after TP1.
Best for
Traders who manage the exit themselves and want the tool to protect the entry after the first target and to get back into a trend that survives a stop.
Markets
Liquid crypto, futures and commodities, indices, FX majors, and large-cap stocks, on standard candles.
Timeframes
H1 and up. Heikin Ashi, Renko, Kagi, Point and Figure, and Range bars are not supported.
Plan
Pro

A BUY or SELL is only the first half of a trade. Buy Sell Signals draws the second half the moment the signal prints: an entry, a stop, three targets, and a single rule for what the stop does once the first target is reached. An adaptive rail with an ATR envelope decides when the state changes, and everything after that follows printed rules, with no trailing and no discretion. The corner table scores only trades that have already closed, so a trade still sitting near TP2 cannot flatter the numbers.

What it does

The tool reads the market state, opens one trade at a time on a clean break, and manages that trade by a short rule set, printed in full below.

  • Follows price with an adaptive rail. The rail is a moving reference with a variable speed. The speed comes from directional efficiency, Perry Kaufman's measure: the net distance price traveled over the last 20 candles divided by the total path it walked to get there. A clean run scores near one and the rail switches to its fast response. A range that ends where it started scores near zero, and the rail drops to its slow response and barely moves, so it holds still through the chop and leaves the small turns inside it alone.
  • Changes state only on a real break. An envelope of 1.6 times the 21-candle ATR sits on each side of the rail. The state flips to UP when a confirmed candle closes above the upper edge by at least the flip margin (0.15 ATR by default), and to DOWN on the mirror break below the lower edge. A close that merely touches the edge changes nothing.
  • Prints BUY and SELL with a trade map. Every entry, re-entries included, gets a label and five lines projected to the right: Entry at the signal close, SL, and TP1, TP2, and TP3 at 0.5, 1.0, and 1.5 times the initial risk.
  • Protects the entry after TP1. From the candle after TP1 the stop sits at the entry price and stays there. Nothing trails, so from that point the trade ends either on a return to entry or when the state flips against it.
  • Gets back into a live trend. A trend can outlive a stop, so after a stop or a TP1 CLOSE exit, the next close beyond the envelope in the same direction opens a new trade with its own levels, as long as the state still holds.
  • Keeps the statistics honest. A corner table shows the state, the last signal, the setup status, the move of the last trade, and how often TP1, TP2, and TP3 were touched over the last 50 closed trades. An open trade joins the sample only once it has closed.

The trade rules, all of them

  • Entry is the close of the signal candle. It is a reference for the arithmetic, and your own fill will differ.
  • Initial stop. For a BUY it goes below the lower envelope edge plus an ATR buffer (0.10 ATR), and for a SELL above the upper edge. With Limit Initial Stop Distance on, the tool also computes a plain stop 2.0 ATR from entry and keeps whichever of the two is closer, so a wide envelope cannot hand you an oversized first risk. With the defaults the cap usually decides: a BUY close sits at least 1.75 envelope ATR above the rail and the lower edge another 1.6 below it, so the envelope stop lands 3.45 envelope ATR away or more, against a cap of 2 protection ATR.
  • Targets. Entry to stop is the initial risk, 1R. TP1, TP2, and TP3 sit at 0.5, 1.0, and 1.5R and never move once the trade is open.
  • After TP1 the stop moves to entry from the next candle. If the candle that reached TP1 closes back at or beyond the entry, the trade exits at that close and the label reads TP1 CLOSE, because the stop at entry was not active yet on that candle.
  • Exits. A trade ends in one of four ways: on the initial stop (SL), on the stop at entry (BE), at the close of the TP1 candle under the rule above (TP1 CLOSE), or on a state flip against it (REVERSE), which exits at the close of the flip candle. No new trade opens on an exit candle, so after a flip the opposite BUY or SELL needs a later close beyond the envelope.
  • Gaps and crowded candles. A gap through the stop is priced at the worse of the open and the stop. When one candle touches both TP1 and the stop, TP1 is credited and the trade still exits at the stop. TP2 and TP3 are never credited on a stop candle.

Try it

Two inputs from the live tool drive the demo. The Envelope ATR Multiplier (default 1.6) sets how far each envelope edge sits from the rail. Drag it to the right and the state needs a bigger move before it changes, so entries come later and fewer of them fire in the range on the left of the chart.

The Limit Initial Stop Distance checkbox (on by default) decides where the stop goes. With it on, the closer of the envelope stop and the 2 ATR stop wins, which at the default width is usually the ATR one. Switch it off and the stop moves past the far envelope edge, so every widening of the envelope widens the risk and pushes the three targets further out. The readouts show which stop set the last trade, how many trades have closed, and how many of them touched each target.

SELLBUYBUYTP1TP2TP3Entry
last stop set by:ATR cap
closed trades:2
TP1 / TP2 / TP3 touched:1 / 1 / 0

Synthetic data with a stand-in for the adaptive rail, for illustration only. The fill runs from the rail to the active envelope edge. A BUY prints when a candle closes above the upper edge by at least the flip margin, and that close becomes the entry. The red stop sits past the lower edge plus a buffer, or at the plain ATR stop when the cap is on and that stop is closer. TP1, TP2, and TP3 sit at 0.5, 1.0, and 1.5 times the initial risk. After TP1 the stop moves to entry (yellow line) and stays there, and after a stop the next close beyond the envelope opens a fresh trade while the state holds. Purple dots mark target touches. The real indicator runs on your TradingView chart.

In plain words

You buy at the gray Entry line. The red SL line below it is where you admit the trade was wrong, and the gap between the two is one step of risk, called 1R. The green lines above are targets at half a step, one step, and one and a half steps.

Once price reaches the first green line, the Entry line turns yellow. From the next candle your stop sits at the price you paid, so a full round trip back costs you nothing before fees (a gap below the entry is the exception). If the trend is still alive after a stop, the next close beyond the envelope puts you back in with a fresh set of lines.

In the live tool these two inputs sit next to the rail settings (Efficiency Length, Fast Response Length, Slow Response Length), the Min Flip Distance ATR filter, SL Buffer ATR, and the three target multiples.

Markets, phases, timeframes

Assets and markets

  • Crypto: BTC, ETH, and liquid majors like SOL and BNB.
  • Futures and commodities: ES, NQ, gold (GC), and crude (CL).
  • Indices and large-cap stocks: the Nasdaq 100 and S&P 500, NVDA, AAPL, MSFT.
  • FX majors: EURUSD, GBPUSD, USDJPY, and the main crosses.
  • The chart examples in the TradingView description show ETH and gold on H4, the Nasdaq 100 on H1, and NVIDIA on D1.
  • Standard candles only. Heikin Ashi, Renko, Kagi, Point and Figure, and Range bars change the prices underneath and break every level the tool draws. Thin, gappy instruments also suffer, because a gap can jump the stop and the targets before the script can react.

Market phases

  • Clean trends: the rail runs at its fast response, one entry can work through all three targets, and the trade then sits protected at entry until the state flips. The catch is that a long trend can give back most of its move before that flip comes.
  • Pullbacks inside a trend: a protected trade may be taken out at entry. If the state holds, the next close beyond the envelope re-enters, and the new trade measures its own risk and targets from there.
  • Ranges: the rail slows down and holds still, so a small turn inside the range usually stays inside the envelope and flips nothing. Some flips and short trades still get through; a larger Envelope ATR Multiplier or Min Flip Distance thins them further at the price of later entries.
  • News and gaps: one candle can pass through the stop and the targets before the script reacts. The exit is then priced at the worse of the open and the stop, which may differ from the price you would actually get.

Timeframes

TimeframeUse
H1The lowest intended timeframe. The most entries and re-entries, and ranges show up as clusters of short trades.
H4A balance of signal count and trend length. Two of the published chart examples run here.
D1Swing and position work. Fewer, longer trades.
W1Rare state changes. Mostly a bias read for the lower timeframes.

The intended range is H1 and up. On lower timeframes the envelope is narrow in price terms, so ranges produce more flips and the costs you pay on each trade weigh more against 0.5R.

What you see on the chart

The tool draws the rail and the active edge of its envelope with a fill between them in the color of the state. Every entry gets a BUY or SELL label and a set of level lines projected 50 candles to the right, target touches get their own labels, and a corner table sums it up.

Rail and channel (state up)

The rail and the lower envelope edge, filled green while the state is up. The lower edge is the level a SELL has to break, and it is also where the initial stop of a BUY is measured from.

Rail and channel (state down)

The rail and the upper envelope edge, filled red while the state is down. The color changes on the candle whose close flips the state.

BUY label

Printed under the lower envelope edge (0.8 ATR below it by default) at every long entry, re-entries included.

SELL label

The mirror of BUY: printed above the upper edge at every short entry.

Entry line

A gray line at the close of the signal candle with its price, the reference the stop and targets are measured from.

SL line

The initial stop with its price. It disappears once the stop has moved to entry.

Protected entry

After TP1 the Entry line and its label turn yellow. From then on the stop is the entry price, and no separate breakeven line is drawn.

TP1, TP2, and TP3 lines

Three target lines at 0.5, 1.0, and 1.5R, fixed for the life of the trade. The whole set is removed when the trade closes.

1TP, 2TP, and 3TP labels

A label at each target touch with the move from entry in percent. They stay on the chart as a history of past trades.

Exit labels

Off by default. When switched on they mark where each trade ended: SL, BE (stop at entry), REVERSE with the move, or TP1 CLOSE with the move.

Dashboard

A seven-row table in the top right corner by default. The STATE cell is green for up and red for down.

RowShowsValues
STATEThe current state of the rail and envelopeUP, DOWN, NONE
Last SignalDirection of the most recent entryBUY, SELL, NONE
SetupWhere the current or last trade standsWAITING, INITIAL STOP, BREAKEVEN, or CLOSED with the reason (SL, BE, TP1 CLOSE, REVERSE)
MovePercent from entry to the current close, or to the exit price once the trade has closedA percent, or n/a
TP1, TP2, TP3Share of the last closed trades that touched each target, with the sample sizeA percent and a count, like "64% / 50", or n/a

How to use it

1
Read the state

A green fill with STATE on UP means the tool takes only longs, a red fill with DOWN means only shorts. At the very start of the history, before the first break, the rail is gray and STATE reads NONE.

2
Take the entry from the label

A BUY or SELL prints on the close of the candle that broke the envelope. That close is the reference entry; whether you enter there or on the next open is your call.

3
Take the stop and targets from the map

The red line is the stop, the green lines are TP1, TP2, and TP3. The tool places no orders and takes no partials, so decide before entry how much of the position you close at each target.

4
After TP1, manage the rest yourself

The Entry line turns yellow and Setup reads BREAKEVEN. The stop now waits at entry and does not follow price, so you decide whether to bank more at TP2 and TP3 or hold the rest until the state flips. With exit labels off by default, a flip shows as the fill changing color and Setup reading CLOSED / REVERSE, so set the Trend Exit alert if you want a ping.

5
After a stop, watch for the re-entry

If the state still holds, the next close beyond the envelope prints a new label and fires the Re-entry Signal alert. It is a fresh trade with its own stop and targets.

6
Tune to the instrument

For fewer, later signals, raise Envelope ATR Multiplier or Min Flip Distance ATR. To keep the rail still in ranges, raise Slow Response Length. If the tool re-enters too eagerly on your market, switch re-entry off.

Typical scenarios

  • Scale out along the map. Take part at TP1 and TP2, then hold the rest with the stop at entry until TP3 or a state flip.
  • Trend filter for another system. Take your own longs only while STATE reads UP and shorts only while it reads DOWN.
  • Alert-driven routine. Set alerts on BUY Signal, SELL Signal, Breakeven Activated, Stop Exit, TP1 Close Exit, and Trend Exit, and look at the chart only when one fires. Re-entries already fire the BUY or SELL alert.

Buy Sell Signals or Profit Engine

Both Pro tools draw the same trade map: entry at the signal close, a stop past the far band or envelope edge plus an ATR buffer with an optional ATR cap, TP1, TP2, and TP3 at 0.5, 1.0, and 1.5R, and the stop moved to entry after TP1. They part ways on the engine and on what happens after the first target.

Buy Sell SignalsProfit Engine
EngineAdaptive rail driven by directional efficiency, with an ATR envelopeA slow-drifting center that jumps halfway to price on a far close
Signal timingCommitted on confirmed candles onlyEvaluated on every update, so a label can vanish before the close
After TP1Stop parks at entry, no trailingStop moves to entry, then trails with ATR
After a stopRe-enters on the next close beyond the envelope while the state holdsNo re-entry

In Buy Sell Signals the TP rows count closed trades only, so an open trade never inflates them. Pick it if you manage the exit yourself and want the tool to protect the entry and get back in; pick Profit Engine if you would rather let the trail do the managing.

When to ignore the signal

  • The state flipped two or three times over the last dozen candles. The market is ranging and the next flip is likely more of the same.
  • The signal candle is several times the size of its neighbors. A breakout confirms after part of the move has happened, and on this candle a large part already has.
  • A major news release is minutes away. A single candle can jump the stop and every target.
  • The chart is on Heikin Ashi or Renko, or below H1.

Settings and signals

Defaults below are the real values from the indicator, grouped as Adaptive Rail, Signal Engine, Trade Model, Visuals, and Dashboard. Every input also has a tooltip in TradingView. Change one thing at a time.

ParameterDefaultEffect
Rail Sourcehlc3Price series the rail follows. hlc3 averages the candle and reacts less to a single spike; close tracks settlement prices exactly.
Efficiency Length20Lookback for directional efficiency. Higher judges efficiency over a longer window, so the rail changes speed more slowly. Lower reacts to a fresh impulse sooner.
Fast Response Length4Rail speed when movement is highly directional. Lower catches a running trend almost at once. Must be smaller than Slow Response Length.
Slow Response Length40Rail speed when movement is choppy. Higher keeps the rail nearly still through a range and suppresses noise flips.
Envelope ATR Length21Lookback for the ATR that sets the envelope width. Higher is a smoother, slower volatility estimate.
Envelope ATR Multiplier1.6Distance from the rail to each envelope edge, in ATR. Higher needs a larger excursion before the state changes, so signals get rarer and later.
Min Flip Distance ATR0.15Extra distance past the envelope edge, in ATR, that a close needs before it counts as a break. Higher discards weak breaks that hug the edge.
Enable Re-entry After StopOnOn: after a stop or a TP1 CLOSE exit, the same direction can be entered again on a later close beyond the envelope while the state holds. Off: a stop is final until the state changes.
TP1 / TP2 Risk/Reward0.5 / 1.0TP1 and TP2 as multiples of the initial risk. Closer targets are touched more often for a smaller move. Must satisfy TP1 < TP2 < TP3.
TP3 Risk/Reward1.5TP3 as a multiple of the initial risk. Higher needs a longer run and is touched less often.
SL Buffer ATR0.10Extra room beyond the far envelope edge for the initial stop, in ATR. It matters only when the envelope stop is the closer one, and then every target moves out with it. With the cap deciding, as it usually does on defaults, the buffer changes nothing.
Limit Initial Stop DistanceOnOn: a plain ATR stop from entry is also computed and the closer of the two candidates wins. Off: the envelope stop alone decides.
Protection ATR Length14Lookback for the ATR behind the stop cap, kept separate from the envelope ATR.
Initial Stop ATR Multiplier2.0Distance of the capped stop from entry, in ATR. Lower caps the first risk harder; higher lets the envelope stop win more often.
Show Trend ChannelOnShow the rail, the active envelope edge, and the fill.
Show BUY / SELL LabelsOnPrint a label at every entry, re-entries included.
Show Entry / SL / TP LevelsOnDraw the five level lines with prices for the open trade.
Level Projection Bars50How far to the right the level lines reach. Visual only: the trade does not expire.
Show Historical TP LabelsOnPrint 1TP, 2TP, and 3TP labels with the move at each touch.
Show Exit LabelsOffMark where each trade ended: SL, BE, REVERSE, or TP1 CLOSE.
Show DashboardOnShow the status table.
Positiontop_rightCorner for the table: top right, top left, middle right, or bottom right. Needs a chart refresh.
Closed Trades Sample50Number of latest closed trades behind the TP1, TP2, and TP3 rows. Higher is smoother and slower, lower more reactive.

The rest of Visuals is cosmetic: BUY / SELL Label Offset ATR (0.8 / 0.8), TP Label Offset ATR (0.1), TP Label Transparency (55), and three colors (BUY / SELL Color, TP Label Color, Protected Entry Color).

The indicator exposes ten alert conditions through alertcondition. Every event is committed at the candle close, so set the alerts to Once Per Bar Close. A re-entry fires both Re-entry Signal and the BUY or SELL alert.

AlertFires when
BUY SignalA long trade opens, re-entries included
SELL SignalA short trade opens, re-entries included
Re-entry SignalThe new trade is a re-entry after a stop or a TP1 CLOSE exit
TP1 ReachedPrice touches TP1
TP2 ReachedPrice touches TP2
TP3 ReachedPrice touches TP3
Breakeven ActivatedThe stop moves to entry for the next candle
Stop ExitThe trade exits on the initial stop or on the stop at entry
TP1 Close ExitTP1 was reached and the same candle closed back at or beyond entry
Trend ExitThe trade exits because the state flipped against it

How to read this

BUY
A bet on a rise: buy lower, aim to sell higher. The green label under price.
SELL
A bet on a fall. The exchange lets you sell an asset you do not own and buy it back cheaper for the difference. The red label above price.
Adaptive rail
The moving reference line. It speeds up when price moves in one direction and slows almost to a stop when price wanders back and forth.
Directional efficiency
Net distance price traveled divided by the total path it walked. A straight run scores close to 1, a range that ends where it began scores close to 0.
ATR
Average candle range over a recent window, roughly how much the asset moves right now. The envelope, the flip margin, the buffer, and the stop cap are all measured in it.
Envelope
Two lines at a fixed ATR distance above and below the rail. A close beyond one of them, plus the flip margin, changes the state.
1R
One unit of risk: the distance from entry to the initial stop. TP1 at 0.5R aims for half of what you risk, TP3 at 1.5R for one and a half times.
Breakeven
The stop sitting at the entry price. A return to entry then closes the trade at roughly zero, before fees and barring a gap.
TP1 CLOSE
An exit at the close of the candle that reached TP1 and then fell back to entry, since the breakeven stop only starts on the next candle.
Re-entry
A new trade in the same direction after a stop or a TP1 CLOSE exit, taken on the next close beyond the envelope while the state still holds.
Touch rate
The share of closed trades in which price reached a target at least once, wicks included. It knows nothing about fees, sizing, slippage, or partial exits, so do not read it as a win rate.

Risk and position size

The trade map puts your risk on the chart before you click anything, and how you size against it shapes the result more than any single signal. A wrong flip with the stop respected costs 1R. The same flip with a doubled position costs 2R, and with the stop dragged lower it costs whatever the market decides. Let the red line set your size.

1
Cap the risk at 1 to 2 percent

On any one trade, risk no more than 1 to 2 percent of the account. A full stop then costs exactly that, and even ten losses in a row leave more than 80 percent of the account intact.

2
Read the stop off the map

Your entry is the signal close, your stop is the red line. The gap between them is 1R, your risk per unit.

3
Let the risk set the size

Position size = (cash you are willing to lose) / (distance from entry to stop). A wider stop means a smaller size for the same cash risk.

In plain words

Account $1,000, risk 1 percent, so $10 on this trade. A BUY prints and the entry is $100. The stop sits at $96, so 1R is $4 and the size is $10 / $4 = 2.5 units. A full stop loses exactly $10.

TP1 is at $102, TP2 at $104, TP3 at $106. On the whole position they are worth $5, $10, and $15. Once TP1 is touched the stop moves to $100, so a fall back to entry costs nothing before fees, unless the market gaps below $100 and the exit happens at the open. Note the asymmetry: TP1 sits at half the risk, which is why it gets touched so often, and a trade closed only there earns half of what a stop costs. That is why it cannot be the whole plan.

Common mistakes

  • Reading the TP rows as win rates. A near target is touched more often because it is near, and the defaults put TP1 at half the risk on purpose. The rows are for comparing your own settings and instruments.
  • Expecting the stop to follow price. After TP1 it stays at entry, so locking in more of a long trend is your job.
  • Running it on Heikin Ashi, Renko, or Range bars. The levels are computed from prices those charts do not trade at.
  • Putting the whole balance on one trade. A single gap through the stop then costs far more than 1R.
  • Taking every re-entry in a sideways market. If the tool keeps getting back in on your instrument, switch re-entry off or widen the envelope.
  • Re-tuning after every loss. Leave the defaults alone for twenty to thirty closed trades before you change anything.

Limitations

Important: This is an analysis and planning tool. It draws levels and statistics, places no orders, sizes no positions, and manages no account. The state changes only on confirmed candles and every printed label stays where it was printed, which also means a breakout entry confirms after part of the move has already happened, sometimes a large part.
  • Ranges still produce flips and short trades. The envelope multiplier and the flip distance thin them out at the cost of later entries.
  • With the stop at entry and no trail, a long trend can give back most of its move before the state flips and closes the trade.
  • Gaps and news candles can pass through the stop and the targets before the script reacts. The exit is then priced at the stop level or the open, which may differ from the fill you would actually get.
  • The TP rows are touch rates over past closed trades. They include no fees, slippage, or sizing and predict nothing about the next trade.
  • Defaults are a starting point. No level is guaranteed to be reached, and every trading decision stays with you.

Educational tool. Not financial advice. Trading involves risk.

Want the full toolkit?

Every package bundles indicators that work together. Pick the tier that matches your workflow.

See pricing