Search arXiv⌕ Search

arXiv · 2501.10808

Optimizing MACD Trading Strategies A Dance of Finance, Wavelets, and Genetics

Abstract

In today's financial markets, quantitative trading has become an essential trading method, with the MACD indicator widely employed in quantitative trading strategies. This paper begins by screening and cleaning the dataset, establishing a model that adheres to the basic buy and sell rules of the MACD, and calculating key metrics such as the win rate, return, Sharpe ratio, and maximum drawdown for each stock. However, the MACD often generates erroneous signals in highly volatile markets. To address this, wavelet transform is applied to reduce noise, smoothing the DIF image, and a model is developed based on this to optimize the identification of buy and sell points. The results show that the annualized return has increased by 5%, verifying the feasibility of the method. Subsequently, the divergence principle is used to further optimize the trading strategy, enhancing the model's performance. Additionally, a genetic algorithm is employed to optimize the MACD parameters, tailoring the strategy to the characteristics of different stocks. To improve computational efficiency, the MindSpore framework is used for resource management and parallel computing. The optimized strategy demonstrates improved win rates, returns, Sharpe ratios, and a reduction in maximum drawdown in backtesting.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Wangyu Chen, Zhenpeng Zhu. 2025-02-04. Optimizing MACD Trading Strategies A Dance of Finance, Wavelets, and Genetics. https://arxiv.org/abs/2501.10808

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Centering Drives Normalization Gains: Price-Offset Nuisances in Cross-Sectional Return Prediction

Cross-sectional return prediction from raw intraday bars is sensitive to each instrument price level, an additive nuisance under a return-ranking hypothesis. We test whether removing this offset, rather than rescaling amplitudes or changing the encoder, explains gains on a point-in-time CSI~300 five-minute panel. We evaluate eight parameter-matched encoders with and without RevIN normalization; a parameter-free ladder then separates identity, scale-only, centering, last-value referencing, differencing, and standardization across all fields and restricted channels. Centering drives the reliable effect, while scale-only normalization does not help. All eight paired effects are positive and survive Holm correction on raw rank IC, after style residualization, and after further residualizing on short-term reversal. Among six stronger encoders, gains of 0.0376-0.0567 exceed the 0.0109 spread of normalized IC (0.0830-0.0939). Price-only standardization retains 93--101% of the all-field gain. These results place the main effect in transformed price-channel offset removal rather than amplitude scaling or encoder choice.

cs.CE↗

TERRA-NG v1.0: Extreme-Scale, GPU-accelerated Mantle Convection

We present TERRA-NG, a portable, GPU-accelerated, matrix-free mantle-convection code. A single Kokkos C++ implementation runs at scale on NVIDIA, AMD, and Intel GPU supercomputers. TERRA-NG has a deliberately narrow design: built on a radially extruded mesh of spherical wedges, tailored to the spherical shell geometry, which enables domain-specific optimizations like single quadrature-point integral-evaluations, radial coordinate storage compression and radial shared-memory tiling. The corresponding low-order $W_1$-iso-$W_2/W_1$ wedge-based Stokes--energy discretisation is verified against the Zhong et al.(2008) spherical-shell convection benchmark suite. We showcase TERRA-NG through strong- and weak-scaling on the JUWELS Booster (NVIDIA A100), MareNostrum 5 (NVIDIA H100), LUMI-G (AMD MI250X), Hunter (AMD MI300A APU), and SuperMUC-NG Phase 2 (Intel PVC) supercomputers. Coupled mantle convection simulations at $\sim\!11$ km and $\sim\!5.6$ km radial spacing ($\sim 2.8$ B and $\sim 22$ B DoFs) can be run routinely on standard node partitions of all considered systems. Global $\sim\!1$ km-per-gridpoint mantle convection ($\sim 1.4$ T DoFs) is feasible on an extreme-scale allocation, and a sub-km hero-run at $\sim\!0.7$ km grid spacing scaling up to $\sim 11,000$ GPUs of LUMI-G ($\sim 11$ T DoFs) shows the potential of the code on future, larger machines.

cs.CE↗

AFT Neural Function Approximators for 1D Nonlinear Force Laws

Nonlinear contacts and friction strongly influence the vibration response of assembled structures, but their accurate numerical treatment is computationally demanding. The harmonic balance method is widely used to compute periodic steady-state responses, yet the required alternating frequency-time scheme becomes costly for nonsmooth and hysteretic nonlinearities and must be repeated throughout the nonlinear solution process. Here we show that this procedure can be replaced by neural networks that directly map displacement Fourier coefficients to nonlinear force coefficients and provide the corresponding Jacobian through automatic differentiation. The surrounding solver and continuation algorithms remain unchanged for the computation of frequency response curves. The neural networks exclusively learn individual nonlinear elements rather than complete system responses. Physics-based nondimensionalization and phase normalization facilitate the learning process and enable a single trained network to cover a wide range of parameter combinations. Building on the cubic spring, unilateral spring, and Jenkins elements considered here, the approach points toward a reusable library of nonlinear-element surrogates that can be combined in arbitrary number and location within a mechanical system. By bypassing the iterative force evaluation in time domain, the method offers favorable computational scaling for high-resolution analyses and systems with many nonlinear elements.

cs.CE↗