# HedgeHog System & EA - page 7

8

Smeden: Hey! good to hear from you again. I am not dead, just took some time away from Forex. Now, let's milk it!

Graham:

Check it out again:

http://xbot.ws/stats.aspx?name=Config_HEDGEHOG

It looks very interesting. However longer we trade the more we risk that you get a loosing streak that you can't handle. So I think we can't double the lots forever, there has to be some limit how far we go rather that blowing the whole account.

Also, the equity curve is linear that is great but, we need to compound it, so that it is exponencial and we can make some serious \$\$\$. So we need to increase lots as we have more and more profits. We really need to have fine control over the position size and good sizing algorithm for that.

To all of you guys: Keep up the good work!

8

One more thing....

Graham,

how do you calculate the sequence:

1 Lot 10TP: 1, 7, 42, 253, 1519

2 Lot 5TP: 2, 24, 266

?

Could you please do a break down of the calculation for me?

Also I think if we have a loss of only -20 pips we could dynamicaly adjust the size to a smaller amount since we don't need to cover the full 50 pips, right?

328

RobertVo:
One more thing....

Graham,

how do you calculate the sequence:

1 Lot 10TP: 1, 7, 42, 253, 1519

2 Lot 5TP: 2, 24, 266

?

Could you please do a break down of the calculation for me?

Also I think if we have a loss of only -20 pips we could dynamicaly adjust the size to a smaller amount since we don't need to cover the full 50 pips, right?

How i do my calculation is under the fact that the next lot size would not only have to replace any losses, but also include hopefully a gain as well to make it worthwhile.

So with the 1 lot 10TP we start with 1 lot. Keep in mind calculations are figured out on one side of trades, as the other side always closes in profit. That being said, on day 1 with a 10TP and 50 stop we want to earn 10pips. If we stop out we are -50 pips, so on day 2 we start with -60 net (difference from being +10 to -50), plus we want 10 more pips cuz we are in for revenue, so we place a trade with 7 lots, hence going from 1 to 7. Now if we end up a loss on day 2, we are now -60 from previous day, then -(7*50 or 350) for day 2, so now we need to generate (350+60+10) pips day 3 to cover day 1 and 2, plus generate revenue, hence 42 lots, etc...

with the 5TP50SL it gets steep quick due to the TP and SL being farther apart.

Hope that helps,

Graham

328

RobertVo:
Smeden: Hey! good to hear from you again. I am not dead, just took some time away from Forex. Now, let's milk it!

Graham:

Check it out again:

http://xbot.ws/stats.aspx?name=Config_HEDGEHOG

It looks very interesting. However longer we trade the more we risk that you get a loosing streak that you can't handle. So I think we can't double the lots forever, there has to be some limit how far we go rather that blowing the whole account.

Also, the equity curve is linear that is great but, we need to compound it, so that it is exponencial and we can make some serious \$\$\$. So we need to increase lots as we have more and more profits. We really need to have fine control over the position size and good sizing algorithm for that.

To all of you guys: Keep up the good work!

I am working on something to reduce losses and allow additional growth. I will present it in a few days.

Graham

242

Hey Sampson,

Any progress with this EA?

I am itching to test different currencies at different start times (when there is a lull in trading the pair).

Also we can tweak T/P levels and S/L levels.

Mike4X.

8

Thank you so much for the explanation.

I did a backtest from 2/17/2005 to 9/8/2005.

Trading mini account with starting balance \$10000.

It hits streak of 4 losses once and wipes out the account completely. See the picture.

It's a scary thought especially if you'd run this system for long time and would get comfortable with the stable constant profits , and one day you wake up and your account is zero or less...

What options do we have?

Files:
stats.png 10 kb
328

Ladies and Gentlemen, here is the introduction of what i call "The Third Trade". Now normally third-wheels don't work out so well, but i think with hedgehog it offers something that hasn't been presented yet. I also include stats and spreadsheets to back up my idea.

I will do my best to explain myself here, so read it carefully or several times to understand it instead of posting tons of questions in which the answers are below.

