Ok, I took out the copy protection stuff and tried to organize things a little before I post it. Almost ready! BTW I have a real job which I have to tend to occasionally so, I am doing this as fast as I can (to the more impatient of you).
Before I post my EA: 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:
-
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.
-
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.
-
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.
-
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:
-
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.
-
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 the EA and instructions next.
[QUOTE=alphaone;42135]