Skip to content
All hypotheses

Hypotheses

2MACDSTO by geraked (faithful port): MACD(34,144) Trend + MACD(13,21) Counter-Move + Stochastic(7,3,3) Cross out of the 20/80 Zone, Swing-Distance Risk Sizing, No Hard SL/TP, 50%-of-Risk Trailing Stop, Equal-Size 50-Level Averaging Grid with Basket TP, Long-Short (ETHUSDT.OKX 4H)

Faithful statement of the open-source MQL5 expert advisor '2MACDSTO' v1.4 by geraked (Copyright 2023, MIT licence,…

Hypothesis

Faithful statement of the open-source MQL5 expert advisor '2MACDSTO' v1.4 by geraked (Copyright 2023, MIT licence, https://github.com/geraked/metatrader5/blob/d3eb29c382acf715727d5cd6a0414151e821fc2d/Experts/2MACDSTO.mq5), with its trade-management helpers from Include/EAUtils.mqh at the same commit. Credit: the strategy is geraked's. The author tested it on NZDUSD 3H (2020-01-01 to 2023-10-08). Treat any claimed performance as unverified; our fee-inclusive backtest decides. It is a tradeable strategy, not a……Show moreShow less

Faithful statement of the open-source MQL5 expert advisor '2MACDSTO' v1.4 by geraked (Copyright 2023, MIT licence, https://github.com/geraked/metatrader5/blob/d3eb29c382acf715727d5cd6a0414151e821fc2d/Experts/2MACDSTO.mq5), with its trade-management helpers from Include/EAUtils.mqh at the same commit. Credit: the strategy is geraked's. The author tested it on NZDUSD 3H (2020-01-01 to 2023-10-08). Treat any claimed performance as unverified; our fee-inclusive backtest decides. It is a tradeable strategy, not a utility. MECHANISM: a pullback entry inside a slow trend. The slow MACD (34/144 EMA difference) sets the trend. The fast MACD (13/21) must point against it, which marks the pullback. A stochastic %K cross of %D out of the oversold or overbought zone times the re-entry. The EA places NO stop-loss and NO take-profit on the order (IgnoreSL=true, IgnoreTP=true). A single position exits only through a trailing stop. The stop engages once profit reaches half the swing distance. If price goes against the position instead, the EA averages down with an EQUAL-SIZE grid (GridVolMult=1.0), adding one position every swing distance, up to 50 levels. The whole basket then closes at a common take-profit that earns back the original risk amount plus costs. PLATFORM MAPPING: The venue is the OKX USDT perpetual swap ETHUSDT.OKX, on a MARGIN account. Fees are 0.02% maker and 0.05% taker, about 0.10% for a taker round trip. It must be a perp because the source needs shorts. OKX is 0.8% of the corpus against a target of at least 5%, while BINANCE USD-M is 65.9% against a cap of 40%. ETH is the most liquid OKX perp other than BTC. The mechanism uses price only, with no supplementary feed, so the L160 venue restriction does not apply. Timeframe: our catalog has no 3H bars, so the port uses the nearest native interval, 4-HOUR bars (ETHUSDT.OKX-4-HOUR-LAST-EXTERNAL). The EA code works on any timeframe because all its indicators use the chart timeframe. This is the only deviation from the source. Constants given in points are converted to fractions of price. On NZDUSD (point 0.00001, price about 0.60), SLDev=60 points is about 0.10% of price, and the helper's minPoints=30 is about 0.005% of price. IMPLEMENTATION CAUTION: an earlier faithful port from the same author (3MAF) died at sandbox_timeout. Every indicator must update INCREMENTALLY, in O(1) per bar: - running EMAs for the four MACD legs; - fixed-length deques for the 7-bar high and low and for the 3-bar slowing sums; - a 3-value buffer for %D; - basket state kept in scalars: first entry price, pd, first volume, level count, total quantity, quantity-weighted entry sum, accumulated commissions. Never rescan bar history, the positions list or the fills history inside on_bar.

Analysis

2MACDSTO

Backtest and paper results are hypothetical. Trading involves risk of loss.