Forex Trading Strategies: Regimes, Sessions and Costs
Forex trading strategies define when to buy or sell a currency pair, when to exit and how much exposure to take. Trend rules seek continuation; range rules seek a return toward a reference price. A usable test also specifies the quote provider, spread, account currency and trading hours. The rule sets below are illustrative experiments with no claimed performance record.
Draft the forex strategyKey Takeaways
- Choose a trend or range hypothesis before choosing indicator settings.
- Record the full provider-prefixed symbol. EURUSD from two feeds is not necessarily the same dataset.
- Translate pip distance into account-currency risk, then add costs before sizing.
- Keep later dates and separate currency pairs outside parameter selection; report their results separately.
Group currency trading strategies by the behavior they require
A currency trading strategy needs a measurable premise. Buying a breakout assumes continuation; buying after a decline assumes some recovery. These can lose in different conditions, so test them separately before considering a combined system. A filter identifies a condition in past data; it does not establish the next market regime.
| Approach | What the rule tests | Where it can fail |
|---|---|---|
| Trend continuation | A break of a prior price boundary while a moving average is rising | Repeated breaks reverse inside a range; gaps can exceed the planned stop |
| Range reversion | Price returns inside a deviation band while the recent average is relatively flat | A new directional move persists; the target average shifts or is never reached |
Illustrative trend rules for a forex swing trading strategy
Use one provider-prefixed pair on standard four-hour candles. Evaluate completed bars only. This long-only experiment uses one timeframe so the test does not depend on a still-forming daily bar. It can hold overnight and across weekends; record financing and gap assumptions. The numerical settings are starting hypotheses, not recommended or optimized values.
- Eligibility: the completed close is above its 50-bar EMA, and that EMA is above its value five bars earlier.
- Signal: while flat, the completed close exceeds the highest high of the preceding 20 bars, excluding the signal bar.
- Entry: submit one market buy after the signal. Default TradingView strategy timing normally fills at the next bar open, not the signal close.
- Risk: freeze ATR(14) from the signal bar. Place a protective stop two ATR below the actual entry fill and do not widen it. Take only one position at a time.
- Other exits: submit a market exit on a completed close below the preceding 10-bar low, or after 30 completed bars following the entry fill. Keep the protective stop active meanwhile.
- No automatic reversal: short positions require a separately specified and evaluated experiment. Skip entries until every lookback is available.
A separate intraday range experiment
Use standard one-hour candles and a 20-bar SMA with bands two population standard deviations above and below it. This hypothetical long-only FX trading strategy tests recovery after a lower-band excursion. A falling market can remain outside the band, so both a regime filter and an exit deadline belong in the specification.
- Eligibility: the absolute change in the 50-bar SMA over five bars is at most half the current ATR(14). Require complete lookbacks and a positive ATR.
- Signal: the previous close was below its own lower band; the latest completed close is above its own lower band but below its SMA. Enter only while flat.
- Entry window: accept signal-bar closing timestamps from 08:00 inclusive to 15:00 exclusive, Monday through Friday, in Europe/London time. Submit a market buy for the next available tick.
- Freeze the signal SMA and ATR. Set a limit target at the frozen SMA and a stop one ATR below the actual entry fill. If the fill is already at or above the target, submit a market exit and retain that trade and its costs in the results.
- Exit after four completed bars following entry or at the first bar close at or after 16:00 London time, whichever comes first, if the bracket has not filled. A missing bar or market closure can delay the exit.
- Run this test independently of the trend rules. Do not choose between them retrospectively using the result of the next price move.
Convert pips and position units into cash risk
The first currency in a pair is the base currency; the second is the quote currency. For a position measured in base-currency units, price movement multiplied by units gives profit or loss in quote currency before costs. Convert that amount into the account currency. Verify the broker contract multiplier and minimum order increment rather than treating a Pine strategy quantity as a universal broker lot.
| Assumption | Calculation | Interpretation |
|---|---|---|
| EURUSD, USD account, 10,000 EUR units; 20-pip stop | 20 × 0.0001 × 10,000 = $20 | A further 1-pip round-trip spread allowance adds $1; estimated total is $21 before other costs |
| USDJPY, USD account, 10,000 USD units; 20-pip stop | 20 × 0.01 × 10,000 = ¥2,000; at an assumed ¥150 per USD, about $13.33 | Conversion changes with the exchange rate; the same 20 pips do not mean the same cash risk as EURUSD |
| EURUSD, $100 budget, 20-pip stop plus 1-pip spread allowance | 100 / (0.0020 + 0.0001) ≈ 47,619 base units | Round down to the permitted increment and reduce further for other costs; gaps can still exceed the budget |
- A conventional pip is 0.0001 for EURUSD and 0.01 for USDJPY. A fractional-pip quote or chart tick is a different increment.
- TradingView strategy account-currency conversion uses a prior daily conversion rate when currencies differ. Record this approximation when comparing simulated and broker results.
- Check margin and leverage separately from stop risk. Available margin does not make a position appropriate for a chosen loss budget.
Make spread, sessions and the quote source explicit
A forex chart is not a consolidated execution record. TradingView distinguishes composite forex data from individual broker feeds, and providers can have different trading hours and volume availability. Save the complete ticker, such as its provider prefix plus pair, with each result. If execution will use another provider, compare representative signal and fill timestamps on both feeds.
- Spread: state whether the chart prices represent bid, ask or midpoint, then document how the model charges the spread. For a flat midpoint and constant spread, an immediate buy at ask and sell at bid loses one full spread before fees. Avoid charging that same spread twice.
- Other costs: separate commission, slippage and any overnight financing. TradingView exposes commission and tick-based slippage settings; these do not by themselves reconstruct a historical bid/ask series or broker financing schedule.
- Cost stress: rerun with a declared wider spread and worse slippage. A fixed allowance is an approximation, especially around news, daily rollover and gaps.
- Sessions: use a named time zone and explicit weekdays. Pine session checks default to the exchange time zone unless overridden; changing the chart display time zone does not change the script logic.
- Timing: state whether the window limits signal generation, fills or holding time. Verify daylight-saving transitions and holidays on the chosen feed. A closing signal cannot guarantee a fill before the session ends.
- Fill review: inspect bars that touch both stop and target, and compare available intrabar data. Use standard candles for the baseline and retain adverse gap fills.
Validate each currency pair outside the selection sample
Testing forex strategies on several pairs is useful only if the extra pairs did not help choose the rules being evaluated. Save the specification, candidate settings and rejection criteria before running the comparison. Keep a chronological holdout for each pair and distinguish a transfer test from a fresh pair-specific optimization.
- Example research design: choose rules on an earlier EURUSD period, freeze them, and evaluate a later EURUSD period plus separately held-out GBPUSD and USDJPY periods. These are proposed test splits, not completed results.
- Adjust pip conversion, contract units, provider, costs and session calendars for each pair. Preserve the strategy logic if the question is whether it transfers.
- Report each pair separately: dates, trades, net result after costs, drawdown, exposure and losing sequences. Do not let an aggregate profit hide a failing pair.
- If a holdout prompts a rule change, it has become development data. Reserve new untouched data before claiming another out-of-sample test.
- Review concurrent exposure. Long EURUSD and long GBPUSD both include short-USD exposure; separate trades are not necessarily independent risks.
Build the specification in Pineify, then review the test
Pine Script AI Coding Agent can draft a strategy from the entry, exit, session and sizing rules. Supply the cost assumptions and required inputs with the prompt. Review the generated code and its TradingView trade list before using Strategy Optimizer to compare a bounded set of exposed parameters. Optimization compares the supplied historical experiment; it does not establish future profitability or execute broker trades.
- For the trend example, expose the breakout length and ATR multiplier while holding the provider, costs and dates fixed.
- For the range example, expose the entry window and band settings, and inspect the target-crossed-at-entry case explicitly.
- Keep the holdout outside the parameter search and inspect nearby settings rather than selecting only the highest historical result.
Pineify next step
Draft a forex strategy with explicit assumptions
Give AI Coding Agent one pair, a session, complete trade rules and a cost model. Review the generated Pine Script before comparing a bounded parameter range with Strategy Optimizer.
Sources and verification
Last verified:
Educational information, not investment advice or live trading signals. All strategy settings, test splits and sizing examples are hypothetical. Leveraged forex trading can cause substantial losses; stops do not guarantee execution prices. Historical simulations and parameter optimization do not establish future returns.