MACD Indicator: Formula, Settings, and What Tests Reveal

MACD and signal lines with their histogram difference

Key takeaways

  • MACD subtracts a slow exponential moving average from a fast one; its signal smooths MACD, and the histogram is their difference.
  • A negative histogram means MACD is below its signal; MACD itself can still be positive.
  • A slower signal can enlarge the gap enough to make a rule that requires a minimum gap busier. Historical activity differences do not establish better returns.

What is MACD?

The moving average convergence divergence indicator, usually called MACD, compares a fast moving average with a slower one. It shows their distance as a line that moves above and below zero. A second line smooths that distance; the histogram shows the gap between the two lines.

The familiar settings are 12, 26, 9. They mean bars on your chart: 12 two-hour candles on a two-hour chart, or 12 daily candles on a daily chart. Changing the candle size changes the elapsed time the indicator remembers. These familiar defaults are not a universal optimum.

MACD is an unbounded indicator. Its values are in the same units as the price, so a reading of 100 has a different meaning on a $100 asset and a $50,000 asset. Fidelity’s MACD guide introduces it as a trend-oriented momentum oscillator.

MACD formula and the 12/26/9 settings

The usual calculation uses exponential moving averages, or EMAs, which give more weight to recent observations:

  • MACD line = EMA 12 of the closing price − EMA 26 of the closing price
  • Signal line = EMA 9 of the MACD line
  • Histogram = MACD line − signal line

The signal line averages MACD, not the price. If the fast price EMA is 102 and the slow one is 100, MACD is 2. If its signal is 1.5, the histogram is 0.5. This is the three-part calculation described in TradingView’s indicator reference.

How to read MACD signals

Two crossings often share a name while comparing different things:

ObservationWhat the calculation tells you
MACD crosses above zeroThe fast price EMA has moved above the slow price EMA.
MACD crosses above its signalMACD has moved above its own smoothed value; the histogram becomes positive.
A positive histogram shrinksMACD remains above its signal, but their gap is narrowing.
Constructed teaching example Two zero crossings, two different comparisons

Two different zero crossings: the histogram compares MACD with signal, while MACD compares the fast EMA with the slow EMA.

The value table below is available without JavaScript.

