Perfect order settings: 157 of 200 survived on M15
We tested 2,400 perfect-order runs on USD/JPY across three timeframes. Of 200 settings, 157 stayed profitable in both years on M15, against 10 on H4.
Perfect order uses three moving averages with different lookback lengths. A bullish order has the short average above the middle average and the middle above the long average. A bearish order reverses the stack. Because every line is a moving average, the state completes after price has already moved.
Across 40 period sets and five moving-average types, 157 of 200 settings were profitable in both 2024 and 2025 on M15, against 87 on H1 and 10 on H4. The four-hour chart went from 184 profitable settings in 2024 to 15 in 2025. Longer bars did not make the rule more stable.
What perfect order measures
There is no separate perfect-order formula. The bullish state is:
short moving average > middle moving average > long moving average
Reverse both inequalities for the bearish state. If either pair falls out of order, the state has ended.
The default 10/25/75 SMA stack was present on 62.84% to 63.55% of M15 bars in 2024 and 2025. The hourly share was 63.12% to 63.46%. A condition present for most of the chart is not a selective entry filter, so the test enters only on the first close that completes the stack and exits on the first close that breaks it.
Perfect order settings and signals
The three lines are drawn over the candles in the main chart. Perfect order has no oscillator pane or horizontal levels. In a bullish stack, the short, middle and long lines run from top to bottom. A bearish stack reverses them.
Formiq exposes four settings:
| Setting | Default | What it changes |
|---|---|---|
| Short | 10 | The fastest moving average |
| Middle | 25 | The moving average between the fast and slow lines |
| Long | 75 | The slowest moving average and broadest trend measure |
| Type | SMA | The calculation: SMA, EMA, WMA, SMMA or HMA |
The backtest rule matches the chart reading directly.
| State | Action |
|---|---|
| Short > middle > long first completes | Buy |
| Short < middle < long first completes | Sell |
| Either relationship breaks against the open position | Exit |
Shorter periods complete and break more often, raising trade count. Changing the moving-average type changes the stack even when the three periods stay fixed. The periods also need to remain in ascending order; otherwise the names short, middle and long no longer match their calculation.
How this was measured
| Item | Test condition |
|---|---|
| Pair | USD/JPY |
| Timeframes | M15, H1 and H4 |
| Periods | Short 5, 10, 20, 25; middle 20, 25, 50, 75; long 50, 75, 100, 200; filtered to 40 ascending triples |
| Moving averages | SMA, EMA, WMA, SMMA and HMA |
| Windows | 2024, 2025, first half of 2025, second half of 2025 |
| Entry | Close of the first bar with all three averages ordered |
| Exit | Close of the first bar that breaks the position's order |
| Cost | 0.3-pip spread, no slippage |
| Size | 0.1 lot |
Each window contains 200 settings. Three timeframes and four windows produce 2,400 backtests. Net pips were recalculated from the actual fills.
M15 kept 157 settings in both years; H4 kept 10
| Timeframe | Profitable in 2024 | Profitable in 2025 | Profitable in both |
|---|---|---|---|
| M15 | 182/200 | 165/200 | 157/200 |
| H1 | 193/200 | 91/200 | 87/200 |
| H4 | 184/200 | 15/200 | 10/200 |
M15 retained the most settings, with a median 2025 result of +646.8 pips. The hourly median fell from +1,407.2 pips in 2024 to -36.4 in 2025. H4 reversed from +1,588.0 to -812.0 pips.
Lower trade count did not protect the slower chart from a change in year. The median H4 setting made 29 to 48 trades per year, too few observations to smooth out that reversal.
EMA led on M15, while HMA led on H1
The table counts period sets that were profitable in both years. Each moving-average type has 40 sets.
| Moving average | M15 | H1 | H4 |
|---|---|---|---|
| SMA | 37/40 | 12/40 | 0/40 |
| EMA | 40/40 | 13/40 | 0/40 |
| WMA | 34/40 | 26/40 | 2/40 |
| SMMA | 32/40 | 0/40 | 5/40 |
| HMA | 14/40 | 36/40 | 3/40 |
EMA kept all 40 M15 settings, while HMA kept 36 of 40 on H1. Neither result transfers cleanly to H4, where every type kept five settings or fewer.
The period results have the same limitation. A long period of 100 retained 53 of 65 M15 settings and 28 of 65 H1 settings, but only 5 of 65 on H4. The number 100 did not carry the same result from one timeframe to another.
The default 10/25/75 SMA survived on M15 and H1
| Timeframe | Year | Trades | Win rate | Net pips |
|---|---|---|---|---|
| M15 | 2024 | 728 | 38.74% | +2,622.5 |
| M15 | 2025 | 749 | 35.51% | +646.8 |
| H1 | 2024 | 182 | 34.07% | +780.2 |
| H1 | 2025 | 186 | 40.86% | +770.0 |
| H4 | 2024 | 43 | 46.51% | +1,714.5 |
| H4 | 2025 | 49 | 32.65% | -904.3 |
The default was profitable in both years on M15 and H1. H4 reversed from +1,714.5 pips in 2024 to -904.3 in 2025. Splitting 2025 also exposes movement hidden by the annual totals: H1 made -146.7 pips in the first half and +892.6 in the second, while H4 moved from +389.1 to -1,286.4.
A one-year winner did not reliably beat the next year's median
Each table selects the best setting in one year and carries it unchanged into the other year.
Select in 2024, test in 2025
| Timeframe | Setting | 2024 | 2025 | 2025 median |
|---|---|---|---|---|
| M15 | 10/50/100 WMA | +2,866.4 | +880.9 | +646.8 |
| H1 | 10/20/200 WMA | +3,215.1 | +319.1 | -36.4 |
| H4 | 10/20/75 EMA | +2,861.7 | -1,043.4 | -812.0 |
Select in 2025, test in 2024
| Timeframe | Setting | 2025 | 2024 | 2024 median |
|---|---|---|---|---|
| M15 | 20/25/50 WMA | +2,267.6 | +1,229.3 | +1,272.2 |
| H1 | 5/25/200 HMA | +2,164.5 | +130.9 | +1,407.2 |
| H4 | 10/20/50 HMA | +1,053.1 | -242.0 | +1,588.0 |
The 2024 M15 winner stayed above the 2025 median. The reverse selection missed the 2024 median by 42.9 pips. The 2025 H1 winner made +130.9 pips in 2024, far below that year's +1,407.2 median. Both H4 winners lost money in the other year.
A 34.07% win rate still made 780.2 pips
The default H1 setting won 34.07% of its 182 trades in 2024 and made +780.2 pips. Its average winner was +91.88 pips and its average loss was -40.97. In 2025, a 40.86% win rate, +69.78 average winner and -41.21 average loss produced +770.0 pips.
Perfect order takes small losses when a stack breaks and depends on the less frequent runs that stay ordered. Optimizing win rate alone can cut those long trades. Trade count, average win, average loss and annual net need to be read together.
ADX, fixed exits and spread did not give one cross-timeframe answer
Adding ADX 25 to the default produced +1,826.7 and -117.6 pips on M15, +935.0 and -295.1 on H1, and +2,079.1 and -2,433.7 on H4 for 2024 and 2025 respectively. Reducing the number of entries did not improve both years.
A 50-pip stop with a 100-pip target raised M15 to +2,807.5 pips in 2024 and +781.2 in 2025. On H4, it reduced 2024 to +1,186.8 while lifting 2025 to +120.2. The same fixed exit did not have one effect across timeframes.
The difference between zero spread and 0.3 pip matched trade count multiplied by 0.3. In 2025, the default moved from +871.5 to +646.8 pips on M15, +825.7 to +770.0 on H1, and -889.7 to -904.3 on H4. The H4 loss remained without spread, so transaction cost was not its cause.
Related articles
Moving-average crosses test the relationship between two lines; perfect order requires all three lines to be stacked. SMA versus EMA compares a change in calculation with a change in period. GMMA tests whether a 12-line ribbon adds information when lines are removed. The Alligator also uses three ordered averages, but displaces them forward on the chart.
Notes
- The sample is USD/JPY in 2024 and 2025. Only 2025 was also split into halves.
- Signals and fills use the close, with a fixed 0.3-pip spread.
- Up to 200 earlier bars are loaded before each window so the long average exists when the test starts.
- Pullback entries during an existing order, moving-average slope and spacing between the lines were not tested.
Questions people ask
- What is perfect order in trading?
- Perfect order is the state in which a short, middle and long moving average are stacked by speed. The short average on top is bullish; the short average at the bottom is bearish.
- What periods should I use for perfect order?
- Formiq defaults to 10/25/75 SMA. It was profitable in both years on M15 and H1, but the four-hour result reversed from +1,714.5 pips in 2024 to -904.3 in 2025. Test the periods on the intended timeframe and on data not used to choose them.
- Is SMA or EMA better for perfect order?
- All 40 EMA settings were profitable in both years on M15. HMA led on H1 at 36 of 40. No moving-average type won across every timeframe.
- When does a perfect-order trade enter?
- This test entered at the first close with all three averages in order and exited when either relationship broke. Buying a pullback while the averages remain ordered is a different rule.
- Does perfect order work on the four-hour chart?
- It was unstable in this two-year USD/JPY sample. Of 200 settings, 184 were profitable in 2024, 15 in 2025 and only 10 in both years.
Formiq is a free browser-based FX terminal with replay practice and no-code backtesting. Open the chart or see what the free plan includes.