Yamagishi Complexity Torus LabYamagishi Lab

[F025] How You Treat a Bar That Touches Both Barriers Is What Makes the Win Rate and the Expected Value

Abstract

What this paper asks is what the treatment of a bar that touches both the take-profit and the stop-loss produces — and the answer is: the win rate and the expected value themselves. No new mathematical theorem and no new law is claimed.

First, the share of bars touching both grows as the barriers narrow. On one-hour bars it is a median of 0.2564 at R=5 pips and 0.0043 at R=40. For gold at R=5 it is 0.6186, so in six tenths of the cases the order cannot be read from the bar (Section 3).

Second, and this is the core. ★ Holding the entry, the barriers and the data fixed and changing only the treatment of the ambiguous bar moves the expected value by a median of 1.5597 pips and a maximum of 7.1992 pips. The win rate among decided trades moves from 0.1890 to 0.8077 for gold at R=5 (Section 4).

Third, the favourable-first convention gives a median expected value of +0.8394 pips and the adverse-first convention −0.6850 pips. The convention is making an expected value and a loss that do not exist (Section 4).

Fourth, resolving on five-minute bars cuts the ambiguity to 0.0011–0.0100, but not to zero. ★ The same problem recurs one level down (Sections 3 and 5).

Fifth, and the four conventions agree with the five-minute answer about equally (0.8002, 0.7991, 0.7714, 0.7956). ★ On an ambiguous bar, either choice is right about half the time, so the right convention cannot be chosen (Section 5).

Sixth, ★ even on a synthetic random walk with zero directional information, the favourable-first convention makes +0.3708 pips and the adverse-first one −0.5449 pips. For gold at R=5 the measurement gives −3.1097 / +3.0767 against the random walk's −2.8469 / +2.8370 — essentially the same (Section 6).

Scope of this paper: No new mathematical theorem and no new law is claimed — the triple-barrier method, the indeterminacy of the path inside a bar, optional stopping and random walks are all known. No real course or its proponent is discussed — no real teaching material, author, or vendor is the subject here, and none is named. Trading is not discussed — no costs are included, so the figures here are not trading performance (Section 7). Read the difference, not the level — the measurement carries drift, so the theoretical 0 does not hold exactly; it holds exactly on the synthetic random walk (Sections 4 and 6). The scope is intraday and few instruments — four instruments, six years, one-hour bars. Monthly time-series momentum (dozens of markets, one to twelve month holds) is documented in the academic literature and is not contradicted here. Five-minute bars are not treated as the truth — ambiguity remains there too and is resolved adverse-first (Sections 5 and 7). The overlap is not removed — entries are taken on every bar, so the observations overlap, and no t value is reported (Section 7). No forecast is claimed. Relation to earlier papers: F012 showed that forty-nine placements of take-profit and stop-loss do not move the expected value — this paper measures the indeterminacy that enters when that check is run on bars. What is added is placing four conventions side by side, resolving on finer bars, and doing the same thing on a series with zero directional information.

1. Notation and the question

When take-profit and stop-loss are checked on bars, a bar's high can reach the take-profit while that same bar's low reaches the stop-loss.

What gets reportedWhat does not
The win rate and the expected valueWhat share of cases touched both in one bar
The take-profit and stop-loss widthsWhich was taken first
The bar size usedWhat resolving on finer bars would give

Observation 1.1: The four values of a bar do not say the order inside it. Which of the high and the low came first is not determined by the open and the close either.

Observation 1.2: ★ So a convention is needed. Adverse first, favourable first, count as half, decide by the bar's direction — all are in use. And which one was used is usually not written.

Observation 1.3: The separator is which was taken first on an ambiguous bar. The entry, the barriers, the data, the period and the instrument are all held fixed, and only that treatment is varied.

Observation 1.4: ★ And two comparison partners are needed: one is the version resolved on finer bars (which convention is closest?), the other is a series with zero directional information by construction (is the expected value the convention makes a property of the market?).

Question: how much do the win rate and the expected value move with the treatment of a bar that touches both barriers?

2. State the quantity and the design first

Predictions (written before running)

① With take-profit = stop-loss and no costs, the expected value is 0 (optional stopping). It stays 0 with time-outs mixed in.

② The share of bars touching both grows as the barriers narrow.

③ ★ The favourable-first convention makes an expected value that does not exist, and the adverse-first one makes a loss that does not exist.

④ ★ A synthetic random walk with zero directional information makes just as much.

⑤ Resolving on finer bars cuts the ambiguity but not to zero.

Design (declared before running and not changed during it)

