Forex
Google
New signals service!

Go Back   Forex Trading > Trading systems > Martingale/Average Cost and Hedging


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

Reply
 
LinkBack (2) Thread Tools Display Modes
  #11 (permalink)  
Old 04-25-2006, 12:38 AM
Member
 
Join Date: Apr 2006
Posts: 46
sampson is on a distinguished road
You're doing some great work, it's very interesting. Martingaling isn't something I'm a huge fan of, but it does seem like it's worthwhile in this type of system, and the pitfalls of using it differ from that of other types of systems.

Quote:
Originally Posted by gkozlyk
You guys are correct with your corrections. To use historical numbers back to 1989, the 80% would be closer to 90%, but lets use 85% just for kicks.

Gain: 85 * 10 actual TP = 850
Loss 15 * 50 = 750 loss

So on basics after spreads, there is a net profit, though not much.

However the key with this system is the fact that lot sizes don't stay linear. They use something called Martingale (sp?), or in laymans terms, lot scaling based on probabilities... let me explain...

With this type of hedging and a 10 TP and a 50 S/L, you always cash one side out in profit, so right away you have only a 40 S/L worth of exposure. That being said, the loss number above actually lowers to 15* 40 or 600.

Also because there is that 80-90% accuracy, you increase your next lot size the next day to replace the last trade. With such a high accuracy, the odds of 2 day of simultaneous losses in the same direction becomes 15% * 15% or 2.25% for the second day. It is like the probability of flipping a coin and getting 2 heads in a row (50% * 50% = 25%). If the trade still went 2 days losses, then the odds of 3 straight days becomes 15% * 15% * 15% = 0.34%...and so on...

That is why one needs to consider this system not just on the classical things like Stops and Limits, but the mathematics of probabilities based on historical analysis.

Just as a point of interest, currently i am running 2 tradestations on 7 pairs at 2 timeframes, and both timeframes are yielding around 85% accuracy each, thus confirming the historical stats.

Thanx,

Graham
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 04-25-2006, 12:40 AM
gkozlyk's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 202
gkozlyk is on a distinguished road
Quote:
Originally Posted by sampson
You're doing some great work, it's very interesting. Martingaling isn't something I'm a huge fan of, but it does seem like it's worthwhile in this type of system, and the pitfalls of using it differ from that of other types of systems.
Thank you. I would like to get some competant (sp?) programmers on this to edit up the MQ4 code so we can do some backtesting. Not too sure how to program in the martingale component, but if that were possible, i think we have something really good.

Thanx,

Graham
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 04-25-2006, 12:48 AM
Member
 
Join Date: Apr 2006
Posts: 46
sampson is on a distinguished road
Quote:
Originally Posted by gkozlyk
Thank you. I would like to get some competant (sp?) programmers on this to edit up the MQ4 code so we can do some backtesting. Not too sure how to program in the martingale component, but if that were possible, i think we have something really good.

Thanx,

Graham
I'll have a go at it, just want to double check the rules:

If a trade is open for more then 2 days, it's closed, correct? Is this considered a loss when it comes to the martingale component? Or is it only a loss if it hits the stoploss?

Anything else I should know?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 04-25-2006, 12:55 AM
gkozlyk's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 202
gkozlyk is on a distinguished road
Quote:
Originally Posted by sampson
I'll have a go at it, just want to double check the rules:

If a trade is open for more then 2 days, it's closed, correct? Is this considered a loss when it comes to the martingale component? Or is it only a loss if it hits the stoploss?

Anything else I should know?
Under the original rules, the trades were closed at the end of the day. The multiplier for martingale rules would be something like this:

New Lot size = +(net loss / 10 ) +1, so if first round lot size is 1 and it got closed at -34, then it would be 3.4 + 1 or 4.4 for the second round trade on the side of the loss.

So far the only trade i have seen last a whole day or longer is the EurGbp as it isn't that fast of a mover. I have no problem letting this one run, and to keep adding in trades for this one. Yesterday i had 3 EurGbp trades left over from last week cash out in profit today, so they seem to work out too, just not as fast as the other pairs.

Hope that helps,

Graham
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 04-25-2006, 02:27 AM
Member
 