Chart data
Data and calculation details
Source: Constructed teaching prices. Invented data illustrating the EMA 12/EMA 26 difference and its 9-bar signal EMA. No market results or executions. Constructed values illustrate the calculation; they are not market history or backtest results.
Accessible value table (180 observations)
ObservationInvented price · PriceMACD and its signal · MACD 12/26MACD and its signal · Signal 9Their difference · Histogram = MACD − signal
Bar 61105.3150.5230.655-0.132
Bar 62105.6190.5200.628-0.108
Bar 63105.9140.5350.609-0.075
Bar 64106.1430.5590.599-0.040
Bar 65106.3010.5840.596-0.012
Bar 66106.4300.6070.5980.009
Bar 67106.9450.6590.6110.049
Bar 68107.5420.7410.6370.104
Bar 69108.2180.8500.6790.170
Bar 70108.9190.9810.7400.242
Bar 71109.5581.1240.8170.308
Bar 72110.0611.2640.9060.358
Bar 73110.3971.3851.0020.383
Bar 74110.6011.4811.0980.383
Bar 75110.7531.5511.1880.363
Bar 76110.9411.6041.2710.332
Bar 77111.2251.6491.3470.302
Bar 78111.6111.6971.4170.280
Bar 79112.0521.7501.4830.266
Bar 80112.4811.8061.5480.258
Bar 81112.8541.8591.6100.249
Bar 82113.1691.9041.6690.235
Bar 83113.4781.9431.7240.219
Bar 84113.8601.9811.7750.206
Bar 85114.3772.0301.8260.204
Bar 86115.0432.0981.8800.218
Bar 87115.8142.1891.9420.247
Bar 88116.6012.2992.0130.285
Bar 89117.3132.4152.0940.321
Bar 90117.8932.5242.1800.345
Bar 91118.3452.6182.2670.350
Bar 92118.7212.6912.3520.339
Bar 93119.0962.7482.4310.316
Bar 94119.5202.7942.5040.291
Bar 95119.9972.8372.5710.267
Bar 96120.4822.8772.6320.245
Bar 97120.9042.9102.6880.222
Bar 98121.2122.9262.7350.191
Bar 99121.4002.9212.7720.149
Bar 100121.5232.8932.7970.097
Bar 101121.6702.8502.8070.043
Bar 102121.9292.8052.807-0.002
Bar 103122.3452.7712.800-0.029
Bar 104122.9052.7572.791-0.034
Bar 105123.5422.7652.786-0.021
Bar 106124.1742.7912.7870.004
Bar 107124.3452.7932.7880.005
Bar 108124.4472.7712.785-0.014
Bar 109124.5232.7282.773-0.046
Bar 110124.6372.6722.753-0.081
Bar 111124.8362.6142.725-0.111
Bar 112125.1212.5612.692-0.131
Bar 113125.4362.5162.657-0.141
Bar 114125.6942.4732.620-0.148
Bar 115125.8182.4202.580-0.160
Bar 116125.7762.3482.534-0.186
Bar 117125.5982.2512.477-0.226
Bar 118125.3602.1302.408-0.278
Bar 119125.1521.9942.325-0.331
Bar 120125.0351.8562.231-0.375
Bar 121125.0151.7252.130-0.405
Bar 122125.0491.6052.025-0.420
Bar 123125.0691.4951.919-0.424
Bar 124125.0301.3881.813-0.425
Bar 125124.9311.2811.706-0.426
Bar 126124.8231.1741.600-0.426
Bar 127124.7861.0731.494-0.421
Bar 128124.8840.9901.394-0.404
Bar 129125.1350.9341.302-0.368
Bar 130125.4980.9081.223-0.315
Bar 131125.8840.9081.160-0.252
Bar 132126.2030.9231.113-0.189
Bar 133126.3950.9401.078-0.138
Bar 134126.4620.9481.052-0.104
Bar 135126.4540.9431.030-0.088
Bar 136126.4440.9271.010-0.083
Bar 137126.4820.9070.989-0.082
Bar 138126.5730.8880.969-0.081
Bar 139126.6710.8710.949-0.078
Bar 140126.7070.8510.930-0.079
Bar 141126.6240.8190.908-0.089
Bar 142126.4170.7680.880-0.112
Bar 143126.1360.6970.843-0.146
Bar 144125.8730.6120.797-0.185
Bar 145125.7150.5260.743-0.217
Bar 146125.7110.4520.685-0.232
Bar 147125.8510.4010.628-0.227
Bar 148126.0700.3730.577-0.204
Bar 149126.2890.3650.534-0.170
Bar 150126.4500.3670.501-0.134
Bar 151126.5450.3720.475-0.103
Bar 152126.6160.3770.456-0.078
Bar 153126.7280.3860.442-0.056
Bar 154126.9290.4050.434-0.030
Bar 155127.2200.4380.4350.003
Bar 156127.5470.4850.4450.040
Bar 157127.5640.5170.4590.058
Bar 158127.4490.5280.4730.055
Bar 159127.1690.5080.4800.028
Bar 160126.7490.4530.475-0.022
Bar 161126.2630.3660.453-0.087
Bar 162125.8020.2570.414-0.157
Bar 163125.4250.1380.359-0.220
Bar 164125.1420.0210.291-0.270
Bar 165124.909-0.0890.215-0.304
Bar 166124.661-0.1950.133-0.328
Bar 167124.352-0.3000.047-0.346
Bar 168123.979-0.408-0.044-0.364
Bar 169123.594-0.519-0.139-0.380
Bar 170123.277-0.626-0.237-0.389
Bar 171123.095-0.716-0.333-0.384
Bar 172123.071-0.781-0.422-0.359
Bar 173123.163-0.816-0.501-0.315
Bar 174123.287-0.824-0.566-0.258
Bar 175123.351-0.816-0.616-0.200
Bar 176123.294-0.804-0.653-0.151
Bar 177123.115-0.801-0.683-0.118
Bar 178122.862-0.809-0.708-0.101
Bar 179122.605-0.826-0.732-0.095
Bar 180122.398-0.847-0.755-0.093
Bar 181122.243-0.866-0.777-0.089
Bar 182122.096-0.883-0.798-0.085
Bar 183121.886-0.903-0.819-0.084
Bar 184121.554-0.935-0.842-0.092
Bar 185121.093-0.986-0.871-0.115
Bar 186120.552-1.058-0.908-0.149
Bar 187120.019-1.145-0.956-0.189
Bar 188119.586-1.234-1.011-0.223
Bar 189119.303-1.313-1.072-0.241
Bar 190119.163-1.371-1.131-0.239
Bar 191119.104-1.405-1.186-0.219
Bar 192119.049-1.420-1.233-0.187
Bar 193118.940-1.425-1.271-0.153
Bar 194118.766-1.426-1.302-0.124
Bar 195118.571-1.426-1.327-0.099
Bar 196118.418-1.422-1.346-0.076
Bar 197118.359-1.408-1.358-0.049
Bar 198118.395-1.377-1.362-0.015
Bar 199118.473-1.332-1.3560.024
Bar 200118.507-1.278-1.3400.062
Bar 201118.415-1.229-1.3180.089
Bar 202118.686-1.155-1.2850.131
Bar 203118.815-1.073-1.2430.170
Bar 204118.873-0.992-1.1930.201
Bar 205118.949-0.912-1.1370.225
Bar 206119.104-0.826-1.0740.249
Bar 207119.349-0.729-1.0050.276
Bar 208119.641-0.622-0.9290.306
Bar 209119.917-0.509-0.8450.336
Bar 210120.128-0.398-0.7550.357
Bar 211120.273-0.295-0.6630.368
Bar 212120.401-0.200-0.5710.370
Bar 213120.594-0.109-0.4780.370
Bar 214120.922-0.010-0.3850.375
Bar 215121.4100.107-0.2860.393
Bar 216122.0200.246-0.1800.426
Bar 217122.6700.404-0.0630.467
Bar 218123.2670.5710.0640.507
Bar 219123.7500.7330.1980.536
Bar 220124.1130.8810.3340.547
Bar 221124.4041.0110.4700.541
Bar 222124.6921.1230.6000.523
Bar 223125.0281.2250.7250.500
Bar 224125.4181.3230.8450.478
Bar 225125.8161.4150.9590.457
Bar 226126.1511.4991.0670.432
Bar 227126.3631.5641.1660.398
Bar 228126.4401.6031.2540.350
Bar 229126.4291.6151.3260.289
Bar 230126.4191.6051.3820.223
Bar 231126.5021.5851.4230.163
Bar 232126.7301.5701.4520.118
Bar 233127.1001.5701.4760.094
Bar 234127.5551.5881.4980.090
Bar 235128.0151.6211.5230.098
Bar 236128.4241.6611.5500.111
Bar 237128.7711.7011.5800.120
Bar 238129.0971.7391.6120.127
Bar 239129.4691.7781.6450.133
Bar 240129.9371.8271.6820.145

