
This page gives you the Harpoon EA free source code, the .mq4 file itself and not a compiled robot you have to trust. It is a pin bar reversal robot, and the file shows every rule it follows.
- Platform: MetaTrader 4, a single .mq4 file
- Strategy: pin bar reversal
- Price: free, a free account is all you need
- Licence: study it, edit it and, if you want, rebrand it
In short, you get exactly the file we publish, and therefore nothing stops you from rebuilding any part of it.
How the Harpoon strategy works
A pin bar is a candle with a long tail and a small body, which means price went somewhere and got rejected. The robot measures the tail against the body and the surrounding bars, so the pattern becomes a number instead of an impression.
Mean reversion assumes that a price stretched far from its average tends to come back, so the robot sells strength and buys weakness. It wins often and loses big when a real trend starts, which is why the stop is the part of the file worth reading twice.
The whole decision lives in one function, so you can follow it from the first condition to the order that gets sent.
What is inside the Harpoon EA free source code file
- The pattern measure, the tail to body ratio and the context it requires.
- The distance measure, where the robot decides that price has stretched far enough.
- The risk block, with the lot sizing, the stop loss and the take profit.
- Finally, every input with its default value, so you can compare it against your own broker.
How to compile and run it
- First, download the .mq4 file from the button at the end of this page.
- Then open MetaEditor 4 from MetaTrader 4, with F4 or the editor button.
- After that, save the file inside MQL4 and then Experts, and press Compile.
- Finally, refresh the Navigator and drag Harpoon onto a chart.
- Run it on a demo account first, and read every input before you go live.
If the compiler complains, our guide on compiling MQL source covers the usual causes. In most cases it is simply a missing include or the wrong folder.
What you can change
The ratio decides how strict the pattern is. Demand a longer tail and you get fewer, cleaner signals.
Before any of that, however, look at the risk block. After all, a good entry with the wrong lot size still empties an account, and therefore the sizing deserves the first pass rather than the last.
More robots like this one are in the free EA source code library, and the paid catalogue with documentation and support lives in the MT5 source code section. The idea behind candlestick patterns is explained well on this reference page.
Questions about the Harpoon EA free source code
Which platform is it for? MetaTrader 4, one .mq4 file with no dependencies to hunt down.
Can I run it on several pairs? Attach it to one chart per pair and give each one its own magic number.
Can I change the logic? That is the whole idea. The entry and the exit sit in separate functions.
Is there support? The free library comes as it is. The paid catalogue is the one that ships with documentation.
Download the Harpoon EA free source code
The file below is the complete .mq4. First of all, create a free account or log in. Then download it and, finally, open it in MetaEditor 4.
Free source code. Log in or create a free account to download the Harpoon EA Source Code source files.
Premium Source Codes
Full editable MQL4 / MQL5 source code. Looking for a more advanced strategy?
Source CodeAria AI Connector MT5 EA – Source Code
$5,000.00
Source CodeHFT AI Fast M1 Gold Scalper MT5 EA – Source Code
$3,500.00
Source CodeFast M1 Gold Scalper Deluxe Edition MT4 – Source Code
$3,500.00
Source CodeFast M1 Gold Scalper Deluxe Edition MT5 – Source Code
$3,500.00
Source CodeAurum Apex MT5 – Source Code
$2,500.00
Source CodeAurum Apex MT4 – Source Code
$2,500.00
Source CodeHFT FAST M1 GOLD SCALPER v8.22
$2,000.00
Source CodeFast M1 Gold Scalper MT5 – Source Code
$1,800.00
Source CodeFast M1 Gold Scalper MT4 – Source Code
$1,800.00
Source CodeStrike Scalper Pro EA
$1,800.00
Source CodeGreedy King EA MT5 – Source Code
$1,700.00
Source CodeProfit 20 PRO EA
$1,700.00
Source CodeReal Profit Maker EA
$1,700.00
Source CodeGreedy King EA MT4 – Source Code
$1,700.00
Source CodeEuro Scalper V10 EA
$1,600.00
Source CodeXAU Daily Predator MT4 – Source Code
$1,600.00
Source CodeXAU Daily Predator MT5 – Source Code
$1,600.00
Source CodeSuper Signals EA
$1,600.00
Source CodeTHUNDERDOMINATOR EA
$1,600.00
Source Code
