Turn a trading setup into measurable conditions by replacing each vague phrase with an observable input, a comparison, a lookback and a known evaluation time. Record the data feed, timeframe and timezone too. A useful condition gives the same true-or-false answer when you apply the same definition to the same data.
Start with the decisions identified in the strategy readiness inventory. Keep a decision manual if you cannot yet define or observe its inputs. Automation executes the rules you supply; it does not create a trading edge.

Part 3 of 8 in From discretionary to automated trading. Previous: Is your strategy ready to automate?. Next: Define entries, exits, size and exceptions.
What does a measurable condition need?
“Buy a strong pullback” hides several decisions: what counts as strong, where the pullback must reach and what ends the waiting period. Write a separate condition for each. Separate a filter, which permits an entry, from the event that asks for one.
- Input: name the price series or other observation, its provider and the instrument. For example, the close of EURUSD standard candles on a named TradingView feed.
- Comparison: write the relationship precisely, including equality. “Above” means greater than; “at or above” includes the boundary value.
- Lookback: count the bars and say whether the current bar is included. A three-bar low and a swing low confirmed later are different inputs.
- Time: record the timeframe, timezone and the moment you evaluate the condition. A bar's opening timestamp and its closing timestamp answer different questions.
- Meaning: decide whether true means “entry permitted”, “request an entry”, “request an exit” or “pause for review”. A true condition alone is not an order.
For this series, use standard time-based candles. TradingView warns that strategies on non-standard charts can use synthetic prices and produce unrealistic results.[1]

Use the six-field phrase-to-condition worksheet
Copy this block once for each phrase in your setup. Fill it before writing code. A blank field identifies a decision that still needs work.
-
Your phrase
Write the words you use while deciding: __________. -
What you look at
Name the input, data provider, symbol, chart type and timeframe: __________. Identify any information that comes from outside the chart. -
Measurable definition
Write the comparison, threshold, lookback and inclusive boundaries: __________. Mark the result as a filter, entry trigger, exit trigger or manual veto. -
Known when
State the evaluation moment, relevant bar timestamp, timezone and any confirmation delay: __________. Could the value change after you act? -
How to verify
Specify one example that should pass, one that should fail and one boundary case: __________. Record the input values and expected true-or-false result before seeing an implementation's answer. -
Code, accept or keep manual
Choose: code this definition; accept a clearly recorded difference from the original idea; or retain a logged manual decision. State the difference or manual action and its owner: __________.
A completed row might read:
- Phrase: “The hourly trend is up.”
- Input: EURUSD standard H1 bars from the chosen TradingView feed; EMA(50) and EMA(200).
- Definition: on the closed bar, EMA(50) is above EMA(200), and EMA(50) is higher than its value five bars earlier. Both comparisons must be true. Entry filter only.
- Known when: at each H1 close. Save that close time in Europe/London time alongside the chart's timestamp.
- Verify: both comparisons true should pass; either false should fail; equality in either comparison should fail. Save the compared values.
- Decision: code this illustrative definition, while recording that it measures these two EMA relationships rather than every visual meaning of “uptrend”.
Translate the London pullback example one phrase at a time
Illustrative example, not a recommendation. The trader says: “During the London morning I buy EURUSD pullbacks when the hourly trend is up, once price starts to bounce off the moving average. I avoid big news and take one trade at a time.” The following definitions make the condition part explicit.
- C1. “EURUSD on the hourly chart”: use the chosen TradingView EURUSD feed and standard H1 bars. Save the full feed identifier, not only the ticker. TradingView and the receiving MT5 broker can have different feeds, quotes, spreads and timestamps.[2]
- C2. “Once price confirms”: evaluate once at the close of each H1 bar. Do not use an unfinished bar's close as if it were final.
-
C3. “London morning”: the bar that just closed must have opened between 07:00 and 10:00 inclusive, in
Europe/Londontime. The corresponding H1 signal times are 08:00 through 11:00 London time. Use the named timezone so the definition follows UK daylight-saving changes.[3] - C4. “Trend is up”: EMA(50) is above EMA(200) on the closed bar, and EMA(50) is higher than it was five bars earlier.
- C5. “A pullback reaches the average”: at least one of the last three closed bars, including the current one, has a low at or below that same bar's EMA(50). Comparing all three lows with today's EMA would define a different condition.
- C6. “Price bounces”: the current bar closes above its EMA(50) and above the previous bar's high. Treat the close of this qualifying bar as the candidate entry event. Another bar can qualify later; this condition does not limit entries by itself.
-
C7. “One at a time”: require no open long for this strategy in the simulated state and no matching open long in each intended receiving broker account. Reconcile any earlier entry request whose outcome is unknown before allowing another. The example's
LDN-PBlabel helps identify intended ownership; it does not feed broker state back into Pine. - C8. “Avoid big news”: retain a manual veto for this illustration. Record the calendar consulted, events covered, blackout period and pause decision. “Big news” alone does not define an observable rule; this example supplies no automated calendar integration.
C7 is not solved by a chart check. Pine's strategy.position_size describes the broker emulator's simulated position. It cannot establish the actual MT5 exposure. The PineConnector converter also documents that it does not resynchronise simulated and broker positions.[1][4] If you only have the chart state, keep the broker check as a manual acceptance step or leave automation of this requirement unresolved.
The entry candidate therefore needs C1–C6, the reconciled position check and an explicit manual-veto decision. Stops, targets, planned size, the limit of one entry request per London calendar day and the afternoon close request belong in the complete rule specification in Part 4.
Is the condition an event or a state?
“The close is above the average” is a state: it can remain true for many bars. “The close crosses from at or below the average to above it” is an event defined using two observations. Changing one into the other changes the strategy.
For C6, a new H1 close is the evaluation event, but successive bars can still satisfy both comparisons. Define what happens on the second qualifying bar: request another entry, ignore it, or wait until a stated reset. An alert frequency limits evaluations or notifications; it does not prove that a broker position is absent.
Record a repeat case and a conflict case alongside the worksheet. For example: “The condition remains true at the next H1 close” and “long and short candidates occur together.” Assign an explicit action before implementation. Do not assume whichever message arrives first is the intended winner.
When was the information actually available?
A finished chart can display information where it became visually relevant, even if it became knowable later. A pivot drawn under an earlier bar may require several later bars to confirm it. Record the confirmation time, not only the time under the drawing.[5]
The series example uses a defined three-bar lookback for the pullback. Part 4 uses the lowest low of five closed bars for the stop reference. Neither depends on a pivot that needs future bars.
Waiting for the bar to close avoids some intrabar changes. It does not remove all repainting, future-information leakage or differences caused by revised historical data. Higher-timeframe data can also be unfinished when the chart bar closes.[5] Record when each input becomes final.
Check the clock separately. TradingView distinguishes the chart's display timezone from timezones used in Pine calculations. Changing the chart display does not rewrite the script's timezone rules.[3] For C3, verify the 07:00, 10:00 and 11:00 opening-time boundary cases and dates on both sides of a UK clock change.
What can this worksheet still get wrong?
A precise rule can be a poor trading rule. Adding definitions until a historical chart looks attractive also changes the question you are testing. Freeze the definitions before the cost and out-of-sample checks in Part 6.
A chart condition being true, an alert triggering and a broker position opening are separate events. Preserve the intervening evidence: webhook delivery, PineConnector processing, the EA request, broker acceptance and the fill. An accepted request is not itself proof of a fill or a resulting position.[6][7]
Changing the worksheet is also a version change. Update the implementation and its expected cases together. TradingView alerts keep the script and inputs saved when they were created; recreate the affected alerts after a change.[8]
What should you do with the finished conditions?
Take every completed worksheet row into Part 4: define the whole strategy and where each rule is enforced. Keep unresolved rows visible. A programmer needs the intended behaviour and acceptance cases, not permission to guess them.
When the implementation is ready, use Part 7's demo reconciliation procedure to compare the condition, alert and broker outcome for each signal.
Reviewed 23 September 2026 against primary documentation accessed on that date. No trading account was tested and no Pine Script or MQL5 code was compiled.
Related reading
- From discretionary to automated trading: the series guide
- Is your strategy ready to automate?
- Define entries, exits, sizing, sessions and exceptions
- From a TradingView backtest to a verified MT5 demo trade
Sources
- TradingView – Strategies, accessed 23 September 2026.
- PineConnector – Frequently asked questions: price differences, accessed 23 September 2026.
- TradingView – Time, accessed 23 September 2026.
- PineConnector – Pine Script converter: supported behaviour, accessed 23 September 2026.
- TradingView – Repainting, accessed 23 September 2026.
- PineConnector – Test your setup, accessed 23 September 2026.
- MetaQuotes – Basic principles: orders, deals and positions, accessed 23 September 2026.
- TradingView – Alerts, accessed 23 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.