You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Reading through the code of Electra we can easily see it is a multi-timeframe EA, specially for entry modes 1 and 3. Those are based on Moving Averages and Stochastics of different timeframes. Thus we can´t have it backtested in those two modes.
However mode 2, which uses the Absolute Strengh indicator for trade selection, is based on H4 timeframe (hard-coded). Although all modes rely on daily range for trade manangement, I believe one can backtest this mode if he/she is willing to accept H4 range calculations for position manangement.
Best regards,
--Id--
--Id--
Electra actually avoids the usual trap of multi time frame EAs back testing. It does not use a current bar values. And since it is not using a current bar of another time frame it is always using past data for decisions. So it can be back-tested just make sure that the other time frames data is downloaded too since metatrader back-tester will use only the data that is already downloaded (it will not simulate that "other" time frames)
Hope this clarifies some doubts when it comes to multi time framing in EAs : when you see a "0" (zero) in indicator call as a last parameter then it is a time to be alarmed (I know some guys using that stuff on purpose to make better results then they actually are not just for EAs) and to run away from back tests results. Electra does not even have that possibility (it is hard-coded to previous, second previous or even 3rd previous bar usage instead of the current bar of the "other" time frame)
regards
Mladen
--Id--
Electra actually avoids the usual trap of multi time frame EAs back testing. It does not use a current bar values. And since it is not using a current bar of another time frame it is always using past data for decisions. So it can be back-tested just make sure that the other time frames data is downloaded too since metatrader back-tester will use only the data that is already downloaded (it will not simulate that "other" time frames)
Hope this clarifies some doubts when it comes to multi time framing in EAs : when you see a "0" (zero) in indicator call as a last parameter then it is a time to be alarmed (I know some guys using that stuff on purpose to make better results then they actually are not just for EAs) and to run away from back tests results. Electra does not even have that possibility (it is hard-coded to previous, second previous or even 3rd previous bar usage instead of the current bar of the "other" time frame)
regards
MladenThanks for the clarification, Mlanden. I never understood completely how multi-timeframe backtesting can be used when avoiding 0 shift on indicators. Can you elaborate on that, please?
And how about Electra´s getRange function? Isn´t it using 0 shift on the iTime() call?
{
static double newRange = 0;
static datetime newTime = 0;
static int newBars = 0;
string symbol = Symbol();
//
//
//
//
//
if (newTime != iTime(symbol,timeFrame,0) || newBars != iBars(symbol,timeFrame))
{
newTime = iTime(symbol,timeFrame,0);
newBars = iBars(symbol,timeFrame);
newRange = 0;
...
...:):)
See the continuation of the GetRange (where it actually retrieves the values) :
for (int i=0;d<length;i++)
{
double high = iHigh(symbol,timeFrame,i+1);
double low = iLow (symbol,timeFrame,i+1);So the value used is never 0 (because of that "+1" part) and that way it never uses values with a "known future". The rest of indicators have directly coded in shift (not this "round the bushes" way ) this is the only one that is in loop but, as you can see it is taken care not to fall into the trap
__________________________
As of back-testing multi time frame without using "current" bar of the other time grame : the thing is simple. Imagine that we use daily walue 1 bar back. Even in back test it will be 1 day back compared to simulated current time of the EA so, even in that case it will use past data. Only if we use the current bar of "other" time frame it will know the future since it will read directly from the hst file of that time frame and that value in the hst file is already recorded. Something like this : it is no problem if we use daily close of previous bar since it is a past value compared to test. But if we use daily close of a current bar the that close is known what it will be before the time for that is reached.
Sorry if I explained in a complicated way. Once you know it it is easy to understand it but it is not easy to explain
Thanks for the clarification, Mlanden. I never understood completely how multi-timeframe backtesting can be used when avoiding 0 shift on indicators. Can you elaborate on that, please?
And how about Electra´s getRange function? Isn´t it using 0 shift on the iTime() call?
{
static double newRange = 0;
static datetime newTime = 0;
static int newBars = 0;
string symbol = Symbol();
//
//
//
//
//
if (newTime != iTime(symbol,timeFrame,0) || newBars != iBars(symbol,timeFrame))
{
newTime = iTime(symbol,timeFrame,0);
newBars = iBars(symbol,timeFrame);
newRange = 0;
...
...:):)
...
Only if we use the current bar of "other" time frame it will know the future since it will read directly from the hst file of that time frame and that value in the hst file is already recorded. Something like this : it is no problem if we use daily close of previous bar since it is a past value compared to test. But if we use daily close of a current bar the that close is known what it will be before the time for that is reached.
Sorry if I explained in a complicated way. Once you know it it is easy to understand it but it is not easy to explainDon´t worry, the above quote is more than enough to understand the current bar problem in multi-timeframe simulation. Thank you for teaching us such an important concept. I´d say it would be the same as trading already knowing the current bar OHLC configuration.
I was worried about backtests with Electra because of its low frequency trading with such a large number of pairs, as we see on newdigital´s forward tests.
hello, would it be possible to rewrite this EA for mt5?
I'm doing well??
Good afternoon everyone:
Excuse my English please.
I need to confirm if I'm doing it correctly, because of the language I can not understand some things.
To turn this Electra system version:
https://www.mql5.com/en/forum/178196/page33
I need to have installed the following indicators:
absolutestrengthforea.mq4
stochastic4tfalligned.mq4
After taking into account the issue of capital in the account and nothing more??
I could say that I have attached the image that everything is correct?
Thank you very much in advance.
A greeting
Hermo.
Good afternoon everyone:
Excuse my English please.
I need to confirm if I'm doing it correctly, because of the language I can not understand some things.
To turn this Electra system version:
https://www.mql5.com/en/forum/178196/page33
I need to have installed the following indicators:
absolutestrengthforea.mq4
stochastic4tfalligned.mq4
After taking into account the issue of capital in the account and nothing more??
I could say that I have attached the image that everything is correct?
Thank you very much in advance.
A greeting
Hermo.Hermo
All you need for that EA (version 1.17) as far as indicators are concerned is AbsoluteStrengthForEA indicator. No other indicator is necessary
Hermo All you need for that EA (version 1.17) as far as indicators are concerned is AbsoluteStrengthForEA indicator. No other indicator is necessary
Thanks mladen:
I had doubts about whether I needed Stochastic4TFalligned indicator for the third type of entries.
According to the image attached, the EA is working correctly? I have seen other pictures and they are not equal. In the menu that appears in the bottom right, is not written the same as shown in my image. No label sets. This is all right?
Thank you very much in advance.
Regards
Hermo.
Thanks mladen:
I had doubts about whether I needed Stochastic4TFalligned indicator for the third type of entries.
According to the image attached, the EA is working correctly? I have seen other pictures and they are not equal. In the menu that appears in the bottom right, is not written the same as shown in my image. No label sets. This is all right?
Thank you very much in advance.
Regards
Hermo.Something seems to be wrong : it should display arrows there not label. It seems that with some new builds something went wrong as far as display is concerned. Tested it and as far as orders are concerned they are opened and handled correctly, only those arrows are not displayed as they should. Will check that, but you can use it in the meantime to test and trade it