|
|
 |
|
01-30-2007, 01:23 PM
|
#1 (permalink)
|
|
Member
Join Date: Oct 2006
Location: Massachusetts, USA
Posts: 62
|
HedgeDCA
Started this thread to help with testing HedgeDCA. This EA concept was originally started in the MultiHedgeEA thread.
Quote:
Originally Posted by tomstaufer
This is similar to TimeFreedom strategy. I do it on a live 20k standard account with FXDD. Even though I use it with 2 pairs In my opinion the same system could improve both 2 and 4 pair EAs.
I will use IBFX margin requirements in my example becouse calculation is easier and more clear with them (FXDD calculates margin differently but pays better swap  ).
Starting balance: $10000
Risk: 20% (do not exceed 25% !)
Pairs: GBPJPY-long, CHFJPY-short, ratio 1:1
20% risk is 2000 USD - initial entry with 1.0 + 1.0 lots
1. "no sneak in": enter with 1.0 + 1.0 at once (20%), then enter 0.01 + 0.01 lots (1%) every day
2. "sneak in" : divide initial position into 5-20 chunks. Let's do 5:
Enter 0.2 + 0.2 lots every day within 5 days, after main set is completed start 0.01 + 0.01 lots daily.
If there is positive swing of min $300 per lot (swap not included) all orders are closed and cycle is restarted.
This system reduces your risk dramatically when market moves in non favorable direction. Also interest earned daily is reinvested. The power of compounded interest is shown in the attached calculator.
I do it live with FXDD: daily net swap over $20/1+1 lots, but margin required for 1.0+1.0 lots is ~1400+1400 USD. They do not support 0.01 lots so I have to do 0.1+0.1 every 10 days.
So lets say we have more than desired drawdown and we are waiting on it to recover a little bit. Why wait for a recycle that could in theory take forever! Instead what if we had another whole position placed at different levels of drawdown (undetermined at this time). It would still need to close with same equity profit target. but if it is moving hard we get out of the both of the trades a step before the original was going to and we catch the movement for a brand new trade.
rnhturner,
Your idea to average down actually works in practice !
|
Quote:
Originally Posted by rmyers
Hi Tom,
I was too tired to write more yesterday, but here is the description of how it works based on my interpretation of some of the posts from you guys on dollar cost averaging:
When started the EA will first check the SymbolnScaleIn boolean.
If it is true it will order SymbolnStartLots.
It will then add SymbolnLotSteps each day at HourToAddNewLots.
It will do this each day until SymbolnTargetLots is reached.
The default settings will start at .2 lots and add .2 lots each day at hour 23 until 1.0 lots have been ordered.
At that point, if UseDCA is true it will begin adding LotsToAddDaily at HourToAddNewLots.
If SymbolnScaleIn had been false, it would have ordered SymblnStartLots, and then gone on to add LotsToAddDaily at HourToAddNewLots if UseDCA was true.
So using the defaults:
Sunday - buy .2 lot of GBPJPY, sell .2 lot of CHFJPY
Tuesday- at hour 23 add another .2 lots to the GBPJPY orders
Wednesday- at hour 23 add another .2 lots to the GBPJPY orders
Thursday- at hour 23 add another .2 lots to the GBPJPY orders
Friday- at hour 23 add another .2 lots to the GBPJPY orders
Both pairs now have 1.0 lots ordered which equals the target lots.
Sunday - buy .01 lot of GBPJPY, sell .01 lot of CHFJPY
Monday- buy .01 lot of GBPJPY, sell .01 lot of CHFJPY
Tuesday- buy .01 lot of GBPJPY, sell .01 lot of CHFJPY
etc...
Was this what you guys were looking for or did I misinterpret you?
Rick
|
Quote:
Originally Posted by tomstaufer
Rick,
This is exactly the strategy I am using now.
Only difference With FXDD-you have to buy 0.1 every 10 days.
How to set this up with your EA ?
|
Quote:
Originally Posted by tomstaufer
Rick, I only buy/sell once per day or once every 10 days.
Let me explain:
Interest earnd every day (~17.00-21.00 USD if you hedge 1/1 lot JBPJPY/CHFJPY) allows you to add 0.01/0.01 lots every day.
You can do it with IBFX-no problem.
If you hedge with FXDD (pays higher swap) they do not allow to buy 0.01/0.01 daily becouse the smallest lot they support is 0.1. To buy 0.1/0.1 you need to collect interest for 10 days. So you wait 10 days buy 0.1/0.1, wait another 10 days buy 0.1/0.1, etc.....
That is why I would like to be able to set frequency for different period than daily.
I am sorry for confusion. I shouldn't say "daily" frequency in my previous post.
|
Quote:
Originally Posted by tomstaufer
Rick,
I am testing HedgeDCA on IBFX with default settings.
I opened 0.2/0.2 lots when I started yesterday. Today it added 0.01/0.01 lots - should be another 0.2/0.2 untill 1.0/1.0 lots is reached, then 0.01/0.01 daily.
|
TimeFreedom
__________________
"Believe none of what you hear and half of what you see."
Last edited by TimeFreedom; 07-17-2007 at 04:21 PM.
Reason: Added New Version of HedgeDCA
|
|
|
01-30-2007, 01:55 PM
|
#2 (permalink)
|
|
Member
Join Date: Oct 2006
Location: Massachusetts, USA
Posts: 62
|
Rick,
HedgeDCA closed hedge with +$6.58 on a $1,000.00 balance. Should have been $30.00? Don't think MM is working correctly.
My settings are default:
Symbol1=GBPJPY
UseSymbol1=1
Symbol1IsLong=1
Symbol1ScaleIn=1
Symbol1StartLots=0.20000000
Symbol1LotStep=0.20000000
Symbol1TargetLots=1.00000000
Symbol2=CHFJPY
UseSymbol2=1
Symbol2IsLong=0
Symbol2ScaleIn=1
Symbol2StartLots=0.20000000
Symbol2LotStep=0.20000000
Symbol2TargetLots=1.00000000
UseDCA=1
LotsToAddDaily=0.01000000
HourToAddNewLots=20
PercentTakeProfit=3.00000000
CloseAllOrdersNow=0
MagicNumber=8675309
Thanks in advance,
TimeFreedom
__________________
"Believe none of what you hear and half of what you see."
|
|
|
01-30-2007, 01:59 PM
|
#3 (permalink)
|
|
Member
Join Date: Nov 2006
Posts: 61
|
Hi Timefreedom,
Thanks for starting this thread. I put V2 on a forward test and it is doing fine for the past couple of days. Of course, the proof is in the pudding over time and my sample size is not yet statistically valid.
Let me know what changes you would like to see. The MM is minimal, to say the least.
I am freeing up a bit and will have time to devote to this soon. I still owe Tom a way to add his micro-lots on a n day schedule. I have figured out a way to do this and will give it a go shortly.
Rick
|
|
|
01-30-2007, 02:00 PM
|
#4 (permalink)
|
|
Member
Join Date: Nov 2006
Posts: 61
|
Quote:
Originally Posted by TimeFreedom
Rick,
HedgeDCA closed hedge with +$6.58 on a $1,000.00 balance. Should have been $30.00? Don't think MM is working correctly.
My settings are default:
Symbol1=GBPJPY
UseSymbol1=1
Symbol1IsLong=1
Symbol1ScaleIn=1
Symbol1StartLots=0.20000000
Symbol1LotStep=0.20000000
Symbol1TargetLots=1.00000000
Symbol2=CHFJPY
UseSymbol2=1
Symbol2IsLong=0
Symbol2ScaleIn=1
Symbol2StartLots=0.20000000
Symbol2LotStep=0.20000000
Symbol2TargetLots=1.00000000
UseDCA=1
LotsToAddDaily=0.01000000
HourToAddNewLots=20
PercentTakeProfit=3.00000000
CloseAllOrdersNow=0
MagicNumber=8675309
Thanks in advance,
TimeFreedom
|
I will look.
Rick
|
|
|
01-30-2007, 03:28 PM
|
#5 (permalink)
|
|
Member
Join Date: Nov 2006
Posts: 61
|
Hi TF,
I am forward testing this version to see if it fixes your problem. In addition, I am testing some code designed to make certain all orders close at the the correct profit limit.
Rick
|
|
|
01-30-2007, 03:34 PM
|
#6 (permalink)
|
|
Member
Join Date: Dec 2006
Posts: 47
|
HedgeDCA v2 test
Hi Rick, Timefreedom
Thank you for starting that thread.
I am testing with FXDD on $10000 starting balance.
One order closed so far for a profit of $89.62
Rick could you make a switch do disable PercetTakeProfit and add profit target per 1/1 lot in USD.
Example: if set to $300 and total orders are 0.6/0.6 then it will close for a profit of $180.
Another suggestion for future version is to add 2 more optional pairs to allow 2,3,4 pair trading.
Thank you
Tom
PS. I am asking for more pairs to try this (1WFX pays VERY good swap for GBPJPY):
http://www.goldenmoneytree.com/forum...opic.php?t=755
|
|
|
01-30-2007, 06:37 PM
|
#7 (permalink)
|
|
Member
Join Date: Nov 2006
Posts: 61
|
Quote:
Originally Posted by tomstaufer
Hi Rick, Timefreedom
Thank you for starting that thread.
I am testing with FXDD on $10000 starting balance.
One order closed so far for a profit of $89.62
Rick could you make a switch do disable PercetTakeProfit and add profit target per 1/1 lot in USD.
Example: if set to $300 and total orders are 0.6/0.6 then it will close for a profit of $180.
Another suggestion for future version is to add 2 more optional pairs to allow 2,3,4 pair trading.
Thank you
Tom
PS. I am asking for more pairs to try this (1WFX pays VERY good swap for GBPJPY):
http://www.goldenmoneytree.com/forum...opic.php?t=755
|
Hi Tom,
Are you using ratios to determine the lots or just going with 1:1? Do you need a ratio formula added?
I can easily give you more pairs.
I'm not entirely clear on the take profit method. Could you please give me a formula using unequal lots?
Rick
|
|
|
01-30-2007, 08:23 PM
|
#8 (permalink)
|
|
Member
Join Date: Oct 2006
Location: Massachusetts, USA
Posts: 62
|
Quote:
Originally Posted by TimeFreedom
Rick,
HedgeDCA closed hedge with +$6.58 on a $1,000.00 balance. Should have been $30.00? Don't think MM is working correctly.
My settings are default:
Symbol1=GBPJPY
UseSymbol1=1
Symbol1IsLong=1
Symbol1ScaleIn=1
Symbol1StartLots=0.20000000
Symbol1LotStep=0.20000000
Symbol1TargetLots=1.00000000
Symbol2=CHFJPY
UseSymbol2=1
Symbol2IsLong=0
Symbol2ScaleIn=1
Symbol2StartLots=0.20000000
Symbol2LotStep=0.20000000
Symbol2TargetLots=1.00000000
UseDCA=1
LotsToAddDaily=0.01000000
HourToAddNewLots=20
PercentTakeProfit=3.00000000
CloseAllOrdersNow=0
MagicNumber=8675309
Thanks in advance,
TimeFreedom
|
Rick,
I had two (2) hedges opened and I think HedgeDCA closed out only one of the hedges and left the other hedge opened once it reached 3% profit. From my understanding HedgeDCA should have closed both hedges which together reached 3% profit goal.
TimeFreedom
__________________
"Believe none of what you hear and half of what you see."
|
|
|
01-30-2007, 08:50 PM
|
#9 (permalink)
|
|
Member
Join Date: Nov 2006
Posts: 61
|
Quote:
Originally Posted by TimeFreedom
Rick,
I had two (2) hedges opened and I think HedgeDCA closed out only one of the hedges and left the other hedge opened once it reached 3% profit. From my understanding HedgeDCA should have closed both hedges which together reached 3% profit goal.
TimeFreedom
|
Hi TF,
Is this with the V2_1 version? Did the 3% work correctly, if it was?
I will look again at the code to try to determine why the close was not successful.
Rick
|
|
|
01-31-2007, 12:05 AM
|
#10 (permalink)
|
|
Member
Join Date: Oct 2006
Location: Massachusetts, USA
Posts: 62
|
Quote:
Originally Posted by rmyers
Hi TF,
Is this with the V2_1 version? Did the 3% work correctly, if it was?
I will look again at the code to try to determine why the close was not successful.
Rick
|
Rick,
The closure problem was with v2. I am forward testing your new v2.1 and hopefully we reach the 3% goal to verify that you corrected the problem.
TimeFreedom
__________________
"Believe none of what you hear and half of what you see."
|
|
|
 |
|
LinkBacks (?)
LinkBack to this Thread: http://www.forexforums.org/mt4-expert-advisors-factory/19463-hedgedca.html
|
| Posted By |
For |
Type |
Date |
| ForexForums.org |
This thread |
Refback |
05-04-2008 01:20 AM |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|