| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
|
|||
|
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. |
|
|||
|
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.
|
|
|||
|
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$.
__________________
"Quantity of intelligence on planet is constant. Only population grow." |
|
|||
|
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 |
|
|||
|
YTD correlation
Quote:
|
|
|||
|
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:
|
|
|||
|
Quote:
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. |
|
|||
|
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. |
|
|||
|
MQ4 skills waining
Quote:
*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. |
![]() |
| Bookmarks |
| Tags |
| hedge, hedge rocks, hedge expert advisor, hedge rocks ea |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/expert-advisors-metatrader-4/13049-hedge-rocks-expert-advisor-mt4.html
|
||||
| Posted By | For | Type | Date | |
| Système Hedge + Rollover - Page 2 - Forum Eole Trading Ltd | This thread | Refback | 04-20-2008 04:14 PM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |
| RSI Expert Advisor | TF2K | Suggestions for Trading Systems | 4 | 03-21-2007 01:52 PM |
| expert advisor ? | swirly | Expert Advisors - Metatrader 4 | 3 | 08-30-2006 08:04 AM |
| What Expert Advisor are they using? | fikko | Expert Advisors - Metatrader 4 | 4 | 07-01-2006 09:47 AM |