Quote:
Originally Posted by 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.