Discussion of article "LifeHack for traders: Fast food made of indicators" - page 11

 
fxsaber:

So your agents (where there is a 21 second test) would be banned?

If I answer YES, will you start asking about the criteria for banning? Let's stop there, OK?

 
fxsaber:

There is no certainty that a user can speed up this process in a general way. Obviously, the overhead is spent on calculating the hash function.

One variant of such an indicator hash function in a general form was posted here


Disadvantages:

  • Your variant relies on referring to the chart for the handshake, right? Have you tried running the EA in the tester ? Will it work ? How much slower ?
  • The function shown in the code will also rape the terminal on every tick - requesting the handle of an already created indicator is no better than just throwing a call in the style of "this indicator is needed - look for its handle and create a new instance if you don't have it yet".
 
Rashid Umarov:

Disadvantages:

  • Your variant is laying on appealing for hend to the chart, right ? Have you tried running the EA in a tester ? Will it work ? How much slower ?
  • The function shown in the code will also rape the terminal on every tick - requesting the handle of an already created indicator is no better than just throwing a call in the style of "this indicator is needed - look for its handle and create a new instance if it doesn't exist yet".

You have not read

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 09:22 pm.

Yes, this is a frontal method, which fully justified itself, since it was required accuracy and did not need any performance at all. The task was to close the interfering cleverness of MT5.

And others, of course, did not try, because...

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 09:02 pm.

There didn't care about performance, but it was clear that an array of MqlParam values must be fed to the input of any hash function. And this can't work fast taking into account the fact that there is a slow string-field.

Therefore, writing a universal indicator fast hash function much faster than what is built into MT5 is an open task. But I am categorically against calling indicators from somewhere. That's why I don't even want to study the question.


And I almost agree with Vasily's hypothesis.

Forum on trading, automated trading systems and testing trading strategies.

Discussion of the article "LifeHack for trader: cooking fast food from indicators".

Vasiliy Sokolov, 2018.01.26 09:14

There is no resonance to make your hash function in OOP wrapper, since this function is already implemented behind the scenes of MT5 and works fast.

Which suggests that it is already difficult to catch up with the system hash function at the user level, and it will be almost impossible to overtake it by a meaningful amount.


I see no sense in inventing something in this case

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 09:27 pm.

Bars and indicators in the form of drawings on the screen I bring. But in EAs it's almost absurd.

People test EAs on real ticks, while for some reason they are oriented not on ticks, but on bars. And it would be fine if bars were built for each type of price (bid, ask, flipper), but this is not the case.

There is some kind of masochism when people voluntarily switch to historical data with a terrible loss of information. And on this fragment they try to cook up something, including the use of machine learning methods.


Now the only use of indicators is a spy-mode in a tester. But as soon as there are services with

void OnTick( const string &Symb );
indicators for Expert Advisors will lose any relevance.
Анализ результатов тестов и оптимизации в тестере стратегий MetaTrader 5
Анализ результатов тестов и оптимизации в тестере стратегий MetaTrader 5
  • 2018.01.27
  • www.mql5.com
Рассмотрим результаты тестов на одном и нескольких символах. Тесты будем проводить в режиме Все тики...
 

Forum on trading, automated trading systems and testing of trading strategies

Analysis of test and optimisation results in MetaTrader 5 strategy tester

fxsaber, 2018.01.28 12:25 pm.

  1. In single symbol mode "spy" works 2.5 times slower than pure OnTick. I.e. the empty indicator (built on PERIOD_W1 to keep bar history to a minimum) has a huge overhead in the Tester!
Indicators are Evil!
 
fxsaber:
Indicators are Evil!
fxsaber:

You didn't read it


And I almost agree with Vasily's hypothesis


I don't see any sense in inventing something in this case


Now the only usefulness of indicators is a spy-mode in the tester. But as soon as services with

So indicators for Expert Advisors will lose any relevance.

I read it, but decided to just explicitly state the problems with your approach. Because it was you who started accusing Vladimir of lack of caching, etc.

The claims to Vladimir were precisely about the "inefficiency" of the presented approach. Your variant does not solve this problem.

 
Rashid Umarov:

I read it, but decided to just explicitly state the problems with your approach. Because it was you who started accusing Vladimir of lack of caching, etc.

Claims to Vladimir were precisely about the "inefficiency" of the presented approach. Your variant does not solve this problem.

Standard indicators (they are the only ones discussed in the article) are cached in an elementary way! Because all input parameters are known.

It is difficult to write a universal hash function. But it is not required in the article. It deals with the simplest case. And even for it there is no hash function.

 
My results from the article

3.3 Let's compare the execution speed of MACD based Expert Advisors

The comparison will involve:

  • "MACD Sample.mq5" - Expert Advisor from the standard delivery with correct access to indicators
  • "MACD Sample One value at a time.mq5" - analogue of "MACD Sample.mq5", in which we get one value from the indicators at a time.
  • "MACD Sample 4 to 5 MQL4 style.mq5" - MQL4 Expert Advisor rewritten to MQL5 with minimal modifications and with access to indicators in MQL4 style.

Testing was conducted on USDJPY,M30 from 2017.02.01 to 2018.01.16 on MetaQuotes-Demo server. After each test (be it changing the Expert Advisor or changing the tick generation mode) the terminal was rebooted. Computer configuration:

I added the Profit column , the time of the tests was taken off the second pass just in case. Yellow highlights (formatting) left as in the article, because I copied the table, I just did not want to make a new one.


Advisor Each tick based on real ticks All ticks OHLC


Profit, $Test time Trades Trades Profit
Test time Trades Profit
Trades Test time Trades Trades
1 MACD Sample.mq5 -467.74
0:00:29.937 122 244 -476.690:00:22.110 122 -754.10
244 0:00:01.015 119 238
2 MACD Sample One value at a time.mq5 -467.740:00:30.110 122 244 -476.69
0:00:23.797 122 -754.10244 0:00:01.141 119 238
3 MACD Sample 4 to 5 MQL4 style.mq5 -428.04
0:00:57.156 122 244 -449.90
0:00:42.078 122 -740.48
244 0:00:02.062 119 238

Confirmed that the profit is different for the third EA. I have not found out the reason.



 

I found a possible reason for the net profit mismatch - the Expert Advisor "MACD Sample 4 to 5 MQL4 style.mq5" has errors in stop modification.

Since the code was taken from the MQL4 version, it is possible that this is a legacy error.

 
Rashid Umarov:

I found a possible reason for the net profit mismatch - the Expert Advisor "MACD Sample 4 to 5 MQL4 style.mq5" has errors in stop modification.

Since the code was taken from the MQL4 version, it is possible that this is a legacy error.

This is not the problem - this error occurs when the new StopLoss level does not differ from the current one

 
Rashid Umarov:
My results according to the article

Confirmed that the profit is different for the third EA. I did not find out the reason.

Andrey F. Zelinsky found out that MACD Sample logic differs between MQL4 and MQL5 versions. The difference is in the calculation of TP and SL levels.