Home About Contact
ForexForums.org




Reply
Old 10-10-2006, 03:56 PM   3 links from elsewhere to this Post. Click to view. #1 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
HedgeEA

Ok this is the first EA to be developed here.

All versions since begin will be posted on diferent posts with a little resume attach.

This first version was a earlier version with SWAP included on profits.

On this post you have the correlation indicator to be used to this EA.

************************************************** **
Last version (6.6) of the EA here:
ForexForums.org - View Single Post - HedgeEA

************************************************** **
Attached Files
File Type: mq4 Correlation.mq4 (3.2 KB, 365 views)
File Type: mq4 HedgeEA.mq4 (9.3 KB, 230 views)

Last edited by kokas; 07-31-2008 at 06:08 PM.
kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Old 10-10-2006, 04:03 PM   #2 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
Some Documentation

Volatility as a Clue

Most traders have heard the story of Long Term Capital Management (LTCM). For those who have not heard the story, LTCM was a hedge fund designed to take advantage of situations where the price volatility of a financial instrument would go from higher than average to normal (the mean). Can lowly traders such as ourselves take advantage of volatility as a warning that large moves are coming? The answer is yes. Most traders would agree that periods of high volatility are usually followed by periods of low volatility. But what about the other way around? Are periods of low volatility followed by periods of high volatility? They are indeed (most of the time). Today, we will briefly discuss a strategy that you can use to take advantage of volatility explosions.

Here is a quantified signal to take advantage of these occurrences. We are going to focus on getting clued in on volatility increases before they occur. Optimized historical tests have shown that it's effective to compare 6-day historically volatility against 100-day historical volatility. When 6-day historical volatility is 50% or less than 100-day volatility, this tells us that the stock or index has calmed down and it becomes likely that a large market move is about to happen. Keep this in mind if you are considering entering a straddle. You can use this technique to find ideal entry points. One extremely effective technique for entry is to find a stock that fits this low volatility criteria. Once the stock breaks out of a tight range (which should be in place based on low volatility), trade the stock in the direction of the breakout. So if the stock plummets downward, then sell short, and if the stocks shoots up, go long. Usually, the longer a stock or market index stays in this low volatility state, the larger the move will be once it breaks out.

You should use stops with this technique in the following way. Once you get a breakout following the period of low volatility, take note of the high of the breakout day if it is a bullish breakout. Once the stock closes above the high of the breakout day, then go long on the stock. Use the low of the breakout day as your stop loss price in order to reduce risk.

Price Headley is the founder and chief analyst of BigTrends.com.



Now! How to implement this on our EA?? This would improve a lot our strategy!
Attached Files
File Type: pdf Using Currency Correlations To Your Advantage.pdf (60.9 KB, 436 views)
kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-10-2006, 04:06 PM   #3 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
Autoratio?

It is possible to use this code to calculate the ratio between two currencie pair?



//+--------- --------- --------- --------- --------- --------- ----+
//+ Calculate cost in USD of 1pip of given symbol
//+--------- --------- --------- --------- --------- --------- ----+
double PipCost (string TradeSymbol) {
double Base, Cost;
string TS_13, TS_46, TS_4L;

TS_13 = StringSubstr (TradeSymbol, 0, 3);
TS_46 = StringSubstr (TradeSymbol, 3, 3);
TS_4L = StringSubstr (TradeSymbol, 3, StringLen(TradeSymb ol)-3);

Base = MarketInfo (TradeSymbol, MODE_LOTSIZE) * MarketInfo (TradeSymbol,
MODE_POINT);
if ( TS_46 == "USD" )
Cost = Base;
else if ( TS_13 == "USD" )
Cost = Base / MarketInfo (TradeSymbol, MODE_BID);
else if ( PairExists ("USD"+TS_4L) )
Cost = Base / MarketInfo ("USD"+TS_4L, MODE_BID);
else
Cost = Base * MarketInfo (TS_46+"USD" , MODE_BID);

return(Cost) ;
}

//+--------- --------- --------- --------- --------- --------- ----+
//+ Returns true if given symbol exists
//+--------- --------- --------- --------- --------- --------- ----+
bool PairExists (string TradeSymbol) {
return ( MarketInfo (TradeSymbol, MODE_LOTSIZE) > 0 );
}
kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-10-2006, 04:09 PM   #4 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
HedgeEA Version 4

This is a work in progress and not a final version. Please not that this EA is not stable to be used on a live account.

