Did not do anything. Run it as is. In the above logs all the data to reproduce. Your result should be completely the same as mine in terms of profit. And by performance not much different.
Really? When you claim to have found an error or a problem in my article that I was paid money for, I will definitely check it out. In the meantime, let's not "let's." Because you're making it sound like you're being patronising.
On the time frame from the article, on EURUSD,M30 and USDJPY,M30
MACD Sample One value at a time.mq5:
final balance 100180.01 USD
EURUSD,M30: 26390728 ticks, 12510 bars generated. Environment synchronized in0:00:00.125. Test passed in0:00:41.016 (including ticks preprocessing 0:00:02.328).
EURUSD,M30: total time from login to stop testing 0:00:41.141 (including 0:00:00.125for history data synchronization)
756 Mb memory used including 1.88 Mb of history data, 512 Mb of tick data
final balance 99523.31 USD
USDJPY,M30: 29801706 ticks, 11837 bars generated. Environment synchronized in0:00:00.032. Test passed in0:01:00.937 (including ticks preprocessing 0:00:02.735).
USDJPY,M30: total time from login to stop testing 0:01:00.969 (including 0:00:00.032for history data synchronization)
819 Mb memory used including 1.88 Mb of history data, 576 Mb of tick data
MACD Sample 4 to 5 MQL4 style.mq5:
final balance 100192.51 USD
EURUSD,M30: 26390728 ticks, 12510 bars generated. Environment synchronized in0:00:00.140. Test passed in0:01:37.969 (including ticks preprocessing 0:00:02.329).
EURUSD,M30: total time from login to stop testing 0:01:38.109 (including 0:00:00.140for history data synchronization)
755 Mb memory used including 1.88 Mb of history data, 512 Mb of tick data
final balance 99550.10 USD
USDJPY,M30: 29801706 ticks, 11837 bars generated. Environment synchronized in0:00:00.031. Test passed in0:01:51.328 (including ticks preprocessing 0:00:02.500).
USDJPY,M30: total time from login to stop testing 0:01:51.359 (including 0:00:00.031for history data synchronization)
819 Mb memory used including 1.88 Mb of history data, 576 Mb of tick data
The test time differs twice. And it is not 8 or 1 second.
If you compare the balances - yes, there is a slight difference in the numbers, but it is not noticeable on the chart.
In fact, the description of this topic is seen here on a slightly different plane:
Thousands of indicators have already been written, accessed via iCustom with allocation of appropriate buffers/handles and so on and so forth. This is a slow and resource-intensive story;
An indicator can be implemented as a pure function inside an Expert Advisor - in this case the required value will be calculated much faster and will require less memory.
The idea is to write some kind of interface that would allow unified access to any custom indicators, but if the indicator is implemented as a separate pure function, the reference is made to this function instead of the handle. As a result, we get a good acceleration and at the same time we do not lose access to any arbitrary indicator. This is an interesting topic, I would even take it up.
Try it, it's interesting to see if it's worth it. I would like an approach of this type - we take OnCalculate out of the indicator, modify it slightly under a new name, add it to the indicator code and now we can pull this function as a bibilio function, passing parameters from the Expert Advisor to it. Right?
Rashid Umarov: ...I would like an approach of this type - we take OnCalculate out of the indicator, slightly modify it under a new name, add it to the indicator code and now we can pull this function as a bibilio function, passing parameters from the Expert Advisor to it. Right?
We need to think about implementation. Now it is difficult to say how it can be.
Rashid Umarov: Try it, it's interesting to see if it's worth it. I would like an approach of this type - we take OnCalculate out of the indicator, modify it slightly under a new name, add it to the indicator code and now we can pull this function as a bibilio function, passing parameters from the Expert Advisor to it. Right?
I did this for iRSIOnArray(), which is not in mql5. It works in the indicator. To call it from the Expert Advisor, it is necessary to do not so straightforwardly.
//+------------------------------------------------------------------+//| Relative Strength Index on array|//+------------------------------------------------------------------+template<typename T>
int RSIOnArray(constint rates_total,
constint prev_calculated,
constint begin,
constint period,
const T &price[],
double &buffer_pos[],
double &buffer_neg[],
double &buffer_rsi[])
{
int i;
T diff;
//--- check for rates countif(period<1 || rates_total-begin<period) return(0);
//--- save as_series flagsbool as_series_price=ArrayGetAsSeries(price);
bool as_series_rsi=ArrayGetAsSeries(buffer_rsi);
if(as_series_price)
ArraySetAsSeries(price,false);
if(as_series_rsi)
{
ArraySetAsSeries(buffer_rsi,false);
ArraySetAsSeries(buffer_pos,false);
ArraySetAsSeries(buffer_neg,false);
}
//--- preliminary calculationsint pos=prev_calculated-1;
if(pos<=period)
{
//--- first RSIPeriod values of the indicator are not calculated
buffer_rsi[0]=0.0;
buffer_pos[0]=0.0;
buffer_neg[0]=0.0;
T SumP=0.0;
T SumN=0.0;
for(i=1; i<=period; i++)
{
buffer_rsi[i]=0.0;
buffer_pos[i]=0.0;
buffer_neg[i]=0.0;
diff=price[i]-price[i-1];
SumP+=(diff>0 ? diff : 0);
SumN+=(diff<0 ?-diff : 0);
}
//--- calculate first visible value
buffer_pos[period]=double(SumP/period);
buffer_neg[period]=double(SumN/period);
buffer_rsi[period]=100.0-(100.0/(1.0+buffer_pos[period]/(buffer_neg[period]>0 ? buffer_neg[period] : DBL_MIN)));
//--- prepare the position value for main calculation
pos=period+1;
}
//--- the main loop of calculationsfor(i=pos;i<rates_total && !IsStopped();i++)
{
diff=price[i]-price[i-1];
buffer_pos[i]=(buffer_pos[i-1]*(period-1)+(diff>0.0 ? diff : 0.0))/period;
buffer_neg[i]=(buffer_neg[i-1]*(period-1)+(diff<0.0 ?-diff : 0.0))/period;
buffer_rsi[i]=100.0-100.0/(1+buffer_pos[i]/(buffer_neg[i]>0 ? buffer_neg[i] : DBL_MIN));
}
//--- restore as_series flagsif(as_series_price) ArraySetAsSeries(price,true);
if(as_series_rsi)
{
ArraySetAsSeries(buffer_rsi,true);
ArraySetAsSeries(buffer_pos,true);
ArraySetAsSeries(buffer_neg,true);
}
//---return(rates_total);
}
//+------------------------------------------------------------------+
Made MACD SaMple from the supply on your settings. Where is EURO in the balance from, is that not the point?
That's not the point. EUR from here
And the testing time is still much longer than yours.
2018.01.2613:34:10.520 Core 1 authorized (agent build 1755)
2018.01.2613:34:10.522 Tester EURUSD,M1 (MetaQuotes-Demo): testing of Experts\Examples\MACD\MACD Sample.ex5 from2017.09.0100:00 to 2018.01.2600:002018.01.2613:34:16.792 Core 1 EURUSD,M1 (MetaQuotes-Demo): generating based on real ticks
2018.01.2613:34:16.792 Core 1 EURUSD,M1: testing of Experts\Examples\MACD\MACD Sample.ex5 from2017.09.0100:00 to 2018.01.2600:00 started with inputs:
2018.01.2613:34:16.792 Core 1 InpLots=0.12018.01.2613:34:16.792 Core 1 InpTakeProfit=502018.01.2613:34:16.792 Core 1 InpTrailingStop=302018.01.2613:34:16.792 Core 1 InpMACDOpenLevel=32018.01.2613:34:16.792 Core 1 InpMACDCloseLevel=22018.01.2613:34:16.792 Core 1 InpMATrendPeriod=262018.01.2613:25:46.482 Core 1 final balance 10168.90 USD2018.01.2613:25:46.482 Core 1 EURUSD,M1: 9753093 ticks, 147480 bars generated. Environment synchronized in0:00:02.610.
Test passed in0:00:19.062 (including ticks preprocessing 0:00:02.078).
2018.01.2613:25:46.482 Core 1 EURUSD,M1: total time fromlogin to stop testing 0:00:21.672 (including 0:00:02.610for history data synchronization)
2018.01.2613:25:46.482 Core 1600 Mb memory used including 44 Mb of history data, 256 Mb of tick data
Here is my log with your settings
EURUSD,M1 (MetaQuotes-Demo): generating based on real ticks
EURUSD,M1: testing of Experts\Examples\MACD\MACD Sample.ex5 from2017.09.0100:00 to 2018.01.2600:00 started with inputs:
InpLots=0.10
InpTakeProfit=50
InpTrailingStop=30
InpMACDOpenLevel=3
InpMACDCloseLevel=2
InpMATrendPeriod=26
final balance 10000168.90 USD
EURUSD,M1: 9753093 ticks, 147480 bars generated. Environment synchronized in0:00:00.031. Test passed in0:00:06.302.
EURUSD,M1: total time from login to stop testing 0:00:06.333 (including 0:00:00.031for history data synchronization)
571 Mb memory used including 44 Mb of history data, 256 Mb of tick data
Why it is 3.5 times faster for me (caching was removed by recompilation before backtest) - I don't know. Configuration
Let's find out the reasons! I think this is very important. I don't have a HDD (only SSD). Maybe that's the issue. But then it's VERY bad for the MT5. The comp is very ancient - five years old for sure. That's why it's weird.
Why I have 3.5 times faster execution (caching removed by recompilation before backtest) - I don't know. Configuration
Let's find out the reasons! I think this is very important. I don't have a HDD (only SSD). Maybe that's the issue. But then it is VERY bad for the MT5. The comp is very ancient - five years old for sure. That's why it's weird.
Looked in all the posts - the number of ticks is the same
2018.01.2613:25:46.482 Core 1 final balance 10168.90 USD2018.01.2613:25:46.482 Core 1 EURUSD,M1: 9753093 ticks, 147480 bars generated. Environment synchronized in0:00:02.610.
Test passed in0:00:19.062 (including ticks preprocessing 0:00:02.078).
2018.01.2613:25:46.482 Core 1 EURUSD,M1: total time fromlogin to stop testing 0:00:21.672 (including 0:00:02.610for history data synchronization)
2018.01.2613:25:46.482 Core 1600 Mb memory used including 44 Mb of history data, 256 Mb of tick data
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
PS I ran the standard MACD Sample on USDJPY M30 2017.02.01-2018.01.18 "All ticks" (as in the article) MetaQuotes-Demo.
How can you fit into 8 seconds? Especially in 1 second?
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "LifeHack for trader: cooking fast food from indicators"
fxsaber, 2018.01.26 11:06 AM.
Did not do anything. Run it as is. In the above logs all the data to reproduce. Your result should be completely the same as mine in terms of profit. And by performance not much different.
Made the MACD SaMple from the delivery on your settings. And where does EURO in the balance come from, isn't that the point?
And the testing time is still much longer than yours.
On the time frame from the article, on EURUSD,M30 and USDJPY,M30
The test time differs twice. And it is not 8 or 1 second.
If you compare the balances - yes, there is a slight difference in the numbers, but it is not noticeable on the chart.
In fact, the description of this topic is seen here on a slightly different plane:
The idea is to write some kind of interface that would allow unified access to any custom indicators , but if the indicator is implemented as a separate pure function, the reference is made to this function instead of the handle. As a result, we get a good acceleration and at the same time we do not lose access to any arbitrary indicator. This is an interesting topic, I would even take it up.
...I would like an approach of this type - we take OnCalculate out of the indicator, slightly modify it under a new name, add it to the indicator code and now we can pull this function as a bibilio function, passing parameters from the Expert Advisor to it. Right?
Try it, it's interesting to see if it's worth it. I would like an approach of this type - we take OnCalculate out of the indicator, modify it slightly under a new name, add it to the indicator code and now we can pull this function as a bibilio function, passing parameters from the Expert Advisor to it. Right?
I did this for iRSIOnArray(), which is not in mql5. It works in the indicator. To call it from the Expert Advisor, it is necessary to do not so straightforwardly.
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "LifeHack for trader: cooking fast food from indicators"
Rashid Umarov, 2018.01.26 11:30 AM
Made MACD SaMple from the supply on your settings. Where is EURO in the balance from, is that not the point?
That's not the point. EUR from here
And the testing time is still much longer than yours.
Here is my log with your settings
Why it is 3.5 times faster for me (caching was removed by recompilation before backtest) - I don't know. Configuration
Let's find out the reasons! I think this is very important. I don't have a HDD (only SSD). Maybe that's the issue. But then it's VERY bad for the MT5. The comp is very ancient - five years old for sure. That's why it's weird.
The test times are twice as different. And it is not 8 or 1 second.
Show the configuration lines from the Terminal startup log.
Why I have 3.5 times faster execution (caching removed by recompilation before backtest) - I don't know. Configuration
Let's find out the reasons! I think this is very important. I don't have a HDD (only SSD). Maybe that's the issue. But then it is VERY bad for the MT5. The comp is very ancient - five years old for sure. That's why it's weird.
Here's my comp, no SSD
Looked in all the posts - the number of ticks is the same