|
|
 |
|
01-07-2007, 06:03 PM
|
#1 (permalink)
|
|
Administrator
Join Date: Sep 2006
Location: Portugal
Posts: 507
|
MultiHedgeEA
Ok this is the thread to begin working on the new MultiHegdeEA. There are a sugestion for the creation of a 4 pair HedgeEA, so let keep this separated from the main HegdeEA thread.
If you have any information about this system please post here. I will begin coding a simple EA that just enter the market with the 4 pairs and monitor this positions.
|
|
|
01-07-2007, 06:50 PM
|
#2 (permalink)
|
|
Administrator
Join Date: Sep 2006
Location: Portugal
Posts: 507
|
I've coded the first stage of the EA, but now I need to understand how it will use ratios to calculate Lotsizes.
And about swap? what to do with swap? include swap on accouting or just leave it alone?
|
|
|
01-07-2007, 07:43 PM
|
#3 (permalink)
|
|
Junior Member
Join Date: Dec 2006
Location: Ottawa, Canada
Posts: 15
|
SWAP
Kokas,
First off, great to hear about the initiation of the new Multihedge EA. I think that using four pairs will dramatically reduce the volatility of the total P/L.
I think swap needs to be included in the "accounting", as it will be the main income generator until/if a grid-type system or other secondary postion entry system is initiated.
Regarding ratios, can't we simply use the same general logic as Stevensign suggested in Forex-tsd? The only thing I would add is that we'd want all four pairs to have the approximate USD value (then fudge for volatility).
My two cents at the moment.
Doug
|
|
|
01-07-2007, 08:05 PM
|
#4 (permalink)
|
|
Administrator
Join Date: Sep 2006
Location: Portugal
Posts: 507
|
Ok, I understand your idea, but, the ratios on HedgeEA are calculated comparing the two currencies.
And correlation is not used to do this. Acording to the sugestion of forexmentor, we need to use correlation to calculate the ratios. Maybe we can add Steven sugestions to this but this is not clear on my head for now
I'm waiting for the market to open so I can test the EA as is to post it.
For now we have to add the ratios manually. When someone explain how this ratios are calculated we could add this funtion to the EA.
|
|
|
01-07-2007, 09:22 PM
|
#5 (permalink)
|
|
Junior Member
Join Date: Dec 2006
Location: Ottawa, Canada
Posts: 15
|
Quote:
Originally Posted by kokas
Ok, I understand your idea, but, the ratios on HedgeEA are calculated comparing the two currencies.
And correlation is not used to do this. Acording to the sugestion of forexmentor, we need to use correlation to calculate the ratios. Maybe we can add Steven sugestions to this but this is not clear on my head for now
I'm waiting for the market to open so I can test the EA as is to post it.
For now we have to add the ratios manually. When someone explain how this ratios are calculated we could add this funtion to the EA.
|
Just making a few "leaps" here ...
Let's assume we have a USD $4,000 account using 1:100 leverage. If we wanted to risk 10% of the account, that would be $400. Therefore, we'd want to apply roughly $100 to each of the four currency pairs. Lets assume we're looking at EURUSD, USDCHF, GBPUSD and USDJPY. For the two USD base currency pairs, the calculation is easy ($100 x 100 leverage = $10,000, or 10 micro-pips). For the other two currency pairs, it's almost as easy. Let's look at EURUSD for example. The current bid is around 1.30 (US$1.30 for each euro). The inverse of this is EUR$0.77 euro's for each USD. Since we want to open a position with an equivalent value of USD$10,000, we would multiply 0.77 times $10,000, which would give us a value of about EUR$7,700, or approximately 8 micro-lots. We would do the same with the GBPUSD, which would yield an initial position size of 5 micro-lots.
I think this would give us an approximately equal opening position size for all four currency pairs. Nobody will hurt my feelings if I'm off base here, but it seems logical to me...
Doug
|
|
|
01-07-2007, 09:48 PM
|
#6 (permalink)
|
|
Administrator
Join Date: Sep 2006
Location: Portugal
Posts: 507
|
we could try this way. But I do not believe that this is the method that forexmentor is talking. It is too simple ... 
|
|
|
01-07-2007, 09:55 PM
|
#7 (permalink)
|
|
Administrator
Join Date: Sep 2006
Location: Portugal
Posts: 507
|
Multi Correlation Coeficient
Ok, I think that we need to use something like this to analise the correlation between more than two pairs...
Last edited by kokas; 01-07-2007 at 10:10 PM.
|
|
|
01-07-2007, 10:04 PM
|
#8 (permalink)
|
|
Junior Member
Join Date: Dec 2006
Location: Ottawa, Canada
Posts: 15
|
Quote:
Originally Posted by kokas
Ok, I think that we need to use something like this to analise the correlation between more than two pairs...
|
You might be right about my suggestion, but just because it's simple isn't necessarily a bad thing. Keep in mind, my calculation have nothing to do with the correlation per se, they were just meant to be used to purchase an equal position of each pair in the hedge.
Doug
PS. Thanks for the article on correlation.
|
|
|
01-07-2007, 10:08 PM
|
#9 (permalink)
|
|
Administrator
Join Date: Sep 2006
Location: Portugal
Posts: 507
|
lol I do not mean that it is a bad sugestion!
I only mean that this was not what forexmentor sugested. I'm completly off this strategy with 4 currencies.
But I can code that as you sugest as a first approach.

|
|
|
01-07-2007, 10:48 PM
|
#10 (permalink)
|
|
Administrator
Join Date: Sep 2006
Location: Portugal
Posts: 507
|
I've code the AutoRatio function the following way:
if (UseAutoRatio) {
double Symbol1_Range= (iMA(Symbol1,0,SMA_Value_for_Range,0,MODE_SMA,PRIC E_HIGH,0)-iMA(Symbol1,0,SMA_Value_for_Range,0,MODE_SMA,PRICE _LOW,0))/MarketInfo(Symbol1,MODE_POINT);
double Symbol2_Range= (iMA(Symbol2,0,SMA_Value_for_Range,0,MODE_SMA,PRIC E_HIGH,0)-iMA(Symbol2,0,SMA_Value_for_Range,0,MODE_SMA,PRICE _LOW,0))/MarketInfo(Symbol2,MODE_POINT);
double Symbol3_Range= (iMA(Symbol3,0,SMA_Value_for_Range,0,MODE_SMA,PRIC E_HIGH,0)-iMA(Symbol3,0,SMA_Value_for_Range,0,MODE_SMA,PRICE _LOW,0))/MarketInfo(Symbol3,MODE_POINT);
double Symbol4_Range= (iMA(Symbol4,0,SMA_Value_for_Range,0,MODE_SMA,PRIC E_HIGH,0)-iMA(Symbol4,0,SMA_Value_for_Range,0,MODE_SMA,PRICE _LOW,0))/MarketInfo(Symbol4,MODE_POINT);
double TotalRange = Symbol1_Range + Symbol2_Range + Symbol3_Range + Symbol4_Range;
Ratio1 = (1 / PipCost(Symbol1))* Symbol1_Range / TotalRange;
Ratio2 = (1 / PipCost(Symbol2))* Symbol2_Range / TotalRange;
Ratio3 = (1 / PipCost(Symbol3))* Symbol3_Range / TotalRange;
Ratio4 = (1 / PipCost(Symbol4))* Symbol4_Range / TotalRange;
}
The idea is to calculate each ratio giving More importance to More volatile currencys. I'm not sure for this as I believe that should be the oposite. But it is a start.
|
|
|
 |
|
|
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
|
|
|
|
|
|