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 03-31-2008, 03:39 AM
Junior Member
 
Join Date: Mar 2008
Posts: 6
onealpha is on a distinguished road
Wink The ‘Hedge’ Rocks Expert Advisor for MT4

The ‘Hedge’ Rocks Expert Advisor for MT4. I warn you now that I am more of a math dude than a MQL/MT4 programmer: my programming techniques are much like my surroundings… disorganized and messy. However, the math is sound and matches the FR trading system to a high degree of precision. Feel free to clean up my code if you wish.

Now some caveats:
1) This EA was never tested on the real thing… only demos. It is still somewhat buggy. Don’t run it on a live account unless you thoroughly test it on a demo account.
2) I wrote this using the tradeviewforex.com demo account. It is calibrated to use 200:1 leverage with 100K lot sizes and roughly a 10K or 100K account balance.
3) The sizes of your purchased lots (according to FR) should be no less than .5 to ensure that the ratios between the hedge groups are optimized. It still seems to work fine with less. If you choose the highest leverage or use 10K or ‘micro’ lot sizes to trade, the purchased lots will be higher. If you can’t change your lot sizes or your leverage… than you have to increase the amount you trade… via the Margin Percentage or the account balance… or both. It seems to work just fine with purchased lots of less than .5 but, that is what they say.
4) I simply copied the FR system as best I could and have no opinion on its validity. They all seem a bit fanatical if you ask me… and that whole direct marketing thing is just not my cup of tea. It certainly can lose in spite what your Cool-Aide-Drinking friends at FR might tell you.
BUGS:
1) During the placing of the initial orders, sometimes one of two members of a currency group gets rejected by the broker which causes it to sell the remaining pair and reorder the group… causing you to eat the spread on the sold pair. It has something to do with the speed at which some brokers can accept orders.
2) Rarely, it has a problem getting the historical data and crashes out my little Pearson Correlation routine at the end. I put in a bunch of catches but it still throws an error on rare occasion.