That being said, here we go.

The last few days we have realized that Hedgehog by itself can be a 100% mechanical system, not needing lagging indicators or human intervention. The reason it works, but also its main problem, is in the lot scaling due to martingale-style trades, but also in a way the Take Profit (TP) is a fraction of the StopLoss (SL) and not greater. Under normal trading, the successful traders generally want a TP to SL ratio to be above 1 at least, if not more, meaning their potential profit is greater than their potential loss. Unfortunately in hedgehog up to now the 10TP and 50SL is a ratio of 0.2 (10/50), 12TP/50SL or 0.24 for the EurJpy, and 15Tp/50SL or 0.3 for the GbpJpy. In the 5TP 50SL, the ratio is 0.1.

The only reason this system works is because of the tremendous accuracy of the trades backed by historical data, and the very low probabilities of back-to-back similar losses ( 2 or 3 or 4 consecutive buy losses, etc...). The actual probability percentages are posted earlier in this thread.

Also from here on in this post, plus in trades to do with the "Third Trade", the EurGbp won't be looked at, mainly because its trades don't close within 24 hours.

Ok, onto the idea. The other night when i was in bed i had an idea come to me. The idea was that most of our days both the buy and sell close in profit. Sure we always have either one of the sides close in profit, but a fair bit of the other trades close in profit as well. So what that means is that during the 24 hour period, the price will move from the initial purchase price, up to the TP of the buy, then down to the TP of the sell or vice versa Are you following me so far?