The prices in this first chart are invented to keep the arithmetic visible. Select Positive, but shrinking, then Signal-line crossing. The histogram can turn negative while both lines remain above zero. It is their difference, rather than a third independent measure of price.

Traders also look for divergence. A lower price low alongside a higher MACD low is called bullish divergence; a higher price high alongside a lower MACD high is bearish divergence. Neither guarantees a reversal. Applying that idea requires choosing which highs or lows to compare. Our experiments below use explicit level rules, making their behavior easier to compare across many settings.

Does a smoother MACD signal always mean fewer trades?

A longer signal period draws a slower line. It is natural to expect that to quiet a trading rule. A small decision hurdle changes the question: the gap must now grow large enough before the rule acts.

We tested that intuition in 107,520 related historical evaluations. The rule enters when the histogram is above a positive hurdle and exits when it is below the corresponding negative hurdle. Here, histogram basis points mean 10,000 × (MACD − signal) / current close. A 20-basis-point hurdle describes that gap, not a price return.

Keep the fast/slow EMAs at 12/26 on a two-hour chart. In one tested example, increasing the signal from three bars to five reduced unbuffered executions from 1,391 to 1,125. Add a 20-basis-point hurdle to the same rule, and executions instead rose from 127 to 295. The prices and fast/slow averages are unchanged; only the signal smoothing and hurdle differ. Executions count buys and sells, not completed round trips.

