The ‘Hedge’ Rocks Expert Advisor for MT4

 
Files:
hedge_rocks.mq4  58 kb
 

That's look interesting.

What need to be changed to work on 1:100 leverage and microaccounts(~2000$)?

 

Not too much needs to be changed

It is supposed to addapt to all of that via the cf (conversion Factor). It should addapt but if you aren't happy with the profit or loss brackets, change the grab_profit_factor (in the EA properties) until you are happy. Tell me how it does at 100:1. Make sure you don't go live until you are sure it's going to do what you want.

Enforcer:
That's look interesting. What need to be changed to work on 1:100 leverage and microaccounts(~2000$)?
 

Of course I don't use on live

Should pass at least 1-2 months on demo first.

Well, I changed already cf and grab_profit_factor to different values buy on screen it say constantly same value for EU-UC,GU-UC Grab Profit: 304.80.

Lot size is ok, but I doubt it will reach too soon 300$ profit...

With default values , until now is on ~ -45$.

 

Thanks for the system/EA, onealpha - I was always wondering what those FR fanatics worship at?

One question - when I started the EA I chosen G/U, E/U and U/C as trading pairs, but EA alerted me that U/C is not good correlated pair, so I switched to U/J instead (still got the same alert though). Could you suggets what's the best pairs set to trade?

Thanks

 

YTD correlation

Orest:
Thanks for the system/EA, onealpha - I was always wondering what those FR fanatics worship at?

One question - when I started the EA I chosen G/U, E/U and U/C as trading pairs, but EA alerted me that U/C is not good correlated pair, so I switched to U/J instead (still got the same alert though). Could you suggets what's the best pairs set to trade?

Thanks

The closer YTD correlation is to -1, the better for this system. -1 means that a perfect inverse correlation exists and the net profit/loss would always be near zero. I made a warning when the pairs drop/rise above a certain threshold... I think it was -.3 (but I could be wrong). This just means that things aren't so good with that currency. The EURUSD - USDCHF is always close to -.9. The GBPUSD USDCHF is supposed to be near -.84... but is not doing so well lately. When trading against the JPY pairs, it's always going to be low or even positive... which is no good for a hedge. However as risk goes up, so does O/N interest rates. It's simply a math thing and for the more mathematically inclined... it should give them a 'feel' for the risk and the probability of sucess with this system... it should not be over emphasized.

 

Any EA forwardtesting results?

Onealpha, I'm forward testing with USD/JPY and results are promising so far. Probably need to establish another account with USD/CHF. Is USD/CHF your personal preference over JPY pair?

Do you have any historical results to share?

The code needs to be adjusted though, the "500" constant was too high for my grab profit level (profit level was calculated as $27,000 for $50,000 account probably because of the leverage level) , I think it needs to be set as parameter (or part of GrabProfit parameter).

Again, like the EA idea so far, thanks very much for sharing.

onealpha:
The closer YTD correlation is to -1, the better for this system. -1 means that a perfect inverse correlation exists and the net profit/loss would always be near zero. I made a warning when the pairs drop/rise above a certain threshold... I think it was -.3 (but I could be wrong). This just means that things aren't so good with that currency. The EURUSD - USDCHF is always close to -.9. The GBPUSD USDCHF is supposed to be near -.84... but is not doing so well lately. When trading against the JPY pairs, it's always going to be low or even positive... which is no good for a hedge. However as risk goes up, so does O/N interest rates. It's simply a math thing and for the more mathematically inclined... it should give them a 'feel' for the risk and the probability of sucess with this system... it should not be over emphasized.
 
Orest:
Onealpha, I'm forward testing with USD/JPY and results are promising so far. Probably need to establish another account with USD/CHF. Is USD/CHF your personal preference over JPY pair?

Do you have any historical results to share?

The code needs to be adjusted though, the "500" constant was too high for my grab profit level (profit level was calculated as $27,000 for $50,000 account probably because of the leverage level) , I think it needs to be set as parameter (or part of GrabProfit parameter).

Again, like the EA idea so far, thanks very much for sharing.

A made a bunch of forward tests back when I made this. I don't know if I still have them ... even if I could find them, times are much different now.

int gpf = (GrabProfitFactor * 2) + 500; //Calibrate this variable to suit your Broker's software

That is why I suggested that you started with tradeviewforex ... I actually wrote it on something called Strategy builder FX MT4 but they went under... when I recently decided to put out the source code... I quickly checked how it worked against a few different brokers. I never had the chance to debug it against other MT4 platforms. I calibrated that number based on 200:1, 10,000 balance, 100K lot sizes and a margin of 8-12 %. I didn't want to spend a whole lot of time on it. Take it from here... post your fixes... see what we can come up with. It still needs some work.

 

Hi onealpha!

Thank you for sharing your ea. I think, if we all work together and find and clear all bugs and make the ea easier to adapt to other accounts/leverage/..., then we will have a really great one. I have just begun to read through your code...

bbop

 

MQ4 skills waining

BigBoppa:
Hi onealpha!

Thank you for sharing your ea. I think, if we all work together and find and clear all bugs and make the ea easier to adapt to other accounts/leverage/..., then we will have a really great one. I have just begun to read through your code...

bbop

It has been more than a year since I did that and I have been immersed in Actionscript 3.0/Javascript/Flash for the last few months. My memory fades... however, I will give some thought to it...hmmmm:

*First thing you need to know is: don't trust my comments. I never wrote this with anyone but 'me' in mind.

double iClose ( string symbol, int timeframe, int shift)

***[shift relative to the current bar the given amount of periods ago]

//average 5 min intervals times 36 intervals = 3 hours

for (int x1 = 0; x1 <= 36; x1++)

{

for (int x2 =1; x2 <=5; x2++)

{

eClose[x1] = eClose[x1] + iClose ("EURUSD",PERIOD_M1,x1*5+x2);

cClose[x1] = cClose[x1] + iClose ("USDCHF",PERIOD_M1,x1*5+x2);

gClose[x1] = gClose[x1] + iClose ("GBPUSD",PERIOD_M1,x1*5+x2);

jClose[x1] = jClose[x1] + iClose ("USDJPY",PERIOD_M1,x1*5+x2);

}

}

Hmmm.. I was trying to get a running average of the closing prices for each currency. I added (+=) the one minute average closing price (PERIOD_M1) to an array (xClose[1-36]) which is = to the sum of 5 of the one minute average closing prices. AHHHHHHHHHH !

Whatever.. it works.... whatever I did... I think.

I will stick to concepts rather than parse through MQL

The point of this was get a 3 hour average with a 1 minute resolution. I think if I used PERIOD_M5 or greater and less iterations, there was a loss of precision.

I only used this information in the display of the correlations. I tried to use this information in the logic that decides when to buy/sell orders and when to execute limit orders... but I think I took it out. The concept was to use this to look for large fluctuations: to protect from them or to find a way to use them for advantage.

 

hi onealpha,

yes, your code is ok, i made a mistake and edited my post after detecting. Do you have a link or explaination of the strategy?

It is hard to get through the code without knowing the strategy, there are too many arrays to keep in mind...

i know your ea hedges a major currency position with minor currency positions.

is it "only" hedge because of correlation or is it a ring like the FPI of Michal Kreslik?

When will ea close position? At TP/SL only? When to close hedge?

Thank you again!

bbop

Reason: