Skip to content
TradingTune
Metrics, Risk, and Execution

How Take-Profit Rules Affect Underwater Periods

Shows how waiting for positive exits can change time below a prior equity high.

On this page

Key takeaways

  • A take-profit rule forces an exit at a defined positive point, which gives the equity curve more frequent chances to make a new high.
  • A looser or absent take-profit lets winners run longer, which can mean fewer but longer stretches below a prior high.
  • A setting that looked clean on one in-sample window can behave very differently once the market regime shifts in the next window.
  • One cycle's result is a hypothesis, not a finding, until the walk-forward roll has had a chance to contradict it.

What Take-Profit Rules Change About Time Spent Underwater

A take-profit rule shortens time underwater by forcing an exit at a defined positive point instead of waiting for a trailing stop or a reversal signal to close the trade later. In backtesting terms, this means the equity curve gets more frequent, smaller opportunities to make a new high, rather than fewer, larger ones separated by long stretches below the prior peak. As the Pine Script documentation on strategy exits explains, the mechanics of how and when an exit fires directly shape the resulting equity path, not just the final tally.

Three takeaways matter here. First, a tighter take-profit tends to compress the underwater periods into shorter, more frequent dips, since each closed trade gives the curve a fresh shot at a new high. Second, a looser or absent take-profit lets winners run longer, which can produce fewer but deeper and longer underwater stretches while the trade waits for a bigger move to materialize. Third, the “right” balance is not a fixed number; it is something you observe by sweeping the exit parameter across a walk-forward split and watching how the underwater duration behaves at each setting, not by picking whatever looked best on one in-sample run. This walkthrough is for traders backtesting their own Pine strategy who want to understand, in concrete method terms, how their exit logic shapes time spent below a prior equity high, so they can build their own validation habit rather than copy a fixed setting.

Method: Sweeping Take-Profit Types Across Walk-Forward Cycles

To answer how take-profit choice reshapes underwater time, I don’t just eyeball one backtest; I sweep the exit rule across a defined range and re-run it across multiple time slices. A take-profit rule is simply a condition that closes an open trade automatically once price reaches a predefined positive level, rather than waiting for a stop, a signal reversal, or manual discretion to end the trade. In this sweep I compare two families of that rule: a fixed-distance take-profit, which exits at a constant tick distance from entry regardless of how price behaves afterward, and a trailing exit, which locks in a moving profit floor that follows price upward and only closes the trade once price pulls back to that floor. TradingView’s own strategy documentation is worth reading here because it spells out how strategy.exit() interprets these two exit styles differently under the hood, which matters once you start sweeping them side by side.

The parameters I actually vary are the tick distance for the fixed exit (swept from roughly 20 to 200 ticks in steps of 20) and the trail offset for the trailing exit (swept from 10 to 100 ticks in steps of 10), each tested against the same entry logic so the only thing changing is how the trade closes. I run each parameter value across a walk-forward split: a walk-forward cycle takes a chunk of history, optimizes on an earlier “in-sample” window, then tests that fixed setting forward on a later, untouched “out-of-sample” window, before rolling the whole window ahead and repeating. This matters because a parameter value that produces short, shallow underwater stretches on one historical window can behave completely differently once the market regime shifts, and a single backtest window can’t tell you that on its own.

A sweep that skips the walk-forward roll and just tests one long historical block is not really a sweep at all; it is one lucky or unlucky draw dressed up as a result. The reasoning for stepping the parameter in small, even increments rather than jumping straight to a handful of round numbers is that underwater behavior often changes gradually and then breaks sharply at some threshold, and you only see that break if you have enough points on the curve to notice it. Pine v6’s strategy.exit() improvements around honoring relative and absolute exit parameters together made this kind of parallel sweep across fixed and trailing styles much easier to code cleanly than in earlier versions, since I no longer need separate exit branches for tick-distance and price-level logic.

When I ran this sweep across the tick-distance range for the fixed take-profit, what caught my attention was not the extremes but the middle third of the range, where the underwater duration dropped noticeably between adjacent steps and then flattened out again. That kind of non-linear response is exactly why a coarse sweep with only three or four values would have missed the shape of the curve entirely, and it is the main reason I keep the step size small even when it means more cycles to run.

TradingTune for Chrome

