Mp6140's Hedge

 

One of our senior members, mp6140, has developed a hedging strategy specifically tailored for the GBPUSD pair. What started out from just one single hedge placed at a specific time of the day has now grown to seven full hedge slots per day.

This thread is opened to discuss the hedging strategy as well as to continue developing the EA.

For those who just joined this thread and would like to know more background on this strategy, please go to the "Join the Dots" thread at the "Suggestions for Trading System" section.

Many thanks to mp6140 for sharing with us this hedging strategy.

Thanks also to KaMpeR for hosting this discussion in his "Join the Dots" thread.

Credits to fxshadow for compiling mp6140's notes on the hedging strategy.

Attached below is the EA created by myself and an instruction sheet compiled by fxshadow. Open seven GBPUSD charts and attach each with the EA. Make sure each has a unique magic number and set the hedging time to correspond with the times stated in the instruction sheet. If your broker's clock is not GMT, please adjust the trading times accordingly.

I will update this page everytime a new version of the EA or an updated strategy arises.

Regards,

Azmel.

mp6140's Hedge v3.21 EA

Magic. This is the EA's ID. If you are using different EAs on one account, make sure the Magic number is unique from all others.

TimeToTrade. This is the time to place the hedge. Enter a four digit number which correspond to the hours and minutes that you want place the hedge, for example, if you want to place the hedge at 2:45am, then enter 0245 here.

Lots. The number of lots for each hedge if Money Management is not used.

TakeProfit. The take profit amount for each trade.

StopLoss. The stop loss amount for each trade. If you don't to use a stop loss, enter 0 here.

MoneyManagement. If set as true, the EA will calculate the amount of lots for you.

Risk. If MM is true, use this much percentage of the free margin available to open a trade. Enter any range between 1 to 50.

UseBreakEven. If set to true, when one trade hits TakeProfit, the other trade will move to break even.

BuyComment. Comment when entering a long trade.

SellComment. Comment when entering a short trade.

mp6140's Hedge v3.31 EA

This is an EA modified by BigBoppa to allow up to seven trades to be handled by this EA alone. Please refer to post #64. Many thanks to BigBoppa for the modifications.

 

Seven Charts?

Hi Azmel

Quick question please?

Why do we need seven charts with seven versions of the EA loaded each with a different Magic Number?

Is it not possible to create one EA that assigns a different magic number to each hedge it needs to place at the different times?

Cheers

Wayne

 

Because some broker's don't allow scalping (however the broker defines it), it would be good to modify the EA to have a hidden TP that the broker can't see.

 
KaMpeR:
Hi Azmel

Quick question please?

Why do we need seven charts with seven versions of the EA loaded each with a different Magic Number?

Is it not possible to create one EA that assigns a different magic number to each hedge it needs to place at the different times?

Cheers

Wayne

Hi Wayne,

The current EA (ver 3.1) can only do one hedge per day. As we now have seven hedging slots, we will need to open seven charts and attach each chart with the same EA.

The only settings that is different from one chart to the other is the Magic number and the hedging times.

However, it is possible to write an EA to handle all seven hedges by itself. I will put that in the "to-do" list for the EA.

Regards,

Azmel.

 

Great Features

Hi Azmel,

These are important features to add, listed in the order of importance from top to bottom. A "Break-Even" feature is the most important one. Great job!

One more feature you might want to add: global variables in case computer shut down or internet connection disrupted.

Thank you, and we look forward to the new version.

azmel:
Here are some "to-do" list for the EA:

-Incorporating a "Break-Even" feature for the remaining trade once the other trade takes profit. This is to minimise risk for those with bigger spreads.

-Invisible mode to hide the TP value to avoid brokers hunting down scalpers as well as for those who cannot place TP less than 10.

-Multiple hedging. A single EA that will handle as many hedging as the user wishes per day without the need to open multiple charts.
 

EA compiling error

Hi Azmel

When compiling EA v3.1, it gave error "OKToTrade - comparison expression expected".

Please fix. Thanks.

 
kdforextrader:
Hi Azmel

When compiling EA v3.1, it gave error "OKToTrade - comparison expression expected".

Please fix. Thanks.

kdforextrader,

I've tried on NorthFinance, Alpari and InterbankFX's metatrader software and they compiled fine with no errors.

Which broker are you using?

Regards,

Azmel.

 

Azmel,

Let me correct. It was a warning message. I use InterbankFX MT4 demo, build 211 (latest version). In the code, there's this line "if (OKToTrade)" when compiled, it gave warning message. When I changed this variable OKtotrade == 1, then compiled okay without warning.

azmel:
kdforextrader,

I've tried on NorthFinance, Alpari and InterbankFX's metatrader software and they compiled fine with no errors.

Which broker are you using?

Regards,

Azmel.
 

The great danger of this strategy is that when one side of the hedge hit profit target, the remaining open order is trading naked (without stoploss). If price takes off in one direction without retracing, our account will be in trouble. However, with the breakeven feature this kind of risk and drawdown hopefully will be minimized.

saintmo:

...drawdowns could be brutal. There were times however when the price just jumped in one direction without ever retracing even a pip.

 

Following are the results of my backtesting for this strategy using the EA.

Also, clearly if you can do better than a 4 pip spread the results would be better.

================================================

ah --- testing --- i forgot that part of it ! (thankfully !)

with 5 lots, i make $250 per side, each day although i rarely take more than a few trades (mostly because i forget what time it is and dont want to enter late.)

there WILL be days, albeit few, where the overall trend and momentum of the currency will not allow one side to complete within the normal 30 - 45 minutes that it usually takes, but i have yet to find a single instance of where that trade did not get taken out within a few days. Having said that, because of the movement of GU, the NEXT trade taken worked just fine, so you do get "floaters", but if money management is applied based on your equity, you should NEVER be in trouble and that only happens on the "minor" reversals !

if youre having problems with the silly spread your broker gives you on GU (which btw trades in FIVE decimal places and not the four you see normally)

find another broker or use an ECN with two accounts !

enjoy and trade well

mp

 
saintmo:

Total profit of $5,008 or about 10% annual return on $50k account. Trading .1 lots looks to be safe (?) for trading a smaller account, but drawdowns could be brutal.

Thank you saintmo for the backtest results. The graph from your result confirm a statement that mp6140 mentioned in the "Join the Dots" thread.

If I remembered correctly, he once said that the hedging strategy works almost everytime, but a situation where the hedge doesn't hit both sides occurs once every three years. If that happens, as per m6140's words, move on and and continue next day as if nothing happens.

This was when the TP was 10. Now we have reduced the TP to 5 so it should be safer. It is also worth to point out that mp6140's pip spread is only 1. Most MT4 brokers do not have such a low spread on the GBPUSD pair. For users with big spreads, adjust the TP values accordingly to avoid the hedge not hitting its TPs because it needs to work harder to hit it.

Reason: