Trading robot · MT4

Oil Hedge

by vvvf

This MetaTrader 4 expert advisor implements a correlation-based hedging strategy between two instruments, typically UKOIL and USOIL.

High risk

GitHub stars3
Forks0
Last update5 years ago22 Jun 2021
LicenceNone stated

Overview

Oil Hedge monitors the price spread between the two assets, opening buy and sell positions simultaneously when the spread expands or narrows beyond defined thresholds. The EA manages exits based on spread reversion targets. It includes an optional position-adding feature with lot size multipliers for managing drawdown. No traditional hard stop loss is defined in the input parameters, as it relies on spread convergence for trade closure.

Details

Author

vvvf on GitHub

Type

Trading robot

Platform

MetaTrader 4 (MQL4)

Strategy

Hedging, Mean reversion, Martingale

Markets

Oil & commodities

Timeframes

Any timeframe

Risk profile

  • Uses martingale lot scaling: losses can grow fast
  • Holds opposite positions at once
  • Trades without a fixed stop loss

EA files

Input parameters

Read from OilHedge.mq4. Defaults are the author's; change them in the EA's Inputs tab.

NameTypeDefaultDescription
High_SymbolstringUKOIL高价品种
Low_SymbolstringUSOIL低价品种
magicsint500魔数
lotsdouble0.1手数
MaxOrderdouble2最大订单数
Open_Price_Expanddouble3.75差价扩大到该值时开单
Open_Price_Narrowdouble3.25差价缩小到该值时开单
isAddPositionboolfalse是否开启加仓
Add_Positions_Valdouble0.1加仓的差价间隔
lots_multidouble1.5加仓倍数
Close_Price_Expanddouble3.5差价达到该值?
Close_Price_Narrowdouble3.5差价达到该值?

How to install it

  1. 1Download the sourceUse "Download source (.zip)" above, or clone vvvf/OilHedge from GitHub, and unzip it.
  2. 2Open the data folderIn MetaTrader choose File, then Open Data Folder, and go to MQL4/Experts.
  3. 3Copy the filesCopy the .mq4 file into Experts.
  4. 4Compile in MetaEditorOpen the file in MetaEditor and press Compile. Fix any missing includes the compiler reports.
  5. 5Test before you tradeRun it in the Strategy Tester, then attach it to a demo chart and allow algorithmic trading.
Third-party code. ForexR did not write, test or endorse this EA, and the summary above was generated automatically from its README and code. ForexR lists only repositories with readable source code and never hosts files. Read the code, backtest it and use a demo account first; automated trading can lose money quickly.

Similar expert advisors

Icarus

by fraggli
7 stars

Icarus is an automated trading system for MetaTrader 4 that employs a grid strategy with Martingale lot scaling. It utilizes Bollinger Bands and the Stochastic Oscillator to identify entry points, offering a conjunctive mode for filtered execution. The EA manages risk through maximum position limits, equity warning thr

MT4 Trading robot GridMartingaleMean reversion High risk
Updated 4 years ago GPL-3.0 GitHub repository of Icarus

North East Way

by Yogurt-Peng
3 stars

This MetaTrader 4 robot implements a multi-currency mean-reversion strategy, targeting price returns to the average on correlated forex pairs. It manages trades using a grid system with a significant martingale multiplier to scale lot sizes. The expert advisor allows for simultaneous trading on multiple symbols to dive

MT4 Trading robot Mean reversionGridMartingale High risk
Updated 1 year ago None stated GitHub repository of North East Way

Arbitrage Expert

by wawaw237zz
1 stars

Arbitrage Expert is a MetaTrader 4 expert advisor that focuses on a zone recovery hedging strategy rather than traditional arbitrage. Based on the OGT Zone Recovery system, it manages trades by opening counter-positions within a defined price zone when an initial trade goes into drawdown. The system employs a lot multi

MT4 Trading robot HedgingMartingaleMean reversion High risk
Updated 4 years ago None stated GitHub repository of Arbitrage Expert

Blessing Three

by duanwujie
1 stars

This MetaTrader 4 expert advisor is an automated grid trading system that utilizes a variety of indicators including Moving Averages, CCI, Bollinger Bands, and MACD for trade entries. It employs a martingale-style lot multiplier to manage position sizing across sequential grid levels. The software includes risk control

MT4 Trading robot GridMartingaleIndicator crossover High risk
Updated 9 years ago None stated GitHub repository of Blessing Three

AW Full Recovery EA

by wongthep
2 stars

This MetaTrader 5 expert advisor functions as a grid-based recovery system that can operate independently or manage trades from external EAs via magic number filtering. It initiates entries using Bollinger Bands and RSI indicators, then manages drawdown through a recovery grid matrix. The system employs dynamic ATR-bas

MT5 Trading robot GridMartingaleHedging High risk
Updated 3 months ago None stated GitHub repository of AW Full Recovery EA

Advanced Grid Trading

by jepli-1225
2 stars

Advanced Grid Trading is a MetaTrader 5 expert advisor that manages a complex grid strategy across four configurable layers. It places stop and limit orders at fixed intervals, employing either fixed or geometric lot scaling for increased grid depth. Trade management includes a shared profit pool used to close losing p

MT5 Trading robot GridMartingaleMean reversion High risk
Updated 6 months ago None stated GitHub repository of Advanced Grid Trading

More trading robots

Need a broker for MT4?

Compare regulated brokers that support MetaTrader, with spreads, minimum deposits and leverage side by side.

Compare brokers