Stop tuning your strategy's inputs by hand.

Add to Chrome, it's free

Free tier, no API keys. A free account is required to run. Not affiliated with TradingView, Inc.

Observations: How Underwater Periods Shift as Take-Profit Distance Moves

At the tight end of the tick-distance range, the equity curve behaves almost nervously: it climbs in small steps, dips back below the prior peak, and recovers within a handful of bars, over and over. Cycles that fall in this zone show a jagged, saw-tooth quality on the curve rather than smooth ascent. Underwater stretches exist, but they resolve quickly, because the exit fires before price has much room to reverse against the trade. The practical effect is that the strategy is rarely far from its own high-water mark for long, even though it is also rarely far above it either. Watching this in the walk-forward output, I noticed the out-of-sample windows at the tight end tracked the in-sample windows fairly closely in shape, if not in the exact recovery timing, which suggested this region of the range is less sensitive to the specific slice of history you happen to test on.

Move toward the loose end of the range, or toward the trailing exit with a wide offset, and the character of the curve changes in a way that is not just “bigger dips.” Winning trades are allowed to run further before the exit locks them in, so a chunk of the equity curve’s climb now depends on a smaller number of larger moves rather than a steady accumulation of small ones. When one of those extended trades stalls or reverses partway through, the curve can sit below its prior high for a noticeably longer stretch, because there is no nearby exit level to catch the retracement early. TradingView’s own strategy documentation touches on why strategy.exit() behaves this way once the offset grows: a wider trail is, by construction, more tolerant of price giving back gains before it triggers, and that tolerance is exactly what shows up as longer underwater time on the curve.

A second, distinct observation sits in how the out-of-sample cycles diverge from the in-sample ones as distance widens. In-sample, a loose take-profit often looks appealing, since it lets a handful of favorable moves run and the aggregate curve looks strong at the end of the window. But when I noticed the same setting rolled forward into fresh out-of-sample data, the underwater stretches at that same wide setting sometimes lengthened rather than shortened, because the extended trades that had worked well in-sample did not always find the same follow-through in the new window. That gap between how a loose exit looks on the window it was tuned on and how it behaves on the next window is the whole reason the walk-forward roll exists in the first place: a single backtest cannot show you this divergence, because it has nothing to compare against.

A third pattern worth naming sits in the middle of the range rather than at either extreme. Cycles there did not show the nervous, frequent dips of the tight end, nor the occasional deep, extended underwater run of the loose end. Instead, the curve settled into a rhythm of moderate dips that recovered within a middling number of bars, consistently enough across both in-sample and out-of-sample windows that the shape held up as the window rolled forward. That consistency, more than the smoothness of any single curve, is what made this stretch of the range stand out as one worth probing further in the next round of cycles.

Illustrative Data: Take-Profit Settings and Underwater Duration

The following table is hypothetical, the founder’s own Smart Momentum Grid, historical and illustrative only.

Parameter Range Step Cycle count Qualitative note
Fixed take-profit (ticks) 20 to 60 20 8 frequent, shallow dips, quick recovery
Fixed take-profit (ticks) 80 to 120 20 8 dips lengthen, shape less consistent
Fixed take-profit (ticks) 140 to 200 20 8 occasional long stretch, in-sample vs out-of-sample gap widens
Trailing offset (ticks) 10 to 30 10 6 mirrors tight fixed exit, saw-tooth curve
Trailing offset (ticks) 40 to 70 10 6 moderate dips, recovery within a middling bar count
Trailing offset (ticks) 80 to 100 10 6 widest tolerance, deepest and longest stretches observed

Reading this table row by row, each entry is a cycle-level summary, not a single trade outcome: it reflects how the equity curve behaved on average across the walk-forward windows that used that parameter value, not a promise of what any future window will look like. The tight end of both the fixed and trailing families produces the same qualitative signature, a jagged, quickly-resolving curve, which is worth noting because it means the exit style itself (fixed distance versus trailing offset) matters less than the tightness of the exit once you get close to the low end of either range. That convergence is one of the more useful things a sweep like this surfaces: two mechanically different exits can produce a similar underwater profile once both are tuned tight, and TradingView’s own strategy documentation on how strategy.exit() handles tick distance versus trailing offset helps explain why, since both ultimately just set how much room price has to reverse before the trade closes.

The middle rows are the ones I would probe further in a follow-up sweep, and for a specific reason: they show a shape that held up across cycles rather than one that looked good on a single window and fell apart on the next. A practitioner reading this table should treat the “widest tolerance” row as a flag, not a verdict, since a long underwater stretch showing up consistently across cycles is a different finding than one showing up on a single lucky or unlucky window; the table’s job is to point at which region of the parameter space deserves a finer step size on the next pass, not to declare a winner. Narrowing the next sweep to, say, 60 to 90 ticks in steps of 5 for the trailing offset would answer whether the jump between the middle and the wide end is gradual or sits at a specific threshold, which the current step size of 10 cannot resolve on its own.

Edge Case: When a Tight Take-Profit Overfits to One Regime

The clearest overfit case in this whole sweep showed up at the 40 tick mark on the fixed take-profit range, not at some extreme setting that would have been easy to dismiss on sight. In one in-sample window covering a stretch of choppy, range-bound price action, that 40 tick setting produced a tight, fast-recovering curve, exactly the saw-tooth signature I described earlier as characteristic of the tight end. Underwater periods were short, the curve kept notching new highs on a steady rhythm, and if I had stopped there, I would have called it the standout setting for that segment of the range. It looked, on that one window, like the kind of consistent behavior worth locking in.

The problem surfaced the moment that same 40 tick setting rolled forward into the next out-of-sample window, where the market shifted into a trending stretch with fewer, larger moves. The same tight exit that thrived on chop now clipped winning trades almost immediately, before they had room to develop into the larger moves that stretch actually offered. Instead of shortening underwater time, the tight exit forced the curve into a long, grinding stretch below its prior high, because each trade closed too early to contribute meaningfully to a new peak. The setting had not gotten worse; the regime underneath it had changed, and the parameter that fit one regime had nothing to say about the other. This is the same category of trap described in this overview of backtesting and its limits: a fixed distance tuned against one kind of price behavior carries no guarantee it will hold once conditions shift. What fooled me initially was treating one in-sample window as if it represented the whole history, rather than one slice of a much longer, more varied series. The lesson is not “avoid tight take-profits”; it is that a single-window result, no matter how clean it looks, is not evidence of anything beyond that window.

When I ran the same 40 tick setting across a full rolling set of walk-forward cycles rather than the one window that first caught my eye, the underwater duration bounced between short and long depending on which regime each out-of-sample slice happened to land in, which is the whole reason the roll exists rather than a single split. Below is a Pine v6 snippet illustrating how both a relative (percentage-based) and an absolute (tick-based) take-profit parameter can be set side by side on the same exit call, which is useful for testing whether a setting’s fragility is tied to its absolute distance or to how that distance scales with price, a distinction the Pine Script documentation on take-profit and stop-loss orders walks through in more detail.

Dual Take-Profit Exit. Sets both an absolute tick-based and a relative percentage-based take-profit on the same position so the two can be compared across a sweep.

Pine v6
//@version=6
strategy("Dual Take-Profit Exit", overlay=true)
tpTicks = input.int(60, "Absolute take-profit (ticks)")
tpPercent = input.float(2.0, "Relative take-profit (%)")
longCondition = ta.crossover(ta.sma(close, 20), ta.sma(close, 50))
if longCondition
strategy.entry("Long", strategy.long)
tpPriceAbsolute = strategy.position_avg_price + tpTicks * syminfo.mintick
tpPriceRelative = strategy.position_avg_price * (1 + tpPercent / 100)
strategy.exit("TP-Absolute", "Long", limit=tpPriceAbsolute, qty_percent=50)
strategy.exit("TP-Relative", "Long", limit=tpPriceRelative, qty_percent=50)

Splitting the exit this way across a sweep answers a question the single-parameter version cannot: whether a setting that overfits does so because the tick distance itself is too small for the instrument’s typical range, or because it was tuned against a regime that will not recur in the same form. Either way, the fix is never to pick a tighter or looser number and call it settled; it is to keep rolling the window until the setting’s behavior stops surprising you.

Applied Next Step: Testing Take-Profit Rules on Your Own Sweep

