DYJ Hedging MT4
The DYJ Hedging is based on the following idea: crossing of two Moving Average lines (Fast and slow ) is used as a signal for opening positions.
The DYJ Hedging searches for position opening conditions only on a new bar (performs operations at the moment of new bar emergence), while Total Profit is controlled on every tick. When a condition for opening a position is found (a check is performed for the Base symbol on which the EA is running), the EA opens two positions at once: on the Base symbol and on the Hedge symbol.
An example of launch on the EURUSD symbol, while the Hedge symbol is USDCHF
Recommended operation in any paris of hedge M5 chart or optimize other timeframe
- InpMagic = 26719034 // magic number
- InpLots = 1 // Manage lots. automatically if inplots is 0
- InpTotalProfit = 100 -- Profit target for closing all positions
- InpLoss=100000 -- Loss target for closing all positions
- InpBase=EURUSD -- Base symbol
- InpHedgePairs = USDCHF -- The default hedge symbol is USDCHF. comma-separated list of symbols to be traded. Not used if empty
Optimize the code