Homologous recombination(HR) is essential for maintaining the genome fidelity and generating genetic diversity. As a prototypical member of the recombinases, RecA from Escherichia coli has been extensively studied by using single-molecule FRET(smFRET), magnetic tweezers, optical tweezers, etc. However, these methods cannot meet the needs of wide-ranged observations nor high spatial resolution at the same time. For sequence comparison, the average base-to-base distance of the homologous dsDNA will be stretched from 0.34 nm to 0.51 nm. The increment for per base pair is 0.17 nm, which is far beyond the spatial resolution of magnetic tweezers so that it cannot be directly measured. As a high-resolution technique, the smFRET enables us to observe more details of reactions. However, its valid measuring distance is 3-8 nm, which limits the observation range. Here, we propose an approach by combining magnetic tweezers with DNA hairpin, which may solve the problem effectively in the study of HR. In this paper, one end of the DNA molecule with a 270 bp hairpin is immobilized onto the surface of the flow cell, while a magnetic bead is attached to the other end. An external magnetic force is applied to the magnetic bead by placing a permanent magnet above the flow cell. The first 90 bp(from the junction of the hairpin) of the hairpin is homologous to the ssDNA within the ssDNA-RecA filament. Thus, the filament searches for homology along the hairpin, and incorporates into the homologous segment for strand exchange. After that, the displaced strand can be opened by pulling at a force of ~7 pN, and each opened base pair results in a 0.82 nm increase in DNA extension. By using this approach, we show that 1) RecA-mediated strand exchange proceeds in a stepwise manner and the average speed is ~7.6 nt/s, which is in accordance with previous result; 2) the dynamic interaction between the second DNA-binding site(SBS) and the displaced strand can be observed in real-time, and the binding force is calculated accurately through the x-dimensional fluctuations; 3) the processes of strand-exchange in different directions can be observed, and the directions are distinguishable through the reaction patterns. The results suggest that the combination of magnetic tweezers with DNA hairpin is a potential approach to the study of RecA or other recombinases. Therefore, our design can be an important single-molecule approach to the research of HR mechanism.