Recorded backtest metrics Signal smoothing and the decision hurdle interact

Adding signal smoothing changes activity differently when the histogram must clear a wider hurdle. Activity is not profitability.

The value table below is available without JavaScript.

Chart data
Data and calculation details
This view selects a representative example; the chart-data download retains the full comparison. Source: TrainBard completed backtests · Binance Spot BTCUSDT 2h. Recorded execution counts from original checksum-verified exports. Fast 12 / slow 26, MACD may be below zero at entry, 10,000 USDT cash, 99% equity with a cash reserve long/cash, 0.1% combined cost, 500-bar startup. Each line joins tested signal lengths. Windows have different durations; compare the shape within each panel.
Accessible value table (10 observations)
ObservationRecorded executions · 0 bps hurdleRecorded executions · 5 bps hurdleRecorded executions · 20 bps hurdle
Signal 31,391.000653.000127.000
Signal 51,125.000701.000295.000
Signal 7987.000691.000371.000
Signal 9927.000667.000401.000
Signal 11859.000643.000413.000
Signal 13807.000615.000406.000
Signal 15749.000597.000410.000
Signal 17721.000571.000410.000
Signal 19691.000567.000404.000
Signal 21663.000555.000396.000

With no extra requirement for MACD itself to be above zero, the wider grid repeated this interaction: signal 3→5 reduced activity in 896/896 observed zero-hurdle pairs and increased it in 873/873 observed 20-basis-point pairs. At five basis points, results were mixed. These comparisons require recorded trades on both sides and share historical prices; they describe the tested rules, not independent statistical trials. Exact datasets and settings are in the methods below.

Why a longer signal can make the gap larger

Historical indicator values The slower signal can leave more room between the lines

The same MACD line, two signal lengths, and a 5 basis point histogram hurdle. The selected episode illustrates separation; full-window comparisons establish how often activity changed.

The value table below is available without JavaScript.

Chart data
Data and calculation details
Source: Binance Spot BTCUSDT 2h candles; locally calculated EMA MACD. Prices are official cached candles verified against published SHA-256 files. MACD 12/26 and signal EMAs 3/9 are calculated locally from 2021-01-01 history; no reconstructed fills or trade markers. Times identify candle opens in UTC.
Accessible value table (75 observations)
ObservationClosing price · CloseThe same MACD, two signal lines · MACD 12/26The same MACD, two signal lines · Signal 3The same MACD, two signal lines · Signal 9Histogram distance, in basis points of price · Histogram 3Histogram distance, in basis points of price · Histogram 9
2021-05-05T18:00:00Z57,136.04088.685-42.004-297.24422.87367.546
2021-05-05T20:00:00Z56,796.440143.44550.720-209.10616.32662.073
2021-05-05T22:00:00Z57,436.110235.741143.231-120.13716.10761.961
2021-05-06T00:00:00Z56,835.860257.483200.357-44.61310.05153.152
2021-05-06T02:00:00Z56,797.090268.491234.42418.0085.99844.101
2021-05-06T04:00:00Z57,167.030303.566268.99575.1206.04739.961
2021-05-06T06:00:00Z56,814.790299.488284.242119.9932.68431.593
2021-05-06T08:00:00Z57,261.570328.521306.381161.6993.86629.133
2021-05-06T10:00:00Z57,988.000405.472355.927210.4538.54433.631
2021-05-06T12:00:00Z57,271.310403.969379.948249.1574.19427.031
2021-05-06T14:00:00Z57,088.490383.604381.776276.0460.32018.841
2021-05-06T16:00:00Z56,777.000338.429360.102288.523-3.8178.790
2021-05-06T18:00:00Z56,128.420247.440303.771280.306-10.036-5.856
2021-05-06T20:00:00Z56,296.520186.742245.256261.593-10.394-13.296
2021-05-06T22:00:00Z56,393.680144.809195.033238.236-8.906-16.567
2021-05-07T00:00:00Z56,197.07094.621144.827209.513-8.934-20.444
2021-05-07T02:00:00Z55,705.67015.02279.925170.615-11.651-27.931
2021-05-07T04:00:00Z55,795.360-40.35819.783128.421-10.779-30.250
2021-05-07T06:00:00Z55,766.340-85.602-32.90985.616-9.449-30.703
2021-05-07T08:00:00Z56,231.460-82.971-57.94051.899-4.451-23.985
2021-05-07T10:00:00Z56,464.740-61.355-59.64729.248-0.302-16.046
2021-05-07T12:00:00Z56,997.470-1.222-30.43523.1545.125-4.277
2021-05-07T14:00:00Z57,519.24087.52628.54636.02810.2548.953
2021-05-07T16:00:00Z58,119.990203.984116.26569.61915.09323.118
2021-05-07T18:00:00Z57,584.010250.145183.205105.72511.62525.080
2021-05-07T20:00:00Z57,358.440265.467224.336137.6737.17122.280
2021-05-07T22:00:00Z57,314.750270.960247.648164.3304.06718.604
2021-05-08T00:00:00Z57,558.890291.652269.650189.7953.82217.696
2021-05-08T02:00:00Z58,099.980347.703308.677221.3766.71721.743
2021-05-08T04:00:00Z57,877.970369.946339.311251.0905.29320.536
2021-05-08T06:00:00Z58,463.060429.830384.571286.8387.74224.458
2021-05-08T08:00:00Z58,799.990498.727441.649329.2169.70728.828
2021-05-08T10:00:00Z58,556.090527.567484.608368.8867.33627.099
2021-05-08T12:00:00Z58,828.250565.860525.234408.2816.90626.786
2021-05-08T14:00:00Z57,599.870491.423508.329424.910-2.93511.548
2021-05-08T16:00:00Z58,898.980531.136519.733446.1551.93614.428
2021-05-08T18:00:00Z59,030.560566.694543.213470.2633.97816.336
2021-05-08T20:00:00Z58,782.490568.305555.759489.8712.13413.343
2021-05-08T22:00:00Z58,862.050569.438562.599505.7851.16210.814
2021-05-09T00:00:00Z59,126.140584.904573.751521.6081.88610.705
2021-05-09T02:00:00Z58,632.780550.998562.375527.486-1.9404.010
2021-05-09T04:00:00Z58,446.510503.296532.835522.648-5.054-3.311
2021-05-09T06:00:00Z57,965.590421.823477.329502.483-9.576-13.915
2021-05-09T08:00:00Z57,952.520352.141414.735472.415-10.801-20.754
2021-05-09T10:00:00Z57,907.490289.942352.338435.920-10.775-25.209
2021-05-09T12:00:00Z57,220.020183.065267.702385.349-14.791-35.352
2021-05-09T14:00:00Z57,379.580109.972188.837330.274-13.744-38.394
2021-05-09T16:00:00Z57,458.73057.766123.301275.772-11.406-37.941
2021-05-09T18:00:00Z57,266.9700.90862.105220.799-10.686-38.398
2021-05-09T20:00:00Z58,025.89016.89239.498180.018-3.896-28.113
2021-05-09T22:00:00Z58,240.84046.37042.934153.2880.590-18.358
2021-05-10T00:00:00Z58,700.210105.58174.257143.7475.336-6.502
2021-05-10T02:00:00Z59,356.760203.143138.700155.62610.8578.005
2021-05-10T04:00:00Z59,068.050254.234196.467175.3489.78013.355
2021-05-10T06:00:00Z58,370.170235.694216.081187.4173.3608.271
2021-05-10T08:00:00Z57,899.650180.948198.514186.123-3.034-0.894
2021-05-10T10:00:00Z58,070.630149.634174.074178.825-4.209-5.027
2021-05-10T12:00:00Z57,675.84091.901132.987161.440-7.124-12.057
2021-05-10T14:00:00Z58,296.36095.122114.055148.177-3.248-9.101
2021-05-10T16:00:00Z56,985.300-8.02553.015116.936-10.712-21.929
2021-05-10T18:00:00Z55,733.760-188.585-67.78555.832-21.674-43.854
2021-05-10T20:00:00Z55,641.110-335.290-201.538-22.392-24.038-56.235
2021-05-10T22:00:00Z55,816.140-432.447-316.992-104.403-20.685-58.772
2021-05-11T00:00:00Z55,565.330-523.647-420.319-188.252-18.596-60.360
2021-05-11T02:00:00Z55,142.460-622.865-521.592-275.175-18.366-63.053
2021-05-11T04:00:00Z54,798.000-720.980-621.286-364.336-18.193-65.084
2021-05-11T06:00:00Z55,740.090-714.482-667.884-434.365-8.360-50.254
2021-05-11T08:00:00Z55,901.150-688.401-678.143-485.172-1.835-36.355
2021-05-11T10:00:00Z55,210.470-715.219-696.681-531.182-3.358-33.334
2021-05-11T12:00:00Z55,750.000-685.040-690.861-561.9531.044-22.078
2021-05-11T14:00:00Z56,052.820-629.433-660.147-575.4495.479-9.631
2021-05-11T16:00:00Z56,395.100-551.388-605.767-570.6379.6433.413
2021-05-11T18:00:00Z56,608.940-466.900-536.333-549.89012.26614.660
2021-05-11T20:00:00Z56,510.260-403.256-469.795-520.56311.77520.758
2021-05-11T22:00:00Z56,670.020-336.053-402.924-483.66111.80026.047

This historical example holds the fast and slow price EMAs at 12 and 26; only the signal length changes. In the lower panel, histogram distance is expressed in basis points of price. One basis point is 0.01%.

Select The longer signal leaves a larger gap. The nine-bar signal trails far enough behind MACD for their difference to exceed the five-basis-point hurdle, while the three-bar difference remains below it. Both use exactly the same MACD line.

A signal line does two jobs in this rule: it smooths MACD, and it sets the reference from which the histogram’s height is measured. That second job helps explain why a slower line can produce more decisions once a hurdle is added.

For a steadily moving MACD line, the signal EMA’s lag grows roughly with its period minus one. An exploratory followup tested that explanation in 10,368 evaluations, scaling the hurdle by that same relationship while leaving signal nine unchanged. A 20-basis-point hurdle at signal nine becomes five at signal three and ten at signal five. At that 20-basis-point baseline, 32 matched cases had all four rule outputs recorded: original signal 3→5 increased activity; the scaled version reduced it in every case. This supports the gap-amplitude explanation, without making the scaling rule a universal fix.

More activity is not a better strategy

In the same 12/26 example with a 20-basis-point hurdle, changing signal 3→5 raised executions from 127 to 295 while recorded return fell from −8.75% to −50.00%. Making the rule busier did not make it better. The useful lesson is the interaction: signal smoothing changes both the smoothness of the reference line and the size of the gap being measured.

That behavior does not identify a universally best signal length. The full methods retain the replication results, passive comparisons and cost sensitivity checks.

For the underlying averages, see our EMA and SMA guides. Our ADX guide separates trend strength from direction, while RSI and Bollinger Bands examine different momentum and volatility measures.

What we tested, and how to reproduce it

The activity chart foregrounds the BTCUSDT two-hour 2021–2023 example with no MACD-above-zero entry gate. Its complete chart-data file also retains the 2024–2025 replication: changing signal 3→5 reduced executions from 941 to 781 without a hurdle and increased them from 39 to 135 at 20 basis points. The worked historical indicator chart uses BTCUSDT two-hour candles from 5–11 May 2021; its generic candle labels count from the start of that excerpt, while the downloadable values retain exact UTC timestamps.

For the selected 12/26, 20-basis-point comparison in 2021–2023, the passive control with the same startup and 99% allocation returned −10.95%, compared with −8.75% at signal three and −50.00% at signal five. Repeating the complete Bitcoin two-hour grid at 0.2% cost per execution, across both historical windows, lowered return in 26,827 of 26,832 observed matched pairs; five moved the other way. Execution counts also changed in 6,257 pairs. These controls show sensitivity to the cost and execution model, rather than simply subtracting a larger fee from identical fills. Neither a selected example nor a winning backtest establishes future outperformance.

The main study uses Binance Spot BTCUSDT and ETHUSDT on two-hour and four-hour candles. The core grids were frozen before exploration. We repeated the same settings in 2021–2023 and 2024–2025; these are historical checks, not prospective live validation.

