particular Hedge-trading system

Discussion in 'Automated Trading' started by Alpha77, Mar 14, 2008.

  1. Alpha77


    I spent a good deal of time decoding this particular Hedge-trading system last year. I put it into the Expert Advisor and made some nice bells and whistles. Things never panned out with the person who I was doing this for… so… I never really did anything with it. I really spent a good deal of time on it so I don’t want it to go to waste. If anyone uses this particular system and wants to save 100 dollars a month… my little EA will do just that for you. I can explain how it works in my next few posts and see what interest there is. If there is enough I will post the EA and instructions.
    • tv2.jpg
      File size:
      137.7 KB
  2. LoneHand


    What does backtest look like?
  3. atonix


    I'm almost confidant that this is a Freedom Rocks EA. Hell, "Freedom" was blacked out, but "Rocks" is still there.

    I'm not sure if you're saying you wrote this, but if this is Freedom Rocks, you can save your money.
  4. Alpha77


    Ok, I took out the copy protection stuff and tried to organize things a little 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:

    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 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.


    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 the EA and instructions next.
  5. Alpha77


    Here it is:

    To answer your Questions:

    It does not backtest because it draws on historical data and data from other currencies, other than the chart it's on.

    Forward testing looks like any other system... depends on the time, day, month.
  6. With the information provided, you are telling ET that you have a system with no basis that it "HAS" worked.

    A more thorough explanation and details of your system would help you get more attention.

    At least, find a way to test your system...

    Or wait 2-3 years for the system to prove itself that it works...
  7. Alpha77


    I said that I mimicked an infamous/famous hedge-trading system. This particular system is out there, has been out there for years. They do have a devout, albeit fanatical, following. I have plenty of forward tests (ie letting the demo run for a period of time) which I will be happy to share. Attached is my most recent statement.

    Do a google search on Hedge-trading systems and the one I am referring to will come pouring out of browser.

    All I said about this was I attempted to mimic a popular hedge-trading system. I once again would like to distance myself from speaking to it's efficacy. FR charges you over 100 / month to use their system and they have armies of zealot-zombies pimping this thing everywhere.

  8. Alpha77


    This Expert Advisor is designed to run under the MetaTrader-4 Platform.

    It is a mathematical system which pits one currency pair against another inversely-correlative pair. It uses a very complex mathematical formula to determine the optimal ratios based on your account balance, margin percentage, size of the lots and the leverage you are using.

    The system emphasizes three things: Overnight interest, buy low, sell high and profit grabs.


    The short-term, overnight interest rates (or swap rates) are extremely high in Forex. When you leave your positions overnight you will accrue interest. If the currency pairs were perfectly correlated, the net gain/loss would be zero and you would accrue the high interest rates with no risk to your principle.


    The paradigm of buying low and selling high is a staple for all investing. This system sets Buy and Sell limits for each currency bought. Using a complex mathematical formula, the buy and sell limits, as well as the amount to purchase, are optimally set around each currency pair purchased. When the currency pair drops past the Buy Limit, the order is executed, that number of lots is bought and new limits are calculated and set around that price. Similarly, when the currency pair rises past the Sell Limit, an amount determined by the formula is sold short and new limits are calculated and set round the price. The EA monitors the progress of the limit orders once they have been executed into Buy or Sell orders. Just like the profit grabs and drawdown max, the limit orders wait for a particular profit or max loss to be realized. In addition, the program logic also monitors the average variations of the past few hours and calculates the best time to close the order for maximal gain or minimal loss. This algorithm also protects against wild swings in the currency and consequently avoids large losses in favor of modest gains.

    [SEE IMAGE 1]

    The idea of “profit grabs,” is simple: since no two currency groups are perfectly correlated, one pair will always lag behind or race ahead of the other. These fluctuations will show up as a net gain or net loss on the pair-group. Sometimes the group will “draw down,” such that the net loss dips down into your equity. Sometimes the group will swing positive and the net gain will add to your equity. A constant state of flux will always exist. The idea is to take the profit when it swings high enough to trigger a grab. Once grabbed, the pair-group is reallocated and the process starts again. Since hedging does not care at what value either of the currency pairs start at, there is no penalty for taking a profit grab and reallocating.

    [SEE IMAGE 2]

    In summary, the system is designed to hedge two, inversely correlative currency pairs against one another. If this group maintains a reasonable correlation, the position is left overnight to accrue interest. If this group fluctuates in the positive direction past a pre-determined cutoff, profits are taken and the group is reallocated. The whole while, buy limits are waiting for a currency pair to swing low, in order to buy lots or high in order to sell them.
  9. Nice work on the EA. Do you have to set it to each chart? Or Just to one chart and it runs all the pairs?

    Also I am going to run this on 100:1 leverage. what do I have to change to fit this?

  10. Alpha77


    You probably don't have to change anything... but depending on the Lot Size, Margin vs. balance you are working with, you might. I made a weblog of every answer I have given at and I probably have covered that question at some point. Experiment with the different values and get the Stops where you want them... let me know how it goes.
    #10     Apr 9, 2008