Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2008, 03:32 PM
azmel's Avatar
Senior Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 209
azmel is on a distinguished road
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.
Attached Files
File Type: doc mp6140 handy hedge.doc (42.5 KB, 1050 views)
File Type: mq4 mp6140's Hedge v3.21.mq4 (8.1 KB, 415 views)
File Type: mq4 mp6140's Hedge v3.31.mq4 (11.1 KB, 640 views)

Last edited by azmel; 02-21-2008 at 07:27 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 02-09-2008, 03:43 PM
KaMpeR's Avatar
Senior Member
 
Join Date: Mar 2006
Location: South Africa
Posts: 495
KaMpeR is on a distinguished road
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
__________________
FatCat
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 02-09-2008, 03:47 PM
Member
 
Join Date: Mar 2007
Posts: 72
fxshadow is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 02-09-2008, 03:48 PM
azmel's Avatar
Senior Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 209
azmel is on a distinguished road
Quote:
Originally Posted by KaMpeR View Post
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 02-09-2008, 03:58 PM
azmel's Avatar
Senior Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 209
azmel is on a distinguished road
Quote:
Originally Posted by fxshadow View Post
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.
Here are some "to-do" list for the EA (items highlighed in green italics have been completed):

-Make the buy and sell comments user-defined to avoid brokers hunting down specific comments which points to this 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. Thanks to fxshadow for this idea.


-Incorporating a "CounterTrade" feature to add another trade when the first trade hits TP. This is to double the total winnings on a single hedge. Thanks to psperos for this idea.

-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. Thanks to BigBoppa for the coding.

Last edited by azmel; 02-21-2008 at 07:38 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 02-09-2008, 08:14 PM
Member
 
Join Date: Jun 2006
Posts: 50
kdforextrader is on a distinguished road
Thumbs up 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.

Quote:
Originally Posted by azmel View Post
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.

Last edited by kdforextrader; 02-09-2008 at 09:30 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 02-09-2008, 09:36 PM
Member
 
Join Date: Jun 2006
Posts: 50
kdforextrader is on a distinguished road
EA compiling error

Hi Azmel

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

Please fix. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 02-09-2008, 11:53 PM
azmel's Avatar
Senior Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 209
azmel is on a distinguished road
Quote:
Originally Posted by kdforextrader View Post
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 02-10-2008, 12:04 AM
Senior Member
 
Join Date: Aug 2006
Posts: 217
saintmo is on a distinguished road
backtest results for 2007

Following are the results of my backtesting for this strategy using the EA. 7 separate runs were made for 2007 using IBFX, $50k account, .1 lot, target 5 pips (4 pip spread for GBP/USD). Results are in order of best to worst by time frame - EST.

10:30 profit $1311, 3.88% dd ($2.5k)
12:00 profit $1103, 6.36% dd ($3.2k)
17:00 profit $872, 3.92% dd ($2.0k)
24:00 profit $581, 5.93% dd ($3.0k)
22:30 profit $520, 5.68% dd ($2.9k)
13:30 profit $341, 5.78% dd ($2.9)
20:00 profit $146, 11.5% dd ($5.8k)

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.

Also, clearly if you can do better than a 4 pip spread the results would be better. I haven't tried to analyze that but may do so since this is a fascinating approach. There were times however when the price just jumped in one direction without ever retracing even a pip.

Following are the first 4 gif files, the other 3 will follow in the next post.
Attached Images
File Type: gif mm6140hedge1.gif (9.4 KB, 3146 views)
File Type: gif mm6140hedge2.gif (9.2 KB, 3119 views)
File Type: gif mm6140hedge4.gif (8.9 KB, 3094 views)
File Type: gif mm6140hedge7.gif (9.2 KB, 3104 views)

Last edited by saintmo; 02-10-2008 at 03:03 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #10 (permalink)  
Old 02-10-2008, 12:06 AM
Senior Member
 
Join Date: Aug 2006
Posts: 217
saintmo is on a distinguished road
backtest results for 2007 continued

Following are the remaining 3 gif files associated with the backtest mentioned above:
Attached Images
File Type: gif mm6140hedge6.gif (9.4 KB, 2997 views)
File Type: gif mm6140hedge3.gif (8.8 KB, 2977 views)
File Type: gif mm6140hedge5.gif (9.2 KB, 2954 views)

Last edited by saintmo; 02-10-2008 at 03:04 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
hedge, mp6140, hidden stop loss, "comparison expression expected"


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is a 'fork hedge'? thebts General Discussion 1 08-17-2007 01:13 PM
Need Hedge EA with setup jimbofx7 Tools and utilities 1 07-01-2007 12:43 AM
Help to EA carry through Hedge rodrigokaus Expert Advisors - Metatrader 4 0 04-06-2006 05:43 PM
How do I hedge in MT4? ZTrader Metatrader 4 5 04-01-2006 07:17 AM


All times are GMT. The time now is 01:46 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.