ItemDecision
EntryClose of a one-hour bar. Every bar (buys only; sells are the mirror)
BarriersTake-profit = stop-loss = R pips. R is 5, 10, 20, 40
Deadline24 bars (one day). Untouched is a time-out (marked to the close)
ConventionsAdverse first / favourable first / count as half / by the bar's direction
Re-resolutionFive-minute bars (an hour split into 12). The ambiguity there is counted too
CostsNot included. ★ That is what makes the theoretical value on the random walk exactly 0
BaselineSynthetic random walk down to within-bar movement
InstrumentsUSDJPY, EURUSD, GBPUSD, XAUUSD
Period2019–2024

Observation 2.1: ★ The four conventions give identical answers on every non-ambiguous case. They differ only on the ambiguous ones.

Observation 2.2: Costs are left out to make the theoretical value plain. With take-profit = stop-loss and symmetric increments, the expected value is 0 and the win rate among decided trades is 0.5.

Observation 2.3: But the measurement carries drift. Which way the instrument moved over the period sits in the level, so the theoretical 0 does not hold exactly on the measurement. ★ What this paper reads is therefore not the level but the difference between conventions.

The bar counts are 36,534, 36,554, 36,535 and 34,892 on one-hour bars and 438,283, 438,505, 438,199 and 418,478 on five-minute bars.

3. How often does one bar touch both barriers?

Calculation 3.1 Share of ambiguous cases, and time-outs

InstrumentRCountAmbiguous on 1hAmbiguous on 5mTime-out
USDJPY536,5100.22750.00960.0000
USDJPY1036,5100.07300.00240.0028
USDJPY2036,5100.01870.00230.0508
USDJPY4036,5100.00500.00170.2978
EURUSD536,5300.16590.00390.0000
EURUSD4036,5300.00190.00010.3425
GBPUSD536,5110.28520.01030.0000
GBPUSD4036,5110.00360.00040.1235
XAUUSD534,8680.61860.05770.0000
XAUUSD1034,8680.36000.01730.0000
XAUUSD2034,8680.13250.00350.0000
XAUUSD4034,8680.03320.00330.0064

Observation 3.2: Prediction ② held. The share ambiguous on one-hour bars is a median of 0.2564 at R=5 pips, 0.0800 at R=10, 0.0184 at R=20 and 0.0043 at R=40 — larger as the barriers narrow.

Observation 3.3: ★ For gold at R=5 pips it is 0.6186. In six tenths of the cases the order cannot be read from the bar. What decides those six tenths is not the data but the writer.

Observation 3.4: Resolving on five-minute bars cuts the ambiguity to 0.0100 at R=5 (0.0388 times) and 0.0011 at R=40 (0.2460 times).

Observation 3.5: ★ But not to zero. Five-minute bars have the same problem, so the same problem recurs one level down. Even down at the tick, both sides of the quote can move within the same millisecond.

Figure 1 Changing only the convention moves the expected value off the theoretical 0

Figure 1: horizontal is the barrier width R, vertical is the expected value. The five lines are the four conventions and the version resolved on five-minute bars; the dotted line is the theoretical 0.

4. How much do the win rate and the expected value move with the convention?

Calculation 4.1 Expected value by convention (pips)

InstrumentRAdverse firstFavourable firstCount as halfBy the barRange
USDJPY5−1.17911.0959−0.04160.01152.2750
USDJPY10−0.73580.7241−0.00590.01301.4599
USDJPY401.00641.40741.20691.23430.4010
EURUSD5−0.82290.83660.00680.00051.6595
EURUSD40−0.4712−0.3223−0.3968−0.41210.1489
GBPUSD5−1.45591.3964−0.0297−0.00042.8523
GBPUSD40−0.6341−0.3493−0.4917−0.46760.2848
XAUUSD5−3.10973.0767−0.01650.07466.1865
XAUUSD10−3.58443.61480.01520.14237.1992
XAUUSD40−0.21092.44141.11531.19562.6523

Calculation 4.2 Win rate among decided trades, by convention

InstrumentRAdverse firstFavourable firstCount as halfBy the barRange
USDJPY50.38210.60960.38210.50120.2275
USDJPY400.50720.51430.50720.51130.0071
EURUSD50.41770.58370.41770.50010.1659
EURUSD400.49190.49470.49190.49300.0028
GBPUSD50.35440.63960.35440.50000.2852
GBPUSD400.49000.49410.49000.49240.0041
XAUUSD50.18900.80770.18900.50750.6186
XAUUSD100.32080.68070.32080.50710.3600
XAUUSD200.43680.56920.43680.50630.1325
XAUUSD400.49730.53060.49730.51500.0334

Observation 4.3: ★ This is the core. The expected value moves with the convention by a median of 1.5597 pips and a maximum of 7.1992 pips. The win rate moves by a median of 0.0565 and a maximum of 0.6186.