Feel free to ask me questions. I will post some instructions next.
Attached Files
File Type: mq4 Hedge Rocks.mq4 (57.0 KB, 636 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
  #2 (permalink)  
Old 03-31-2008, 03:38 PM
Senior Member
 
Join Date: Dec 2007
Posts: 492
Enforcer is on a distinguished road
That's look interesting.
What need to be changed to work on 1:100 leverage and microaccounts(~2000$)?
__________________
www.signalcopy.com - Most advanced tools for copy Metatrader signals.
Free MT4 account statistics - advanced stats and graphs for MT4 accounts
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 03-31-2008, 04:27 PM
Junior Member
 
Join Date: Mar 2008
Posts: 6
onealpha is on a distinguished road
Not too much needs to be changed

It is supposed to addapt to all of that via the cf (conversion Factor). It should addapt but if you aren't happy with the profit or loss brackets, change the grab_profit_factor (in the EA properties) until you are happy. Tell me how it does at 100:1. Make sure you don't go live until you are sure it's going to do what you want.


Quote:
Originally Posted by Enforcer View Post
That's look interesting.
What need to be changed to work on 1:100 leverage and microaccounts(~2000$)?
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 03-31-2008, 04:35 PM
Senior Member
 
Join Date: Dec 2007
Posts: 492
Enforcer is on a distinguished road
Of course I don't use on live
Should pass at least 1-2 months on demo first.
Well, I changed already cf and grab_profit_factor to different values buy on screen it say constantly same value for EU-UC,GU-UC Grab Profit: 304.80.
Lot size is ok, but I doubt it will reach too soon 300$ profit...
With default values , until now is on ~ -45$.
__________________
www.signalcopy.com - Most advanced tools for copy Metatrader signals.
Free MT4 account statistics - advanced stats and graphs for MT4 accounts
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 03-31-2008, 07:40 PM
Junior Member
 
Join Date: Aug 2007
Posts: 19
Orest is on a distinguished road
Thanks for the system/EA, onealpha - I was always wondering what those FR fanatics worship at?

One question - when I started the EA I chosen G/U, E/U and U/C as trading pairs, but EA alerted me that U/C is not good correlated pair, so I switched to U/J instead (still got the same alert though). Could you suggets what's the best pairs set to trade?

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
  #6 (permalink)  
Old 04-01-2008, 05:28 AM
Junior Member
 
Join Date: Mar 2008
Posts: 6
onealpha is on a distinguished road
YTD correlation

Quote:
Originally Posted by Orest View Post
Thanks for the system/EA, onealpha - I was always wondering what those FR fanatics worship at?

One question - when I started the EA I chosen G/U, E/U and U/C as trading pairs, but EA alerted me that U/C is not good correlated pair, so I switched to U/J instead (still got the same alert though). Could you suggets what's the best pairs set to trade?

Thanks
The closer YTD correlation is to -1, the better for this system. -1 means that a perfect inverse correlation exists and the net profit/loss would always be near zero. I made a warning when the pairs drop/rise above a certain threshold... I think it was -.3 (but I could be wrong). This just means that things aren't so good with that currency. The EURUSD - USDCHF is always close to -.9. The GBPUSD USDCHF is supposed to be near -.84... but is not doing so well lately. When trading against the JPY pairs, it's always going to be low or even positive... which is no good for a hedge. However as risk goes up, so does O/N interest rates. It's simply a math thing and for the more mathematically inclined... it should give them a 'feel' for the risk and the probability of sucess with this system... it should not be over emphasized.
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 04-01-2008, 04:28 PM
Junior Member
 
Join Date: Aug 2007
Posts: 19
Orest is on a distinguished road
Any EA forwardtesting results?

Onealpha, I'm forward testing with USD/JPY and results are promising so far. Probably need to establish another account with USD/CHF. Is USD/CHF your personal preference over JPY pair?

Do you have any historical results to share?
The code needs to be adjusted though, the "500" constant was too high for my grab profit level (profit level was calculated as $27,000 for $50,000 account probably because of the leverage level) , I think it needs to be set as parameter (or part of GrabProfit parameter).

Again, like the EA idea so far, thanks very much for sharing.



Quote:
Originally Posted by onealpha View Post
The closer YTD correlation is to -1, the better for this system. -1 means that a perfect inverse correlation exists and the net profit/loss would always be near zero. I made a warning when the pairs drop/rise above a certain threshold... I think it was -.3 (but I could be wrong). This just means that things aren't so good with that currency. The EURUSD - USDCHF is always close to -.9. The GBPUSD USDCHF is supposed to be near -.84... but is not doing so well lately. When trading against the JPY pairs, it's always going to be low or even positive... which is no good for a hedge. However as risk goes up, so does O/N interest rates. It's simply a math thing and for the more mathematically inclined... it should give them a 'feel' for the risk and the probability of sucess with this system... it should not be over emphasized.
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 04-01-2008, 08:14 PM
Junior Member
 
Join Date: Mar 2008
Posts: 6
onealpha is on a distinguished road
Quote:
Originally Posted by Orest View Post
Onealpha, I'm forward testing with USD/JPY and results are promising so far. Probably need to establish another account with USD/CHF. Is USD/CHF your personal preference over JPY pair?

Do you have any historical results to share?
The code needs to be adjusted though, the "500" constant was too high for my grab profit level (profit level was calculated as $27,000 for $50,000 account probably because of the leverage level) , I think it needs to be set as parameter (or part of GrabProfit parameter).

Again, like the EA idea so far, thanks very much for sharing.
A made a bunch of forward tests back when I made this. I don't know if I still have them ... even if I could find them, times are much different now.

int gpf = (GrabProfitFactor * 2) + 500; //Calibrate this variable to suit your Broker's software

That is why I suggested that you started with tradeviewforex ... I actually wrote it on something called Strategy builder FX MT4 but they went under... when I recently decided to put out the source code... I quickly checked how it worked against a few different brokers. I never had the chance to debug it against other MT4 platforms. I calibrated that number based on 200:1, 10,000 balance, 100K lot sizes and a margin of 8-12 %. I didn't want to spend a whole lot of time on it. Take it from here... post your fixes... see what we can come up with. It still needs some work.
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 04-01-2008, 08:47 PM
Member
 
Join Date: Feb 2007
Posts: 87
BigBoppa is on a distinguished road
Hi onealpha!

Thank you for sharing your ea. I think, if we all work together and find and clear all bugs and make the ea easier to adapt to other accounts/leverage/..., then we will have a really great one. I have just begun to read through your code...

bbop

Last edited by BigBoppa; 04-01-2008 at 09:47 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 04-02-2008, 02:37 AM
Junior Member
 
Join Date: Mar 2008
Posts: 6
onealpha is on a distinguished road
MQ4 skills waining

Quote:
Originally Posted by BigBoppa View Post
Hi onealpha!

Thank you for sharing your ea. I think, if we all work together and find and clear all bugs and make the ea easier to adapt to other accounts/leverage/..., then we will have a really great one. I have just begun to read through your code...

bbop
It has been more than a year since I did that and I have been immersed in Actionscript 3.0/Javascript/Flash for the last few months. My memory fades... however, I will give some thought to it...hmmmm:

*First thing you need to know is: don't trust my comments. I never wrote this with anyone but 'me' in mind.

double iClose ( string symbol, int timeframe, int shift)

***[shift relative to the current bar the given amount of periods ago]

//average 5 min intervals times 36 intervals = 3 hours

for (int x1 = 0; x1 <= 36; x1++)
{
for (int x2 =1; x2 <=5; x2++)
{
eClose[x1] = eClose[x1] + iClose ("EURUSD",PERIOD_M1,x1*5+x2);
cClose[x1] = cClose[x1] + iClose ("USDCHF",PERIOD_M1,x1*5+x2);
gClose[x1] = gClose[x1] + iClose ("GBPUSD",PERIOD_M1,x1*5+x2);
jClose[x1] = jClose[x1] + iClose ("USDJPY",PERIOD_M1,x1*5+x2);
}
}

Hmmm.. I was trying to get a running average of the closing prices for each currency. I added (+=) the one minute average closing price (PERIOD_M1) to an array (xClose[1-36]) which is = to the sum of 5 of the one minute average closing prices. AHHHHHHHHHH !

Whatever.. it works.... whatever I did... I think.

I will stick to concepts rather than parse through MQL

The point of this was get a 3 hour average with a 1 minute resolution. I think if I used PERIOD_M5 or greater and less iterations, there was a loss of precision.

I only used this information in the display of the correlations. I tried to use this information in the logic that decides when to buy/sell orders and when to execute limit orders... but I think I took it out. The concept was to use this to look for large fluctuations: to protect from them or to find a way to use them for advantage.
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, hedge rocks, hedge expert advisor, hedge rocks ea, metatrader hedge, Hedge Rocks.mq4


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
expert advisor ? swirly Expert Advisors - Metatrader 4 4 09-22-2009 03:34 PM
RSI Expert Advisor TF2K Suggestions for Trading Systems 5 03-21-2009 05:24 PM
How to make an expert advisor run other expert advisors in MQL4 activetc Metatrader 4 0 08-30-2007 05:29 AM
rocks advisor 100% profit yossi1177 Expert Advisors - Metatrader 4 15 07-05-2007 03:08 AM
What Expert Advisor are they using? fikko Expert Advisors - Metatrader 4 4 07-01-2006 09:47 AM


All times are GMT. The time now is 09:35 AM.



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