← OptiTrade

TradingView Indicator with Entry, Stop-Loss and Take-Profit Levels

OptiTrade's TP-SL Strategy is a TradingView indicator that draws a Stop Loss box and up to four Take Profit lines the moment it gives a Buy or Sell entry, so you see your risk and your targets before you enter. It doesn't repaint, it runs on TradingView's free plan, and you get access for just $14.

Updated

  • Every Buy or Sell entry comes with a Stop Loss box and 1 to 4 Take Profit lines on the chart.
  • The Stop Loss is sized in ATR and each target is set by a Risk-Reward ratio, so every level follows a fixed rule.
  • TradingView alerts fire on the entry, on each Take Profit and on the Stop Loss.
  • Connectors such as TradeAdapter, SignalStack and CrossTrade.io can turn those alerts into broker orders.
  • OptiTrade doesn't repaint: once a signal appears on your chart, it stays exactly where it is.

What a stop-loss and take-profit indicator does

Most buy/sell indicators only tell you when to get in. Where to get out is left to you, and that is usually the part traders improvise. A stop-loss and take-profit indicator draws the exit plan together with the entry: a Stop Loss where the trade is wrong, and one or more Take Profit levels where you take money off the table.

That changes three things on every trade:

  • You know your risk and your reward before you click buy or sell, not after.
  • Every trade follows the same rule for its stop and its targets, so you are not guessing level by level.
  • Each level is a defined event, so alerts and automation can act on the exits as well as the entry.

How OptiTrade draws the entry, stop loss and take profits

The TP-SL Strategy is the most complete OptiTrade 2.0 strategy and the one our TP-SL guide builds its examples on. On your chart, a trade looks like this:

  1. OptiTrade gives a Buy or Sell entry signal.
  2. It immediately draws a Stop Loss box (your maximum risk) and up to four Take Profit lines (your targets).
  3. As price reaches each Take Profit, part of the trade closes.
  4. If price reaches the Stop Loss first, the trade closes for a controlled loss.
  5. An exit label shows the result of each finished trade, so you can read the history directly on the chart.

Two display settings keep the chart readable. Show TP/SL Zones shows or hides the Stop Loss and Take Profit boxes and lines (with it off, the entry and exit labels stay). Show Trade Sizes prints the exact trade size on the entry label, for all signals or only the newest ones.

How the stop loss and take profit levels are set

Three settings decide where the levels sit. In Automatic mode, OptiTrade tests ranges of them on your chart and applies the combination that tested best. In Manual mode, you type in the exact values and OptiTrade uses precisely those.

TP-SL Strategy settings that place the stop loss and take profits
SettingWhat it controlsValues
Take ProfitsHow many Take Profit targets each trade gets. One gives a single clean target; more let you scale out in stages.1 to 4
Stop Loss (size)How far the Stop Loss sits from the entry, measured in ATR, the average size of the last 14 candles. A Stop Loss of 2 is about two candles away.Automatic mode tests a range, for example 1 to 4
Risk-Reward ratioHow far the Take Profit sits compared with the Stop Loss. With a 2 ATR Stop Loss and a Risk-Reward of 3, the Take Profit is 6 ATR away.Automatic mode tests a range, for example 1 to 4.5
Source: the TP-SL Strategy guide. ATR is the average size of the last 14 candles, roughly one candle.

Why ATR-based stops

A stop measured in ATR adapts to the market you are on. Two ATR on a quiet chart is a small distance; two ATR on a fast-moving chart is a wide one. The stop always sits about the same number of candles away, whatever the symbol or timeframe, and the Risk-Reward ratio scales the targets from that distance.

Position size for each trade

The Risk Management section turns the stop distance into a trade size. You enter an Account Balance (a manual input; it does not read your broker balance) and choose a Mode: Fixed Drawdown (the default), Fixed Percent of the balance, or a Fixed Size in units. A tighter stop gives a larger quantity for the same risk budget, so check contract size and buying power with your broker as well.

Alerts on the entry, every take profit and the stop loss

An alert notifies you when an eligible live strategy order fills: an entry, a Take Profit or a Stop Loss. You get it through the notification methods you pick in TradingView, such as app push or email. Setting one up:

  1. In the indicator settings, under Alert Settings, set Alert Message for to Manual Trading. The message then contains the signal, the ticker and the exact trade size, so you can place the trade yourself.
  2. Open the Alerts panel (the clock icon) in TradingView and click the plus button.
  3. Under Condition, select the strategy on your chart, and choose Order fills only if TradingView offers a trigger choice.
  4. Paste {{strategy.order.alert_message}} into the Message field, so TradingView fills in the real signal details.
  5. Choose your notification methods and click Create.

TradingView saves a snapshot of the settings when you create an alert. After you change the code, the settings, the symbol or the timeframe, delete the old alert and create a new one. Every triggered alert is listed under the Log tab of the Alerts panel. Full steps: Signal Alerts guide.

Placing the stop loss and take profit orders automatically

The same alerts can trade for you. OptiTrade produces a signal, the alert sends it through a webhook to a connector, and the connector forwards the order to your broker, which opens or closes the trade. You keep control of the settings; the connector only executes.

For automation, set Alert Message for to Automatic Trading and fill in the Custom Alert Messages with your connector's messages before you create the alert. The TP-SL Strategy has twelve fields: Long and Short Entry, Long and Short Stop Loss, and Long and Short TP1 to TP4. The Stop Loss and Take Profit fields are the exits, so each one gets the connector's message for closing that position.