Join Date: Mar 2006
Posts: 82
mike4X is on a distinguished road
Nice work Graham.
Looks very promising on first look.
Having 4 currency pairs at the same time will be a winner. In effect you get 8 trades runnning (2 each pair) and even if one of the pairs doesn't make a T/P you still make a profit (7 winners = 70 pips, 1 loser = 50 pips).
Say you pick the best 4 pairs. The statistics say that there is a 15% chance of a loser. So roughly you would get 1 losing trade every other day. So the above 20 pip profit day would be followed by an 80 pip profit day. Plus of course you can double the lots on the currency pair that lost.
Hell, even if you get 1 loss a day and double up that losing pair the next day you would end up with a tidy profit.
Can't wait for Sampson to code a working EA.
Mike4X.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 04-25-2006, 05:48 AM
gkozlyk's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 202
gkozlyk is on a distinguished road
Quote:
Originally Posted by mike4X
Nice work Graham.
Looks very promising on first look.
Having 4 currency pairs at the same time will be a winner. In effect you get 8 trades runnning (2 each pair) and even if one of the pairs doesn't make a T/P you still make a profit (7 winners = 70 pips, 1 loser = 50 pips).
Say you pick the best 4 pairs. The statistics say that there is a 15% chance of a loser. So roughly you would get 1 losing trade every other day. So the above 20 pip profit day would be followed by an 80 pip profit day. Plus of course you can double the lots on the currency pair that lost.
Hell, even if you get 1 loss a day and double up that losing pair the next day you would end up with a tidy profit.
Can't wait for Sampson to code a working EA.
Mike4X.
I posted on the original thread something i thought up on about Money Management, as it was brought up on there about "How do we possibly trade something like this?"

At any rate, here is the post i did on there"
Well, if we played the scenario of money management with Hedgehog, lets start with some numbers:

Money Management

With $10000, 5% would put us at $500, so mini lots are $50 so 10 mini lots would be 5% with $10000... Now with hedging, i would only calculate the worst side, seeing at 1 side always cashes out in profit. My logic would be to calculate it on the second level as well too where the first lost. Last week of trading on the major 7 pairs, out of 5 days and 2 timeframes (so over 130 total trades), i so far have had only 1 that was wrong twice in a row). By also keeping it to 5% that also gives us wiggle room for running a 3rd level once in a while when a trade is wrong twice in a row. My results seem that it is rare for the major pairs.

So based on that, and an average 6x size for round 2, and give maybe 4 wrong together at the same time, that would lead a total of 7lots first round, and 27 second round. 27 / 10 would be .37 base size for first round trades, and 2.59 for second round.

Using those numbers and my results last week my $5100 00:00GMt results would have net'd $190 Real dollars using .37 mini lots (these are the mini lots normally worth $1 / pip).

Now keep in mind, it isn't the first round that is using the 5%, cuz it is only using around 1.3%. It is the Martingale trades on second level. Also all my calculations are based on using the .37 lots for a 10TP. With MoneyQuests 5TP running 2 lots, you would have to double your lots to have the same profit, or my lot number for 1/2 the profit (because the TP is half). So my $190 example would actually be $95 using the 5TP using the same Money Management equation.

An idea to increase yield is to run higher lots on the trades with a better % success rate (proven over time and testing), like the EurJpy in my test. With it 18/18 last week, i would think it a better trade pair than say the eur/gbp which still has 5 open trades.

-------

Ok, so there ya go, that way the question on money management is out in the open as well.

Enjoy,

Graham
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 04-25-2006, 01:45 PM
gkozlyk's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 202
gkozlyk is on a distinguished road
Thought i would post an update for Monday's Trades:

22:00 had 2 first level losses, however still earned $892.84 for overall P/L of $7866. Losses were a buy on the GbpUsd and a buy on the GbpJpy. Today i will do a level 2 trade on both of those on the buy side. Overall system accuracy so far is 70/82 or 85.37% for this time frame.

00:00 as well had 2 first level losses, however still earned $271.90 for overall P/L of $7619. The losses were on a buy on the eurjpy and gbpjpy, so thus will have level 2 trades on buys today. Overall accuracy is 77 / 91 = 84.62%

Enjoy,

Graham
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 04-25-2006, 04:33 PM
Member
 
Join Date: Apr 2006
Posts: 46
sampson is on a distinguished road
I probably won't have time to make up the EA until tomorrow, so if anyone wants to take a shot at it in the mean time feel free.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19 (permalink)  
Old 04-25-2006, 05:00 PM
gkozlyk's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 202
gkozlyk is on a distinguished road
Quote:
Originally Posted by sampson
I probably won't have time to make up the EA until tomorrow, so if anyone wants to take a shot at it in the mean time feel free.
Hey no problem. I don't think we really expected any immediate results. I wll post here the different versions that have been done and what the improvements are, so that way you don't have to re-invent the wheel.

Graham
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20 (permalink)  
Old 04-25-2006, 05:45 PM
gkozlyk's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 202
gkozlyk is on a distinguished road
OK, here are the EA's from the original thread and settings/what they do. Now i was not part of the original process, however I would like to see an EA created that executes trades just like i have been doing manually with great success. For more info, answer to specific EA questions, and all credit due, goes to the original thread on post #1 of this thread. Support for these EAs are for resource purposes only, but are not supported or maintained here, only used as a reference. Below i post the EA name, post # and the blurb on that post. Enclosed is a .zip of all the EAs.

