To turn a trading journal into trading rules, tag every trade by setup, compute each setup's mean result in R and its sample size, and check which conditions were really present at entry. Write the surviving conditions as measurable rules, freeze them, and test them on trades or data you did not use to find them. A journal suggests candidate rules; it does not prove them.
This guide belongs to From discretionary to automated trading. It assumes you already keep a trade journal with intent, execution, outcome and process fields. Automation can later execute a rule consistently. It cannot tell you whether the rule has an edge.

Journal to rules at a glance
Scroll horizontally to read every column.
| Step | What you produce |
|---|---|
| 1. Tag | One setup tag per trade, assigned from the entry notes, not the result |
| 2. Measure | Per tag: number of trades, mean R, spread of R and costs |
| 3. Inspect conditions | What was observable at entry for each trade in the tag |
| 4. Write rules | Measurable conditions with inputs, comparisons, lookbacks and timing |
| 5. Freeze and test | A versioned rule set tested on data not used to find it |
How should you tag journal trades by setup?
Give each trade exactly one setup tag, using the reason field you wrote at entry. Keep a tag called "other" for trades that fit no setup. Tagging from the chart after the exit invites hindsight: people who know an outcome tend to see it as more predictable than it was.[1]
- Use a short, stable list. Five tags that mean the same thing every week are more useful than twenty that drift.
- Keep deviations visible. A trade that broke the plan keeps its tag and also carries a deviation flag. Analyse followed and broken trades separately.
- Record the version. If the setup description changed mid-journal, the earlier and later trades are different samples.
How do you measure each setup's expectancy in R?
R-multiple per trade = net trade result / initial risk R
Setup expectancy in R = sum of that setup's R-multiples / number of trades in the setup
Normalise each trade by its own initial risk before averaging, so trades with different sizes are comparable. The house convention is the mean of each trade's result divided by that trade's initial risk. R-multiples follow Van Tharp's definition of R as the initial risk set by the initial stop.[2] See expectancy for the cash form.
Illustrative journal, not a recommendation or a real result. Forty trades carry two tags, with costs already deducted.
| Setup | Trades and results | Mean R |
|---|---|---|
| A: pullback | 24 trades: 10 at +1.8R, 14 at −1.0R; sum +4.0R | 4.0 / 24 ≈ +0.17R |
| B: breakout | 16 trades: 5 at +2.0R, 11 at −1.0R; sum −1.0R | −1.0 / 16 ≈ −0.06R |
Setup A looks better, but the sample is small. A confidence interval for a mean is the sample mean ± t × s / √N, where s is the sample standard deviation.[3] For setup A, s ≈ 1.41R, so s / √24 ≈ 0.29R. With t ≈ 2.07 for 23 degrees of freedom, the 95% interval runs from about −0.43R to +0.76R. The interval includes zero, so these 24 trades cannot separate setup A from no edge.
Setup B's interval, about −0.83R to +0.70R, also includes zero. Neither tag has earned a rule yet. The sample-size guide explains why small records mislead, and the metrics library covers the other measures to read alongside mean R.