Observation 4.4: For gold at R=5 pips the win rate runs from 0.1890 to 0.8077. ★ On the same data, the same entry and the same barriers, it becomes either "a method that wins two times in ten" or "a method that wins eight times in ten".

Observation 4.5: Prediction ③ held. The favourable-first convention gives a median expected value of +0.8394 pips and the adverse-first one −0.6850 pips. The convention is making an expected value and a loss that do not exist.

Observation 4.6: ★ Prediction ① was loosely worded. The measurement carries drift, so the theoretical 0 does not hold exactly. For USDJPY at R=40 all four conventions are positive (1.0064 to 1.4074), which is the yen's weakness over the period and not an effect of the convention. ★ So what must be read is the range, not the level.

Observation 4.7: The wider the barriers, the smaller the range. USDJPY gives 2.2750 at R=5 and 0.4010 at R=40. That is because fewer cases are ambiguous, not because the convention becomes right.

5. Which convention is closest when resolved on five-minute bars?

Calculation 5.1 The five-minute answer, and agreement with each convention

InstrumentR5m EV5m win rateAgree adverseAgree favourableAgree halfAgree by bar
USDJPY5−0.27640.47240.62380.61200.50410.6142
USDJPY20−0.00440.49890.91040.90790.89980.9062
EURUSD50.00880.50090.65570.65720.57350.6517
EURUSD40−0.38790.49320.97810.97850.97730.9774
GBPUSD5−0.09290.49070.59150.58780.44700.5856
GBPUSD40−0.51470.49130.97340.97270.97140.9718
XAUUSD5−0.41640.45840.54590.48820.20780.5204
XAUUSD400.37280.50460.86150.85690.84260.8545

Observation 5.2: Resolving on five-minute bars moves toward the theoretical values. The expected value is a median of −0.1480 pips and the win rate 0.4940. Much closer to 0 than the one-hour favourable-first (+0.8394) or adverse-first (−0.6850).

Observation 5.3: ★ But the "right" convention cannot be chosen. Agreement with the five-minute answer is 0.8002 adverse-first, 0.7991 favourable-first, 0.7714 count-as-half and 0.7956 by the bar — all about the same.

Observation 5.4: ★ The reason is simple. On an ambiguous bar, either choice is right about half the time. So every convention misses about half the ambiguous cases. Choosing a convention does not raise the hit rate.

Observation 5.5: That count-as-half agrees least (0.7714) is not a verdict on the convention. It sets ambiguous cases to 0, so they must count as disagreements under a sign comparison.

Observation 5.6: ★ Five-minute bars must not be treated as the truth. They retain 0.0011 to 0.0100 ambiguity of their own, resolved adverse-first here. Resolve on finer bars and the five-minute answer moves too.

Figure 2 The ambiguity grows as the barrier narrows and does not vanish on finer bars

Figure 2: horizontal is the barrier width R, vertical is the share touching both in one bar (log–log). Solid lines are one-hour bars, dashed lines five-minute bars.

6. Baseline — do the same thing on a series with zero directional information

Calculation 6.1 The same thing on a synthetic random walk (R = 5 pips)

InstrumentAmbiguousAdverse-first EVFavourable-first EVRangeFavourable win rate
USDJPYmeasured0.2275−1.17911.09592.27500.6096
USDJPYrandom0.3005−1.51101.49423.00520.6494
EURUSDmeasured0.1659−0.82290.83661.65950.5837
EURUSDrandom0.1400−0.69750.70221.39970.5702
GBPUSDmeasured0.2852−1.45591.39642.85230.6396
GBPUSDrandom0.2953−1.48231.47112.95340.6471
XAUUSDmeasured0.6186−3.10973.07676.18650.8077
XAUUSDrandom0.5684−2.84692.83705.68390.7837

Observation 6.2: ★ Prediction ④ held. On the synthetic random walk the ambiguous share is a median of 0.0247, the favourable-first expected value +0.3708 pips, the adverse-first one −0.5449 pips, and the favourable-first win rate 0.5128. The theoretical values are 0 and 0.5.

Observation 6.3: ★ Here the theoretical 0 holds exactly. The synthetic series is built from independent normal increments with no drift, so with take-profit = stop-loss and no costs the expected value is exactly 0. The convention still makes one.

Observation 6.4: ★ The measurement and the random walk are almost identical. For gold at R=5 the measurement gives −3.1097 / +3.0767 against −2.8469 / +2.8370, with ranges of 6.1865 against 5.6839. For GBPUSD it is 2.8523 against 2.9534.

Observation 6.5: ★ So the expected value the convention makes is not the market's. It is a product of having checked on bars. It comes out just as large on a series that is right about nothing.