This version is with some problem placing the second trade of the hedge. I could not find the error until now, but today I'm looking deep into the EA to try to find out whats is going on.
Attached Files
File Type: mq4 HedgeEA_v4.mq4 (11.5 KB, 111 views)
File Type: pdf HegdeEAv4 Small Manual.pdf (31.0 KB, 270 views)
kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-10-2006, 08:32 PM   #5 (permalink)
Member
 
Join Date: Oct 2006
Posts: 40
Ok thanks

i run it on:

gbpjpy chfjpy and
1.8 ratio

its ok

so i run it on eurusd usdchf
buy , buy
1.2 ratio

dont work do you know why?
juanche is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Old 10-10-2006, 09:12 PM   #6 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 1
Testing

Hi, I'm not a programer but, I will help with what I can. I'm testing will let you know what the results. What time fame should I run it I'm using 1hr

Last edited by hccgtim; 10-10-2006 at 09:14 PM.
hccgtim is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-10-2006, 10:20 PM   #7 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
Yes I believe that 1Hour chart is good, but this only matters if you use correlation. If this is disabled then you can run on any timeframe.

kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-20-2006, 04:21 AM   #8 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
Exclamation HedgeEA Version 5!! :)

Ok, I think now the first stage is completed. I've corrected the MM functions, and now it is placing orders correctly.

I'm testing it live with MM and without MM...

Now I want to add some features like automatic TP, well this is a hard one, I want to build a function to set takeprofit integrating, lotsize and account leverage.

removed usepips. It does not make sense because if you use swap you cannot add dollars to pips.

To do list:
1 - Integrate AutoTakeProfit
2 - Integrate another Entry signal (any sugestions? BB?)
3 - Built in correlator as a function
4 - Send email on new hedge entry (and profit report for the old one)

Live Test Statement with MM:
http://www.forexforums.org/eatests/test2/statement.htm

Live Test Statement without MM
http://www.forexforums.org/eatests/test1/statement.htm
Attached Files
File Type: mq4 Correlation.mq4 (3.2 KB, 144 views)
File Type: mq4 HedgeEA_v5.mq4 (10.8 KB, 141 views)

Last edited by kokas; 10-20-2006 at 12:14 PM.
kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-20-2006, 04:36 AM   #9 (permalink)
Junior Member
 
Join Date: Oct 2006
Posts: 8
Talking You forgot to change Version# in the EA script

Quote:
Originally Posted by ForexForum
Ok, I think now the first stage is completed. I've corrected the MM functions, and now it is placing orders correctly.

I'm testing it live with MM and without MM...

Now I want to add some features like automatic TP, well this is a hard one, I want to build a function to set takeprofit integrating, lotsize and account leverage.

removed usepips. It does not make sense because if you use swap you cannot add dollars to pips.

To do list:
1 - Integrate AutoTakeProfit
2 - Integrate another Entry signal (any sugestions? BB?)
3 - Built in correlator as a function
4 - Send email on new hedge entry (and profit report for the old one)

Live Test Statement with MM:
http://www.forexforums.org/eatests/test2/statement.htm

Live Test Statement without MM
http://www.forexforums.org/eatests/test1/statement.htm
I think you forgot to change the version# in the EA script
berdj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-20-2006, 12:15 PM   1 links from elsewhere to this Post. Click to view. #10 (permalink)
Administrator
 
kokas's Avatar
 
Join Date: Sep 2006
Location: Portugal
Posts: 507
Done! v.5
kokas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

LinkBacks (?)
LinkBack to this Thread: http://www.forexforums.org/mt4-expert-advisors-factory/22-hedgeea.html
Posted By For Type Date
Grid Trading (Part 3 - Correlation Grid Trading) | Macrotactics This thread Refback 08-29-2008 09:37 PM
FINEXX Correlation System EA - Page 2 - Forex Trading This thread Refback 08-27-2008 05:12 PM
Question on Hedging - Page 4 - Forex Trading This thread Refback 08-25-2008 03:18 PM
FINEXX Correlation System EA - Page 10 - Forex Trading This thread Refback 08-01-2008 06:26 PM
FINEXX Correlation System EA - Forex Trading This thread Refback 07-05-2008 05:08 PM
- Forex This thread Refback 06-26-2008 05:26 AM
Digg - HedgeEA This thread Refback 04-21-2008 12:59 AM
Diskuzn frum Financnik.cz :: Se Sidem o Forexu :: FPI - Fractional Product Inefficiency Post #10 Refback 04-08-2008 09:36 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On


Sedo - Buy and Sell Domain Names and Websites project info: forexforums.org Statistics for project forexforums.org etracker® web controlling instead of log file analysis

All times are GMT. The time now is 10:26 PM.
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.