Which conditions were really present at entry?
For each trade in a tag, list what was observable when you entered: session, higher-timeframe direction, distance to a moving average, spread, time since news. Use only information available at that moment. A swing point that needed later bars to confirm was not available at entry.
Then compare the trades that followed the setup description with those that did not. Look for conditions present in most trades of the tag, not for the filter that best separates this sample's winners from its losers. Searching many filters on the same trades and keeping the best one is overfitting. TradingView describes overfitting as tailoring a strategy to specific data, and warns that such a strategy often fails on unseen data.[4]
Count how many filters you tried. TradingView also describes selection bias: reviewing chosen instruments, timeframes or periods while ignoring others.[4] Record the ones you rejected alongside the one you kept.
How do you write the conditions as measurable rules?
Replace each phrase in the setup description with an input, a comparison, a lookback and an evaluation time. "Price pulls back to the average in an uptrend" becomes several conditions, each true or false on a closed bar. The phrase-to-condition worksheet takes you through that translation.
- Keep the discretionary part named. If a judgement cannot be defined, keep it as a logged manual veto rather than inventing a proxy.
- Write entries, exits and size together. The complete rule specification covers stops, targets, sizing units and exceptions.
- Freeze a version. Save the rule text, the data you used to find it and the list of filters you tried. Any later change is a new version with its own test.
Check the rule against the journal once. The coded rule should select roughly the trades you tagged. If it selects many trades you would never have taken, the definition does not yet match the setup.
How do you test a rule found in your journal?
The trades that suggested a rule cannot also confirm it. Test on data you did not use: later live or demo trades, or a held-out period of history. TradingView describes splitting data into in-sample and out-of-sample parts, optimising only on the first and testing the result on the second without further tuning.[4] See out-of-sample testing for the procedure.
An out-of-sample pass is still a limited result. TradingView cautions that future performance is not assured for any strategy, whatever data was used for optimisation and testing.[4] Treat a pass as permission for a further demo test, not as a forecast.
If you then automate the rule through TradingView alerts and PineConnector, verify the connection and one order on a demo account first. As of 25 September 2026, PineConnector's documented test is a connection check followed by one demo order that is matched to its processing record and broker trade.[5] The test-alert guide gives the steps. A successful demo order verifies that setup only; it does not establish that the strategy will be profitable.[6]
What goes wrong when mining a journal for rules?
- Tagging by outcome: winners become "A setups" and losers become "mistakes", which manufactures an edge.
- Too few trades per tag: a mean R from two dozen trades usually has an interval that spans zero.
- Ignoring costs: compute R after commission, spread and swap. A small positive mean can disappear after costs.
- Silent filter search: ten filters tried and one kept is a different result from one filter tested.
- Mixed versions: trades taken under an older setup description belong to a different sample.
- Treating adherence as edge: following a rule consistently shows discipline, not that the rule works.
Frequently asked questions
How do you turn a trading journal into rules?
To turn a trading journal into rules, tag each trade by setup from the entry notes, compute mean R and sample size per tag, and list the conditions that were observable at entry. Write those conditions as measurable true-or-false rules, freeze a version, then test it on data not used to find it.
How do you find your trading edge from a journal?
A journal can point to a candidate edge but cannot confirm one by itself. Compare mean R per setup with a confidence interval, include costs, and count the filters you tried. A setup whose interval stays above zero on new, untouched data is a candidate worth further testing, not a proven edge.
How do you analyse a trading journal?
Analyse a trading journal by grouping trades by setup tag and rule adherence, then computing trade count, mean R, the spread of R and costs for each group. Review rule breaches separately from rule-following trades. Treat small groups as questions, and check any pattern on trades not used to find it.
How many journal trades do you need before writing a rule?
There is no universal number of journal trades. The needed count depends on how variable the R-multiples are and how small the mean is. Compute a confidence interval for mean R: while it includes zero, the journal has not separated the setup from no edge, however many trades that took.
Reviewed 25 September 2026. Facts were checked against the linked sources on that date. Nothing in this article was tested on a trading account.
Related reading
- From discretionary to automated trading: the series guide
- How to keep a trading journal (fields and template)
- How to turn a trading setup into measurable conditions
- Overfitting and curve fitting in trading
- Trading performance metrics library
Sources
- Wikipedia – Hindsight bias, citing Fischhoff (1975), Hindsight ≠ foresight: The effect of outcome knowledge on judgment under uncertainty, Journal of Experimental Psychology: Human Perception and Performance 1(3), doi:10.1037/0096-1523.1.3.288, accessed 26 September 2026.
- Van Tharp Institute – A short lesson on R and R-multiples, accessed 25 September 2026.
- NIST/SEMATECH e-Handbook of Statistical Methods – Confidence limits for the mean, accessed 25 September 2026.
- TradingView – Strategies, accessed 25 September 2026.
- PineConnector – Test your setup, accessed 25 September 2026.
- PineConnector – Trials and demo testing, accessed 25 September 2026.
PineConnector executes the instructions you send it. It does not select trades, manage money, or hold funds. Trading carries risk, and past performance of any strategy does not indicate future results.