Accepted coverage is 144,768 related evaluations: 107,520 core settings across eight frames, 10,368 focused scaling evaluations across four Bitcoin frames, and 26,880 doubled-cost evaluations across two Bitcoin two-hour frames. There are 144,609 exported traded rows and 159 reconciled zero-trade settings, with no invalid tuples, row errors or duplicate rows. Deliberate equivalent-rule comparisons are included in this evaluation count; it is not a count of independent ideas or trials.

Each run begins with 10,000 USDT cash, holds a long position or cash, requests orders for the next candle’s open, and waits 500 bars before acting. Position size is 99% of equity, leaving a cash reserve. A separate allocation control showed that using every available dollar could delay entries when the next open rose; we therefore excluded the original 100% runs from the main findings and repeated the fixed grids with the reserve. This correction was made for execution consistency, without choosing allocations for returns. Cash earns no interest. The same number of warmup bars covers more elapsed time on the four-hour chart.

The signal rule enters when histogram exceeds a positive hurdle and exits below its negative counterpart. A hurdle of five basis points means 0.05% of that candle’s price. These are explicit state rules: the first eligible bar can trigger an order without a fresh crossing. An optional entry gate additionally requires MACD above zero. Strict equality triggers neither order.

The core grid uses fast EMAs 6–18 by two, slow EMAs 20–50 by two, signal EMAs 3–21 by two, hurdles of 0/1/2.5/5/10/20 basis points, and both entry-gate choices. The exploratory scaling grid uses fast 8/12/16, slow 20/26/40, signal 2–25, the same six hurdles, and original or scaled mode, on both Bitcoin candle sizes and windows. The scaled hurdle multiplies the original hurdle by (signal length − 1) / 8, leaving the nine-bar signal unchanged. For an approximately linear MACD ramp of slope d per bar, the signal EMA trails it by approximately (signal length − 1) / 2 bars after transients. Histogram distance is therefore approximately d × (signal length − 1) / 2. The followup compensates for this length scale; it does not assume real market curves are steady ramps, or promise identical activity after scaling. The scaling followup was motivated by the original exploration and fixed before the original later-window outputs were opened. The reserve-controlled results repeat that design; they are not a newly untouched holdout. All 1,044 observed identical-rule canary pairs (signal nine or zero hurdle) reproduce complete metrics exactly.

The default combined fee/slippage assumption is 0.1% at each execution. Cost controls repeat the same BTC two-hour settings at 0.2%. Zero-cost sensitivity was unavailable through the current interface: entering zero still produced charged-fee results. Those attempts are preserved as excluded diagnostics, not described as frictionless tests. The date inputs are 2021-01-01–2023-12-31 and 2024-01-01–2025-12-31. The final included candle opens at 00:00 UTC on the end date. The platform’s buy-and-hold benchmark uses the first close and last close across that window; its measurement period includes the 500 bars when the strategy stays in cash. Separate recorded passive controls use the same 99% size, 500-bar startup, next-open order and 0.1% cost, then hold the asset. These controls are excluded from main evaluation totals and supply the startup-matched return comparison.

Original compact exports, screenshots and count ledgers are preserved privately. An auditor checks their hashes, exact Cartesian parameter membership, completed counts, capital, candle size, duplicate tuples, errors and repeated-rule agreement. A missing zero-trade row receives no fabricated metric and enters no matched parameter pair. Passive-baseline coverage separates traded rows from reconciled idle-cash settings: with no orders or interest, idle cash has a known 0% return and therefore beats a negative passive return. Related parameter evaluations and deliberate repeats are not independent statistical trials. The published evidence file records completed counts and source checksums; the methods file includes every completed grid and frame.

The worked historical chart is locally calculated indicator data from checksum-verified official Binance candles, with EMA initialization stated in its source file. It contains no reconstructed fills. Eight recorded executions from the original 100% diagnostic smoke were separately reconciled to official next-candle opens and preceding indicator conditions; that sample verifies the sample, not every execution in the study.

The unaltered completed-batch screenshot shows the later Bitcoin core run: 26,880 evaluations across both candle sizes, 26,830 exported traded rows and 50 zero-trade settings, with dates, costs and grid visible.

Completed TrainBard Bitcoin batch with 26,880 evaluations across two-hour and four-hour candles

Download the main signal script, exploratory scaling script, completed evidence, exact methods, and historical-chart provenance.