So the idea was this: What if we place 2 entry orders in addition to the standard hedgehog trades. A Sell Stop at the TP of the Buy and a Buy Stop at the Tp of the Sell. Now because the prices usually trend later on, once one of the entry orders kicks in, you simply delete the other pending order. Let me give an example (don't worry about spreads for the time being):

At either 22:00 or 00:00 GMT, the EurUsd is at 1.2000. We put in a buy with a TP 1.2010 and a stop at 1.1950. We also put in a sell with a TP at 1.1990 and a stop at 1.2050. So far this is what we have been doing. Now watch closely:

We now put in our entry sell stop at 1.2010. We use our initial sells S/l of 1.2050 and we use the sells TP of 1.1990 on the assumption that the price will drop back to 1.1990 because most of the time it does. We also place an entry buy stop at 1.1990 as well, and use our initial buys SL and TP levels as well.

So at 22:02 for the EurUsd we should have 4 trades total. 2 for the hedgehog and 2 for the "Third Trade".

Now eventually one of the initial hedgehog trades will TP, and that is when one of the entry orders gets kicked in, and also that is when we delete the pending entry on the other side.

If the currency moves the other way and kicks out both trades at the other TP, then we are 3 for 3.

Under the original 10TP system, we could earn a max of 20 pips. With the "Third Trade", we now can earn up to 40 total, twice as previously available for only an additional lot. Plus because when the entry order kicks in, it now has a 20 TP and only a 40 S/L (because the currency had moved 10 pips to kick out 1 hedgehog trade and kick in one "Third Trade"), thus now we are at a ratio of 0.5 instead of 0.2 as before. Because the ratio is that much better, the quantity of lots to recover from a loss is considerably less, so as a nice side effect the martingale lot scaling is far less severe and can handle many more continual losses, not that we want to though. There is however the same problem of cross losses as in buy/sell combo consecutive losses now because we are playing both sides. This was the problem with splitting the lots. However to compensate, the martingale is alot lower for the third trade due to higher TP/SL ratio.

I also analysed the eurjpy and gbpjpy as well. On those pairs, because the TP and SL are different, the ratios are different as well. They actually get better. I also noticed another good side effect as well with the Third Trade. That effect is this :

When you enter a trade, it immediately is negative the pip spread. So thus on FXDD EurUsd, our 10Tp is actually 12 pip movement. Now double that because of the simultaneous buy and sell, we have a total minimum movement window of 24 pips to cash both out in profit 2x10TP + 2x2pip spread. Now if we put in an entry order at the TP of our immediate trade and that trade kicks in, it immediately will be -2 for spread, but because the movement window is 24 pips total, less 2 for spread, we actually in reality have a TP value of 22 instead of the 20 i posted in my calculations. Consider this a nice bonus.

On the Eurjpy the spread on FXDD is 4, and on the GbpJpy it is 9. That means the movement window is 12 + 12 + 4 + 4 or 32 pips wide. Our entry order will not yield the 12*2 or 24, but rather 32 - 4pip spread, or 28. A bonus of 4. The gbpjpy movement window is 15 + 15 + 9 + 9 or 48 wide and the third trade will have an actual TP of 39 (48 - spread of 9), instead of the 30 we originally calculate. On the spreadsheet i calculate ratios based on 28/38 on the eurjpy and 39/35 for the gbpjpy. Moral of the story, we get a free pip spread with each Third trade

Now here is the neat thing. For the first time in hedgehog history, we actually have a TP to SL ratio greater that 1! Here is how:

When the GbpJpy gets it's hedgehog trade in, it is -9 on both the buy and sell due to spread. With a Tp of 15, the currency moves 24 to TP one side. Now if our initial SL is 50, our entry would be 50 SL - 24 pips worth of movement, so thus a 35 pip S/L (26+9 spread). At that point, the entry order will have to move 48 pips the other way now to TP. Now 48 - 9 spread is 39pip TP. So our ratio is 39TP/35SL or 1.1! That's alot better than 0.2 or 0.1 we were trying to make work before! Now true the gbpjpy isn't as accurate, but if the lots don't have to be factored up in multiples of 7 or 24, then this is alot better.

The Eurjpy ends up having TP/SL ratio of 0.74 as well.

Now on to forward trade calculations. I have been posting my results so far on the 22:00 and 00:00 GMT time frames, and also supplying my spreadsheets with results. I ahve included a revised spreadsheet. Under the 2200GMT and 00:00GMT, the blue section or top left contains the original hedgehog trades and their respective P/L.

The bottom left, or yellow section, has those same trades, but including the third trade.

For some pairs, the results are quite alot better, however some are similar.

On the "Martingale Lot Sizes" tab, i calculated some suggested lot sizes P/L and S/L values depending on how many losses are in a row.

Well, i hope you guys enjoy. I have enjoyed doing this. I also feel this "Third Trade" could be a seperate independant system as well, or can be used in conjunction with the original.

Now we need an EA to do this all 100% mechanical for us, then it would be golden.

Enjoy,

Graham

Files:
328

RobertVo:
Thank you so much for the explanation.

I did a backtest from 2/17/2005 to 9/8/2005.

Trading mini account with starting balance \$10000.

It hits streak of 4 losses once and wipes out the account completely. See the picture.

It's a scary thought especially if you'd run this system for long time and would get comfortable with the stable constant profits , and one day you wake up and your account is zero or less...

What options do we have?

Well this is still something i would like to deal with. One thought was to either let 2 consecutive losses go, or 3 consecutive losses go. Unfortunately Martingale trading locks us in because we want to make back our losses.

Or scale back the lots on the main hedgehog and scale up the lots on the "Third Trade", so we don't have to bet the farm 5 consecutive losses in a row later.

Also Money Management might help too, so we start small enough to scale up, but large enough to help us see growth.

Graham

242

Hi again Graham,

The third trade is easy to set up with an OCO order - you don't have to manually close the un-triggered order.

I know I mentioned spread before but I still think you have it wrong. For example, when you take a sell at 1.2000 then you can not set the Take Profit at 1.1990. The reason? You are using the bid price and you need the offer price to buy back the sell trade. So you have to set the TP level at 1.1987 to earn 10 pips net profit.

Now I don't want to sound negative about the next point because I think this system still has potential, but I have manually logged each day since July last year and it seems to me that the last month was particularly good.

First of all, yes with the third trade you can get 40 pips when everything works. But... on a day when price goes from 1.2000 to 1.2010 the following happens - you get your first 10 pips profit and the third trade kicks in short. Then price continues up and at 1.2050 the original sell trade stops out for minus 50 and also the new third trade stops out for minus 40. Result for the day is minus 80 pips.

Now you may say that you can recover this with the Martingale system and double day losses are rare?

Check this out. Eur/Jpy 22.00 hrs GMT broker Alpari and even using your own TP of 10 in case you don't agree with my point on spread.

10th November 2005 (Thursday) - price went straight up from open and stopped out.

11th November 2005 (Friday) - price rose 3 pips from open then dropped like a stone and stopped out.

14th November 2005 (Monday) - another stop out.

15th November 2005 (Tuesday) - straight up to stop out.

16th November 2005 (Wednesday) - straight up to stop out.

That's five consecutive losers all at minus 80 pips.

We still need to keep testing. There is a good system in here somewhere but I don't think that the third trade version is it.

I am currently testing different currencies and time frames with just a 20 pip SL and no Martingdale. I think that route is too risky. If hedgehog has a losing day then I reckon just take the loss and carry on. There is no need to recover the loss and double stakes - as long as the win/loss ratio is good just take the loss on the chin and carry on.

Anyway, the testing continues.

Mike4X.

328

mike4X:
Hi again Graham,

The third trade is easy to set up with an OCO order - you don't have to manually close the un-triggered order.

I know I mentioned spread before but I still think you have it wrong. For example, when you take a sell at 1.2000 then you can not set the Take Profit at 1.1990. The reason? You are using the bid price and you need the offer price to buy back the sell trade. So you have to set the TP level at 1.1987 to earn 10 pips net profit.

You are correct and always have been correct. In that example i kept it simple to describe the proof of concept, but in reality on FXDD with 2 pip spread, the real movement window from 1.2000 entry is 1.2012 (10+2) and 1.1988 (10+2), thus the 24 pip total minimum movement. The 3rd trade would therefore be 24 - 2 spread, so 22 TP instead of the 20 posted. Other brokerage spreads will of course change the price levels farther still.

mike4x:

Now I don't want to sound negative about the next point because I think this system still has potential, but I have manually logged each day since July last year and it seems to me that the last month was particularly good.

First of all, yes with the third trade you can get 40 pips when everything works. But... on a day when price goes from 1.2000 to 1.2010 the following happens - you get your first 10 pips profit and the third trade kicks in short. Then price continues up and at 1.2050 the original sell trade stops out for minus 50 and also the new third trade stops out for minus 40. Result for the day is minus 80 pips.

Now you may say that you can recover this with the Martingale system and double day losses are rare?

Check this out. Eur/Jpy 22.00 hrs GMT broker Alpari and even using your own TP of 10 in case you don't agree with my point on spread.

10th November 2005 (Thursday) - price went straight up from open and stopped out.

11th November 2005 (Friday) - price rose 3 pips from open then dropped like a stone and stopped out.

14th November 2005 (Monday) - another stop out.

15th November 2005 (Tuesday) - straight up to stop out.

16th November 2005 (Wednesday) - straight up to stop out.

That's five consecutive losers all at minus 80 pips.

We still need to keep testing. There is a good system in here somewhere but I don't think that the third trade version is it.

I am currently testing different currencies and time frames with just a 20 pip SL and no Martingdale. I think that route is too risky. If hedgehog has a losing day then I reckon just take the loss and carry on. There is no need to recover the loss and double stakes - as long as the win/loss ratio is good just take the loss on the chin and carry on.

Anyway, the testing continues.

Mike4X.

You might be right. The problem with backtesting is that there are several feeds out there, if we use 15 minute increments, there are 96 15-min time slots every day in which to do hedgehog, there are 6 pairs i think it runs best on, and possibly 2 more.

Forward testing will for sure be ultimately be the true test of the system. In my spreadsheet i have kept track of the trades thus far, however i am in no way advocating that 2 weeks is long enough for this system.

At least a properly designed EA would shed light to holes or flaws in this system.

Thanx,

Graham