
- MetaTrader 4
- Expert Advisor
- latest
- Updated: 11/09/2026
Algo Samurai EA Source Code (MQ4)
MT4 source code of a martingale, hedging and grid EA set up for EURUSD and USDJPY on M30, with one set file
- MetaTrader 4 source code in MQL4
- 1 editable source file and 1 set file
- EURUSD and USDJPY on the M30 timeframe
- Martingale, hedging and grid strategy
- DLL: no
Choose how to get it
Digital product — download after payment
Free to try: edit it in the Builder, backtest, download the EA.
Builds an MT5 version
Download right after payment
Refund policy
Refunds within 7 days of purchase for a broken or mismatched file, a duplicate charge, or a paid order without download access. No refund once a working file is downloaded, and no profit guarantee.
Read the refund policyThis download is the editable MQL4 source code of the Algo Samurai expert advisor, written for MetaTrader 4. You open it in MetaEditor, read or adjust the logic and compile it yourself.
- Platform: MetaTrader 4
- Symbols: EURUSD, USDJPY · Timeframe: M30
- Strategy: martingale, hedging, grid · Grid/martingale: yes
- Recommended minimum deposit: $100
- In the package: full MQL4 source code (editable), 1 set file
This package is the algo samurai source code mq4: the editable MQL4 file of the Algo Samurai EA for MetaTrader 4, not a ready-made compiled file. It is a source-code product: you compile it in MetaEditor before it can run on a chart.
The listed strategy combines martingale (increasing the lot size after a losing trade), hedging (holding buy and sell positions on the same symbol) and a grid (extra orders opened at set price steps). The listing names EURUSD and USDJPY on the M30 timeframe.
It suits traders and developers who use MT4 and want to read the order logic, change inputs or adapt the code in MetaEditor. We cannot promise that any change you make will work as intended.
The download contains one source file and one set file. There is no compiled file, no PDF and no DLL. See the Strategy & Settings tab for the symbols, timeframe and deposit details, and Installation for the compile steps.
You get the files as an instant digital download after payment. The product is also included in the membership.
Trading foreign exchange and CFDs carries a high level of risk and may not be suitable for all investors. Past performance does not guarantee future results; only trade with money you can afford to lose.
Strategy type
The listing describes martingale, hedging and grid logic, and it marks grid/martingale as present. Martingale and grid approaches in general can add to open exposure and increase lot sizes after losses. Drawdown (the drop from an account's peak balance) can rise quickly with this kind of approach, so read the code and the inputs before you run it.
Symbols, timeframe and deposit
- Symbols: EURUSD and USDJPY
- Timeframe: M30
- Recommended minimum deposit: $100
The $100 figure is the recommended minimum as listed. It is not a guide to how much capital a martingale or grid approach may need under real market conditions, so size your account with that in mind.
Hedging
Hedging means buy and sell positions can be open on one symbol at the same time. Not every broker or account type allows this, so check yours before you test.
The set file
The package has one set file (a saved list of input settings you load in MetaTrader). Treat it as a starting configuration, not as a recommendation of results. Because you also have the source, you can see which inputs the EA reads and compare them with the set file values.
Testing
The listing does not state a prop-firm suitability. Run any change on a demo account first, and check every setting before you trade live.
Platform
This package is for MetaTrader 4 only. The listing gives no minimum build number.
Steps
- Unzip the download. It holds one MQL4 source file and one set file.
- Open MetaEditor from MT4 (File, Open Data Folder, then MQL4 and Experts) and place the source file in the Experts folder.
- Open the file in MetaEditor and compile it. A compiled EA appears in the Experts list after you refresh the Navigator.
- Open an EURUSD or USDJPY chart and set it to M30, the symbols and timeframe in the listing.
- Attach the EA, turn on algo trading, and load the set file from the Inputs tab of the EA window.
The Files fact lists DLL: no, so the package carries no DLL file. The set file is a starting configuration only.
For broader MT4 steps, use the platform's own help at metatrader4.com.
Do I get a ready-to-run Algo Samurai EA file, or only the MQ4 source?
Only the source. The Files fact lists one source file, one set file and no compiled file, so you compile the MQL4 code in MetaEditor before you attach it to a chart.
Can I run the Algo Samurai MQ4 code on MetaTrader 5?
The listing is for MetaTrader 4, and the file is MQL4. MT5 uses MQL5, so this package is not meant for it.
Which symbol and timeframe should I use with the single set file?
The listing names EURUSD and USDJPY on M30. The package has one set file, so you load it on one of those charts as a starting configuration and check each input yourself.
How should I test a martingale, hedging and grid EA before using real money?
Start on a demo account with the listed symbols and M30 timeframe, and watch how lot sizes and open orders behave over time. Trading is risky and these methods can deepen losses; read the risk notice in the Overview first. Check that your broker allows hedging.
Does the package need a DLL?
No. The Files fact lists DLL: no.
Where can I read the refund policy?
For refunds, read the refund policy.
Are there related source-code packages?
Related MQ4 source-code packages include Waka Waka source code (MQ4) and ClevrFX source code (MQ4).
- Platform
- MetaTrader 4
- Type
- Expert Advisor
- Category
- Source Code
- Version
- latest
- Updated
- 11/09/2026
| Role | File name | Size | Version |
|---|---|---|---|
| Executable file | Algo_Samurai_EA_Source_Code__MQ4_.zip | 1.9 MB | latest |
Related products
Reviews
No reviews yet.
Tags: EA Source Code