Connectors listed in the OptiTrade automation guide
ConnectorPlatformsBrokers
TradeAdapterMetaTrader 4 and 5Capital.com, OANDA, Alpaca, Binance, Binance US, Bybit, MEXC, KuCoin, Kraken, Coinbase, OKX, BingX, Bitget, Gate.io
SignalStackMetaTrader 4 and 5, cTraderCapital.com, Oanda, Alpaca, E*TRADE, Interactive Brokers, Charles Schwab, AutoShares, BitMEX, Ironbeam, Fyers, FXOpen, Forex.com, Binance, BingX, Bitget, BitMart, Bybit, Coinbase, Gemini
CrossTrade.ioNinjatraderLinks to the whole platform rather than a single broker
Source: the Automatic Trading guide, which also lists the markets each broker covers. Connectors are separate services with their own sign-up and message format.

Using more than one Take Profit? Check how your connector handles each exit message and position quantity. If it can only close the whole position, use one Take Profit. Follow the connector's message format and test it on a demo account before you switch on broker execution.

Fixed levels or signal-to-signal: which OptiTrade strategy to use

OptiTrade includes four core strategies. Two of them draw fixed stop-loss and take-profit levels; the other two exit on the next signal instead.

How each OptiTrade core strategy handles exits
StrategyStop loss and take profitHow the trade ends
TP-SL StrategyStop Loss box + up to 4 Take Profit lines on every entryPart of the trade closes at each Take Profit; the Stop Loss closes it for a controlled loss
OptiTrade V1.0 (Multi-TP)One Stop Loss + 2, 3 or 4 Take Profits, sized in ATR or percentActive trades show the exact price of every Take Profit and the Stop Loss
High Win Rate StrategyNo Stop Loss or Risk-Reward dials to tuneExits when the opposite signal appears
Buy-Sell StrategyNo fixed Take Profit or Stop LossThe next opposite signal closes the trade and opens the other side
Sources: TP-SL, V1.0, High Win Rate and Buy-Sell guides.

If you want a clearly defined risk on every trade, use TP-SL. If you would rather ride a trend and always be in the market, Buy-Sell flips from long to short on every signal. Many traders keep several strategies on separate charts. For a wider look at signal tools, see the best TradingView buy/sell indicators.

Getting it on your TradingView chart

OptiTrade is delivered as a personal access code. After you subscribe, open your OptiTrade access page, click Copy Code, and paste it into the Pine Editor in your own TradingView account. No invite or TradingView username is needed. The saved script stays in your TradingView account, and the step-by-step setup guide walks through it (use the TradingView website on a computer for the first install).

  • OptiTrade runs on TradingView's free plan. A paid plan adds TradingView's own extras, but it is not required.
  • It works on all charts and all timeframes, and you can trade the signals on any platform you use: MetaTrader, NinjaTrader, thinkorswim or your broker's app.
  • Your purchase includes 4 core indicators, plus 4 bonus indicators on your access page.
  • OptiTrade doesn't repaint. Once a signal appears on your chart, it stays exactly where it is. More on that: non-repainting indicators explained.

You get access for just $14, or you can choose lifetime access (see pricing). Every payment is covered by our Lifelong Refund Policy: any charge is refundable, with no time limit (Refund Policy). You can cancel anytime with one click from the link in your order confirmation email.

About OptiTrade

OptiTrade is technical-analysis software for TradingView: indicators and strategies that draw buy and sell labels, trend lines and exit levels on your own chart, delivered as Pine Script code you copy from your personal access page at optitrade.shop into TradingView.

OptiTrade (optitrade.shop) is TradingView indicator software. It is not a broker, does not hold or manage your money and does not give investment advice. It is a different business from other companies with similar names. OptiTrade is an independent product and is not made or endorsed by TradingView.

Frequently asked questions

Is there a TradingView indicator that shows stop loss and take profit levels?

Yes. OptiTrade's TP-SL Strategy draws a Stop Loss box and up to four Take Profit lines on your TradingView chart the moment it gives a Buy or Sell entry, so the exit plan is visible before you enter. Details: TP-SL Strategy guide.

How many take profit levels can I use?

From one to four. Use one for a single clean target, or up to four to close the trade in stages as price reaches each level.

Can I get an alert when a take profit or stop loss is hit?

Yes. Create a TradingView alert on the strategy with {{strategy.order.alert_message}} as the message, and it notifies you on eligible order fills: the entry, each Take Profit and the Stop Loss. Details: Signal Alerts guide.

Can a bot place the stop loss and take profit orders for me?

Yes. A connector such as TradeAdapter, SignalStack or CrossTrade.io receives the alert through a webhook and forwards the order to your broker. The TP-SL Strategy has twelve Custom Alert Message fields: long and short entry, long and short Stop Loss, and long and short TP1 to TP4. Details: Automatic Trading guide.

Does the OptiTrade stop-loss and take-profit indicator repaint?

No. OptiTrade doesn't repaint. Once a signal appears on your chart, it stays exactly where it is.

How much does it cost?

You get access for just $14, or you can choose lifetime access. Every payment is covered by our Lifelong Refund Policy: any charge is refundable, with no time limit. Details: Refund Policy.