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
  #11 (permalink)  
Old 02-10-2008, 03:17 AM
Member
 
Join Date: Jun 2006
Posts: 50
kdforextrader is on a distinguished road
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.

Quote:
Originally Posted by azmel View Post
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
  #12 (permalink)  
Old 02-10-2008, 03:48 AM
Member
 
Join Date: Jun 2006
Posts: 50
kdforextrader is on a distinguished road
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.

Quote:
Originally Posted by saintmo View Post

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

Last edited by kdforextrader; 02-10-2008 at 03:51 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
  #13 (permalink)  
Old 02-10-2008, 05:21 AM
mp6140's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 673
mp6140 is on a distinguished road
[quote=saintmo;185087]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. [quote]

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

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
__________________
KNOWLEDGE and EXPERIENCE are the handmaidens of the riches of forex, and i buy them roses every day, with many a thank you !
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
  #14 (permalink)  
Old 02-10-2008, 07:58 AM
azmel's Avatar
Senior Member
 
Join Date: Dec 2007
Location: United Kingdom
Posts: 209
azmel is on a distinguished road
Quote:
Originally Posted by saintmo View Post

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.

Last edited by azmel; 02-10-2008 at 08:02 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
  #15 (permalink)  
Old 02-10-2008, 12:56 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
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.
The EA has an option to set a StopLoss, if so desired, although it will sway away from mp6140's principles.

Perhaps saintmo (or anyone) who has a good history data of GBPUSD can run a backtest with optimisation enabled to find out what would be the optimum StopLoss value, and to see the effect of having a StopLoss as opposed to without.
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
  #16 (permalink)  
Old 02-10-2008, 03:22 PM
Senior Member
 
Join Date: Aug 2006
Posts: 217
saintmo is on a distinguished road
2007 optimizations

Attached are 4 optimization runs for 2007. All trade .1 lots at IBFX using a $50k account.

The first 3 (10:30, 20:00 & 24:00 est) were optimized on tp 1 through 10 at 1 pip steps and sl 0 through 30 at 5 pip steps. The profits improved in many cases (over the original 5 pip tp and 0 sl) and in some cases at the expense of an increased dd. It may be that certain of the times such as 20:00 just need to be dropped due to the drawdown/risk. In all cases sl of 0 was the only sl setting producing profits.

Consequently, I redid the most profitable time frame (10:30 est) with the same tp but with sl settings of 50 through 300 at 25 pip steps to see what a wider sl would produce (image #4). As you will see much reduced profits resulted -- but with lower dd as well.

Enjoy.
Attached Files
File Type: htm OptimizationReport-mphedge1.htm (4.6 KB, 113 views)
File Type: htm OptimizationReport-mphedge5.htm (3.9 KB, 38 views)
File Type: htm OptimizationReport-mphedge7.htm (4.2 KB, 56 views)
File Type: htm OptimizationReport-mphedge1a.htm (3.9 KB, 69 views)
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
  #17 (permalink)  
Old 02-10-2008, 04:19 PM
robertmc's Avatar
Junior Member
 
Join Date: Jan 2008
Posts: 29
robertmc is on a distinguished road
more results

Here are the top results of SQL query for the minute data from last year.

Last edited by robertmc; 04-18-2008 at 01:53 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
  #18 (permalink)  
Old 02-10-2008, 04:30 PM
Member
 
Join Date: Jun 2006
Posts: 50
kdforextrader is on a distinguished road
No Stoploss is better

Thanks, Saintmo for this backtest. These results confirmed that mp6140's principles are correct by not using stoploss. Thus, the breakeven feature that will be added probably helps in reducing drawdown but not profit. We'll have to wait and test it.

Quote:
Originally Posted by saintmo View Post
Attached are 4 optimization runs for 2007. All trade .1 lots at IBFX using a $50k account.

The first 3 (10:30, 20:00 & 24:00 est) were optimized on tp 1 through 10 at 1 pip steps and sl 0 through 30 at 5 pip steps. The profits improved in many cases (over the original 5 pip tp and 0 sl) and in some cases at the expense of an increased dd. It may be that certain of the times such as 20:00 just need to be dropped due to the drawdown/risk. In all cases sl of 0 was the only sl setting producing profits.

Consequently, I redid the most profitable time frame (10:30 est) with the same tp but with sl settings of 50 through 300 at 25 pip steps to see what a wider sl would produce (image #4). As you will see much reduced profits resulted -- but with lower dd as well.

Enjoy.
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
  #19 (permalink)  
Old 02-10-2008, 08:28 PM
Member
 
Join Date: Mar 2007
Posts: 72
fxshadow is on a distinguished road
Another idea for the EA would be to make the buy and sell comments user defined. This would keep a broker from targeting the EA by name.
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
  #20 (permalink)  
Old 02-10-2008, 11:05 PM
Junior Member
 
Join Date: May 2007
Posts: 7
gerrigirl is on a distinguished road
Quote:
Originally Posted by saintmo View Post
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.
I am confused about the different times to use, are the times above the times you entered on the ea?? or did you enter 45min before those times? 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
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 02:10 PM.



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