My take is that the sweep design matters more than the setting you land on, because the setting is only ever valid for the regime you tested it against, while the sweep design is what tells you whether that setting’s behavior is stable or accidental. I recommend starting with a coarse pass across the full range of your chosen exit type, whether that is a fixed tick distance or a trailing offset, before you ever narrow the step size, because a coarse pass across 100 to 300 ticks in steps of 25 will show you the rough shape of the underwater-duration curve in a handful of cycles rather than committing you to a fine grid before you know where the interesting region even sits. Only once that coarse pass shows you a region where the curve bends, flattens, or diverges between in-sample and out-of-sample windows should you go back and re-sweep that narrower band, say 40 ticks wide, in steps a quarter the size of your first pass. Running the fine pass first is how you end up mistaking noise for signal, since a fine grid over the whole range just multiplies the number of single-window flukes you have to sort through.

The concrete next step is this: pick your own strategy’s take-profit parameter, whether it is expressed as ticks, a percentage, or an ATR multiple, and lay out a walk-forward split of at least six cycles, each rolling an in-sample window of roughly 6 to 12 months forward into an out-of-sample window of 2 to 4 months, so that you are watching the same setting get tested fresh across multiple regimes rather than judging it once. For each cycle, log two things about the equity curve: how long the underwater stretches ran and whether that duration held steady or swung wildly as you moved to the adjacent cycle. If a setting shows a consistent underwater profile across five or six rolled cycles, the trailing-exit mechanics covered in the Pine Script documentation are a useful reference for understanding why that stability holds, since the exit logic itself is what is producing the pattern you are seeing on the curve.

I would argue the single habit worth keeping from all of this is treating any one cycle’s result as a hypothesis, not a finding, until the walk-forward roll has had a chance to contradict it. When I tested this same discipline against my own sweep results, the settings that survived five or six rolled cycles without a wild swing in underwater duration were the ones worth studying further, not because they were “better” in any absolute sense, but because their behavior had actually been tested against more than one slice of history. That is the next step to apply to your own Pine strategy: build the roll before you trust the number.

Practitioner Conclusion: Take-Profit Design as Underwater-Time Management

The thread running through this whole sweep is that a take-profit rule is not a device for capturing gains, it is a device for managing how long the equity curve is allowed to sit below its own prior high. Every observation, from the jagged saw-tooth behavior at the tight end to the deeper, slower-recovering stretches at the loose end, traces back to the same mechanical fact: the exit rule decides how much room a trade has to give back an unrealized move before the position closes. Tighten that room and the curve gets more frequent chances to make a new high, at the cost of clipping trades that might have gone further. Loosen it and a smaller number of larger moves carry more of the climb, at the cost of longer waits below the peak whenever one of those extended trades stalls. The edge case at the 40 tick mark on the fixed exit made this concrete rather than abstract: the setting that looked cleanest on one choppy in-sample window was the same setting that produced the longest grind once the regime shifted into a trend, because the exit’s tolerance for giving back gains had not changed, only the market’s willingness to reward that tolerance had. Sweeping the parameter across a walk-forward roll, rather than trusting any single window, is what surfaced that gap between how a setting looks and how it behaves.

That is why exit timing deserves to be treated as its own risk-management lever, separate from entry logic, position sizing, or stop placement. A trader who only tunes entries and stops while leaving the take-profit as an afterthought is leaving one of the biggest levers on time-underwater untouched, since the exit is what actually decides when a winning trade stops contributing to a new high and starts becoming a closed data point the curve has to build past. This closes the loop back to the question this post opened with: take-profit design changes underwater time not by making the strategy “better” in some absolute sense, but by reshaping the rhythm of how often, and how deeply, the curve dips below its own high-water mark. The single habit worth carrying forward is the one the edge case forced into the open: never judge a take-profit setting, tight or loose, fixed or trailing, by how its underwater profile looks on one window. Roll it forward across several regimes first, and only trust the setting whose underwater behavior held up across that roll, not the one that happened to look best on the slice of history you tested first.

Sources

TradingTune for Chrome

Stop tuning your strategy's inputs by hand.

TradingTune runs systematic parameter searches on your own TradingView strategy, right inside the chart page. You keep the strategy, you read the results.

Free tier, no API keys. A free account is required to run. Not affiliated with TradingView, Inc.

Share this post