# Optimize stop loss and take profit levels with a TradingView backtest Slug: optimize-stop-loss-and-take-profit-levels-with-a-tradingview-backtest. Canonical: https://tradingtune.com/blog/optimize-stop-loss-and-take-profit-levels-with-a-tradingview-backtest ## Summary Test stop loss and take profit ranges on your TradingView strategy, then check whether the findings hold up on unseen data. ## Key facts - Test stop loss and take profit values as a pair while keeping the rest of the experiment fixed. - Check that each input controls the intended exit and uses the expected unit. - Review nearby combinations and trade details rather than relying on a single ranking. - Keep later data separate from the search and record the assumptions behind the test. ## Outline - How can you test exit levels on your strategy? (#how-can-you-test-exit-levels-on-your-strategy) - What must the exit inputs control? (#what-must-the-exit-inputs-control) - How do you choose ranges for the stop and target? (#how-do-you-choose-ranges-for-the-stop-and-target) - How do you run the combinations by hand? (#how-do-you-run-the-combinations-by-hand) - What should you compare besides the ranking? (#what-should-you-compare-besides-the-ranking) - How do costs and fills affect the comparison? (#how-do-costs-and-fills-affect-the-comparison) - How do you inspect nearby combinations? (#how-do-you-inspect-nearby-combinations) - How do you check the pair on unseen data? (#how-do-you-check-the-pair-on-unseen-data) - When is the test not ready to interpret? (#when-is-the-test-not-ready-to-interpret) - Sources (#sources)