Home > Forex > Hedging the GridBot

Hedging the GridBot

June 20th, 2009

I was a bit bummed after sacking the GridBot from my live account this Thursday. The reason of course is that it once again hit the Safety net, losing me money. But since it really makes money when the market conditions are good I felt that it was time to try to write my own hedging EA to help GridBot out a little. So I did. Of course I don’t know if it will make me money in the long run, but at least it will reduce the risk of huge draw downs.

Basically what I have written is a EA that monitors all open trades in a currency pair and calculates the running profit/loss. If this running profit goes under a defined threshold value my EA opens a inverse hedge order in the pair, the size of the open orders. It then continues to monitor the price and closes the hedge order if the market reverses back into the grid. When to close the hedge is also definable of course.


In the picture the AutoHedge EA (silly name I know…) monitors AUDNZD, GBPJPY, USDJPY, EURJPY and EURUSD orders made by the GridBot. It is currently hedging AUDNZD because the running profit there is worse than -100. With the cost of opening the hedge the loss is now locked in at -136 (AUDNZD has huge 20 pips of spread making it expensive to hedge). If the running profit of the GridBots orders improve to -75 EUR the hedge would be closed with this configuration.

So what does this cost? Well if the market never returns to the exit threshold the hedge order have a cost of the spread. If it does return it costs the spread and the difference between entry and exit. I feel that this value is the one that will be difficult to set. Too small we may be whipsawed into opening several hedge orders during one session (expensive with the spreads of some pairs), too big we just pay to much for the hedge, taking away profit from the GridBots orders.

Pairs with tighter spreads will be much better for this function as the hedge won’t cost as much, so I think I will primarily test it on USDJPY, EURJPY and EURUSD with Alpari UK demo. I will also open a demo with Forex.com UK.

So as I said, I don’t know that this will save money in the long run, only that it will effectively limit the huge draw downs with the GridBot. Instead of hitting that Safety net of $500 one could have been hedged at a $100 loss, with the possibility of the market to reverse and making a small profit (closing the GridBot orders with profit butĀ  paying for the hedge).

I am thinking about hedging every order individually with a inverse order and use the OrderCloseBy() function instead in combination with the corresponding GridBot order (this saves one spread) if the market doesn’t return and the GridBot is about to close the orders (I would then jump the gun and close them say 1 minute before EndHours). But that would close the GridBot order, with the current implementation the GridBot isn’t affected at all by the hedge orders. Also I know that theĀ  GridBot developers are working on a real hedge implementation in their EA (can’t wait for it). This is just a substitute for the Safety net feature, not a real hedged grid trading strategy. But I’ve been meaning to check out writing some MQL4 for some time, so I saw this as a opportunity. Perhaps it will evolve into a stand alone grid trading EA also, I am quite tempted to just write it all myself… :)

Oh, and yes, I have been tempted to let the hedge order be open after the GridBot closes its orders, with a gliding take-profit. If the trend is good this could make some money, but it really isn’t the whole point here, so I won’t implement it like that right now.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • MySpace
  • StumbleUpon
  • Technorati
  • TwitThis
  1. John Drew
    September 17th, 2009 at 20:48 | #1

    Hi Friends, I have lost count of the EAs that I have bought and tried, in spite of the many promises etc in the blurb for each one, I have yet to find one to make any money, I have devised a program myself that works, have proved this to a degree by operating it manually, this is not feasible of course, and I am not computer literate enough to develope the program, if anyone capable of developing is interested in a joint project I would like to hear from them.

  1. No trackbacks yet.
Comments are closed.