Observation 6.6: So when "a method with an 80% win rate" is written, ask first for the ambiguous share and the convention. ★ For gold at R=5 pips, the convention alone gives either 0.1890 or 0.8077.

7. Limitations

  1. ★ Prediction ① was loosely worded. The measurement carries drift, so the theoretical 0 does not hold exactly; it holds exactly on the synthetic random walk. This paper says so and reads the range rather than the level.
  2. No costs are included. The figures here are therefore not trading performance. With costs the theoretical expected value becomes minus the spread, and the effect of the convention sits on top of that.
  3. ★ Five-minute bars are not treated as the truth. They retain 0.0011 to 0.0100 ambiguity, resolved adverse-first. Resolving on finer bars moves the five-minute answer too.
  4. The overlap is not removed. Entries are taken on every bar, so the observations overlap. No t value is reported and significance is not discussed.
  5. The barriers are fixed symmetric. With take-profit ≠ stop-loss the effect of the treatment becomes asymmetric, which is not measured.
  6. The deadline is fixed at 24 bars. Time-outs run from 0.1235 to 0.3425 at R=40, and their profit and loss is marked to the close.
  7. Only buys are measured. Sells are the mirror, but the asymmetry of the convention (adverse first is always the unfavourable side) carries over as it is.
  8. Four instruments over six years. Nothing is said about other markets or other periods.

Conclusion

A bar that touches both the take-profit and the stop-loss is more common the narrower the barriers: a median of 0.2564 at R=5 pips on one-hour bars, and 0.6186 for gold. For those six tenths, which came first is not written in the data.

Holding the entry, the barriers and the data fixed and changing only that treatment moves the expected value by a median of 1.5597 pips and a maximum of 7.1992 pips. The win rate among decided trades moves from 0.1890 to 0.8077 for gold at R=5. The same check becomes either "a method that wins two times in ten" or "a method that wins eight times in ten".

The convention is what makes the win rate and the expected value.

Resolving on five-minute bars moves toward the theoretical values (expected value −0.1480, win rate 0.4940). But the ambiguity does not vanish (0.0011 to 0.0100), and ★ every convention agrees with the five-minute answer about equally (0.8002, 0.7991, 0.7714, 0.7956). On an ambiguous bar either choice is right about half the time; the right convention cannot be chosen.

And on a synthetic random walk with zero directional information, the favourable-first convention still makes +0.3708 pips and the adverse-first one −0.5449 pips. For gold at R=5 the measurement gives −3.1097 / +3.0767 against the random walk's −2.8469 / +2.8370 — essentially the same. ★ The expected value the convention makes is not the market's; it is a product of having checked on bars.

What a report of a bar-based take-profit and stop-loss check therefore needs is the ambiguous share and the convention used. ★ A win rate without them cannot be read.

Data and reproduction

DataFX is Dukascopy-derived tick data (from 2019 onward, confirmed identical down to the millisecond, bid and ask). Gold is Dukascopy
Period2019–2024 (six years)
InstrumentsUSDJPY, EURUSD, GBPUSD, XAUUSD
BarsOne-hour and five-minute bars, mid prices, completed bars only. No bar is made where there are no ticks
EntryClose of a one-hour bar, on every bar (buys only)
BarriersTake-profit = stop-loss = 5, 10, 20, 40 pips. Deadline 24 bars
ConventionsAdverse first / favourable first / count as half / by the bar's direction, plus the version resolved on five-minute bars
CostsNot included, to make the theoretical value plain
Verification検算/F025.py (--zu also writes the figures). Every figure in the text comes from 検算/F025_output.txt
Figures図/F025_zu1, 図/F025_zu2 (png, svg, English versions)
Random seedsFixed. Re-running gives the same values
Foundation check_ツール/audit_bars.py (bar look-ahead, daylight saving, day boundaries). The record is _土台の検査.txt

References

  • Yamagishi, Y. (2026). Placing the Take Profit and Stop Loss Forty-Nine Ways Does Not Move the Expectation [F012]. Zenodo. 10.5281/zenodo.22891608

Reference

Yamagishi, Y. (2026). How You Treat a Bar That Touches Both Barriers Is What Makes the Win Rate and the Expected Value [F025]. Zenodo.
DOI: 10.5281/zenodo.22892549
YOI: https://www.yamagishiyuuki.com/yoi/F025
ORCID: 0009-0006-8587-3450

PDF (English) · PDF (Japanese) · Date proof of the English PDF (OpenTimestamps .ots) · SHA256SUMS

The record page for this paper (in Japanese, with the PDFs in each language and the date proof): YOI F025. This paper is a preprint and has not been peer reviewed.