On to the EAs:

------------------- HedgeTest.mq4 --- post #2
http://www.strategybuilderfx.com/for...55&postcount=2
Attached is an indicator which you can use to visually see how it would look on a chart.
If the RED or BLUE line is broken through by a tick it means the BUY/SELL LIMIT was reached. I use a 1 hour chart to view it on.

Variables:
Offset=14; - Number of pips above/below days open price
TimeZoneOfData=0; - by default if time zone of data is at GMT 0 (timezone of your trading account

------------------- HedgeHog 1.0.mq4 --- post #40
http://www.strategybuilderfx.com/for...5&postcount=40
DO NOT USE THIS EA IN LIVE OR DEMO TRADING - IT IS NOT WORKING YET!!!
I have attached a "rough draft" of an EA and the MAJOR problem I'm having at the moment is getting it to initiate a trade at 00:00 GMT
1) It is picking and choosing what days it wants to trade and not doing it every day at 00:00 GMT
2) Is not entering both a BUY and a SELL
Any of you programers out there - help would be appreciated!!!!
Here is the routine that works when it wants to (testing dates 1/2/06 through 1/31/06 with 15min data)
if (TimeHour(Time[0])==0+BrokerOffsetToGMT && TimeMinute(Time[0])==0)
{
EnterSell();
EnterBuy();
}
------------------- HedgeHog.mq4 --- post #82
http://www.strategybuilderfx.com/for...5&postcount=82
There is the EA. But backtesting doesn't seem to be profitable.

------------------- HedgeHog v1.1.mq4 --- post #88
http://www.strategybuilderfx.com/for...5&postcount=88
There is original EA with implemented stoploss.
***Now this is the one that i found has the best performance, as it is purely the hedge trader with stoploss ***

------------------- HedgeHogUltra v1.1.mq4 --- post #95
http://www.strategybuilderfx.com/for...5&postcount=95
There is EA for your ULTRA strategy. I used stop orders instead market. There are 2 opportunities to close opposite order when one is triggered. You can choose PO_mode:
0 - close when opposite is actived
1 - close at 23:55
There is no adjustment for different broker settings of time, so if you use it on the platform with another time than GMT, you have to change time settings.

***Based on Strategy found on post #87. This trader uses the Ultra Strategy, which doesn't do initial hedge, but rather bracket style trading (entry buy stop and sell stop). Good idea, but maybe as an option for the future. ***

------------------- HedgeHog_v1.3.mq4 --- post #104
http://www.strategybuilderfx.com/for...&postcount=104
Initiates market orders (not pending) at the time specified under the EA's properties.

CHANGES:

It only initiates 1 trade at the specified time. It uses a 5M Parabolic SAR to determine the direction which to place the trade (BUY/SELL). This at least gives us a fighting chance of being right.

Trailing Stop: This not only helps on trades going our way, but can reduce the STOP LOSS we end up being stuck with.

Settings:
StartHr=0; // Start hour to initiate trade
StartMin=30; // Start minute to initiate trade
StopLoss=75;
TakeProfit=20;
Lots=1;
DaysOfClose=2; // how many days before closing open orders
TS_Mode=1; // use trailing stop 0=NO 1=YES 2=TS Only
TS_Trigger=5;
TS_Sensitivity=5;

*** This one executes 1 trade based on PSar, so not a hedge system anymore. That is why i stuck with v1.1 ***

-----------------------
I hope that helps our cause. And lastly, as i was trolling the other thread for info, i found MoneyQuest's results on the Eur/Usd for Feb and March. Here are the stats, the trading log is enclosed under "Hedge Hog Trading Results.zip".
Original post is here: http://www.strategybuilderfx.com/for...&postcount=234
Here is a summary of his results:

No of wins:22
No of losses:5
% win:81.5
Total profit:700 pips
Total losses:192 pips
Profit factor:3.65
Max No of consecutive win:8
Max No of consecutive losses:1
Maximum drawdown:90 pips
Maximum lots traded:6

His results do confirm the same results i have been getting as well. So i hope you guys enjoy the data
Attached Files
File Type: zip hedge hog trading result.zip (6.3 KB, 316 views)
File Type: zip Hedgehog EAs.zip (8.0 KB, 351 views)

Last edited by gkozlyk; 04-25-2006 at 06:02 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
forex, hedgehog ea

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/martingale-average-cost-hedging/1826-hedgehog-system-ea.html
Posted By For Type Date
OANDA FXMessage: Virtual no brainer trades...know any? This thread Refback 10-05-2007 08:19 AM
Forex trading strategies - Page 9 - Talkgold HYIP, Investment & Money Forum This thread Refback 07-09-2007 12:47 PM


All times are GMT. The time now is 08:40 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.