a trading strategy based on Elliott Wave Theory - page 67

 
Probably in real time such figures are acceptable (although there is no limit to perfection :), but with history tests, as far as I understand, the situation is rather difficult, even with a short sample. I hope you don't suspect me to be an opponent of the use of computer calculations? :). Just after reading the thread I got the impression that it would be desirable to speed up the algorithm considerably.

Of course there is no doubt that we would like to get a faster algorithm for calculations, especially for history tests, but on the other hand this methodology does not require a multimillion runs on the tester, as it is required for traditional fitting on historical data, which most MT4 users like to use assiduously attacking creators of this product (Give more greedy pills!!!); o). It is necessary to realize that one run of Expert Advisor, created by this methodology in terms of applicability of results will knowingly be superior to optimized by 10000000000 runs EA, the results of which its author is able to wait even in this lifetime;o))). I'm just saying it based on my experience of creating a random guessing system described above in this thread at the very beginning. The optimization of an Expert Advisor based on methods of matstatistics consists mainly in a logical improvement of the algorithm with minimum parameters to be fitted (each parameter has a limited area for variation as well), but not in searching for some "optimal" values of different oscillators and moving average and some ratios found on the global maximum in n-dimensional space as required for the standard history fitting. The obtained result shown in the above posts was probably obtained by conducting no more than fifty full runs of the algorithm on the available history. After each run, the algorithm was refined and improved. And at the current moment I am still doing the same thing. I do 2-3 runs a day, analyze the results and improve the algorithm. I have not completely finished yet, but I have already launched the first, more or less working version on the real account. I have not made deals on it yet. The Expert Advisor is waiting for the euro to turn down.
 
solandr, in order to speed up/optimise testing time - have you used a custom indicator or arrays containing X,X^2, and so on?
 
I don't use the custom indicators as I wrote that every call of it is punched in the tester log. I have introduced a Murray levels indicator in the Expert Advisor itself. I have not yet invented arrays that specifically speed up calculations of the Expert Advisor. Frankly speaking, I do not know what can be invented. Information on calculation of previous bars (channel borders) is naturally stored in arrays and is not recalculated on a new bar. I think I have practically exhausted all my algorithm in terms of speed and will not be able to speed it up any faster. But I'm not quite clear about arrays containing X,X^2. To what extent can finding values over a large array of X,X^2 reduce computation time (squaring)? Do you have computational comparison data? It would be interesting to have a look at them.
 
That is for Y=A*X+B on each new bar for each new channel ?

Now I looked and understood - it is possible to optimise the EA. The gain should be (N+1)/2 , where N is the maximum channel length (your current version uses 300 - so the gain should be 150 times).
 
As far as I understand you are proposing to organize a cubic array, each row of which will be some millions and in it seek ready answers Y with 3 different parameters A,X,B? Or am I not quite getting the idea?
 
No, I just propose to do the calculation on each bar only once, and then use that value N times (an array is formed, no doubt :))
 
How is this possible, if we have channels on every bar moving slightly, changing their boundaries?
 
I cannot replace the algorithm completely (I still need to do some serious work), but I can paste a bit of an optimized algorithm into a regular one. It means that all preliminary calculations for the optimized algorithm are done but the channel is calculated in the usual way. Here is the log:
2006.07.04 23:04:37 ChannelStDev3 GBPCHF,M15: Execute deinit()<br / translate="no"> 2006.07.04 23:04:37 ChannelStDev3 GBPCHF,M15: Normal script time+optimization579 ms
2006.07.04 23:04:36 ChannelStDev3 GBPCHF,M15: a=-0.0001 b=2.2628 lastBar1 firstBar=105 StDev=0.001
2006.07.04 23:04:36 ChannelStDev3 GBPCHF,M15: 140 channels matching the criterion were found on 1000 bars
2006.07.04 23:04:36 ChannelStDev3 GBPCHF,M15: They are in 1 series
2006.07.04 23:04:36 ChannelStDev3 GBPCHF,M15: initialized
2006.07.04 23:04:35 ChannelStDev3 GBPCHF,M15: loaded successfully
2006.07.04 23:04:28 ChannelStDev GBPCHF,M15: removed
2006.07.04 23:04:28 ChannelStDev GBPCHF,M15: deinitialized
2006.07.04 23:04:28 ChannelStDev GBPCHF,M15: executing deinit()
2006.07.04 23:04:28 ChannelStDev GBPCHF,M15: Normal script time 547 ms
2006.07.04 23:04:27 ChannelStDev GBPCHF,M15: a=-0.0001 b=2.2628 lastBar1 firstBar=105 StDev=0.001
2006.07.04 23:04:27 ChannelStDev GBPCHF,M15: 140 channels matching the criterion were found over 1000 bars


Thus, the time of the optimised algorithm should be approximately (579-547)=32 milliseconds. Roughly, the gain is 547/32=17 times. This is certainly not 500 times as I assumed, you still need to check. Perhaps I did not take into account incompressible procedures that take more time than I thought. I'll try to check tomorrow.
 
Measured the two blocks of calculations separately.
2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: deinitialized<br/ translate="no"> 2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: Execute deinit()
2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: a=0.0071 b=146.7474 lastBar1 firstBar=50 StDev=0.1056
2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: Found 820 channels meeting criterion over 1000 bars
2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: They are in 8 series
2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: Time of conventional algorithm390 ms
2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: Time of optimized algorithm0 ms
2006.07.05 14:34:17 ChannelStDev3 EURJPY,M15: initialized
2006.07.05 14:34:15 ChannelStDev3 EURJPY,M15: loaded successfully


It remains to be seen if the optimized block will calculate correctly. At the same time I found out that working with objects takes considerable time (almost one third of the non-optimized variant) - drawing in the backtest is undesirable. Although
 
Re-did it, with Print
<br/ translate="no"> 14:54:04 ChannelStDev3 EURJPY,M15: k=64 a=0.002 b=146.8379 sigma=-1370529.6008
14:54:04 ChannelStDev3 EURJPY,M15: k=63 a=0.0025 b=146.829 sigma=-1348950.2071
14:54:04 ChannelStDev3 EURJPY,M15: k=62 a=0.0029 b=146.8197 sigma=-1327370.2369
14:54:04 ChannelStDev3 EURJPY,M15: k=61 a=0.0033 b=146.8105 sigma=-1305795.8008
14:54:04 ChannelStDev3 EURJPY,M15: k=60 a=0.0038 b=146.8016 sigma=-1284233.323
14:54:04 ChannelStDev3 EURJPY,M15: k=59 a=0.0042 b=146.7921 sigma=-1262664.9732
14:54:04 ChannelStDev3 EURJPY,M15: k=58 a=0.0046 b=146.7844 sigma=-1241133.5221
14:54:04 ChannelStDev3 EURJPY,M15: k=57 a=0.005 b=146.7769 sigma=-1219610.1431
14:54:04 ChannelStDev3 EURJPY,M15: k=56 a=0.0055 b=146.7678 sigma=-1198064.4492
14:54:04 ChannelStDev3 EURJPY,M15: k=55 a=0.0058 b=146.7611 sigma=-1176563.0841
14:54:04 ChannelStDev3 EURJPY,M15: k=54 a=0.0062 b=146.754 sigma=-1155059.1345
14:54:04 ChannelStDev3 EURJPY,M15: k=53 a=0.0066 b=146.7469 sigma=-1133558.635
14:54:04 ChannelStDev3 EURJPY,M15: k=52 a=0.007 b=146.7398 sigma=-1112061.7881
14:54:04 ChannelStDev3 EURJPY,M15: k=51 a=0.0073 b=146.7342 sigma=-1090593.6002
14:54:04 ChannelStDev3 EURJPY,M15: k=50 a=0.0074 b=146.7327 sigma=-1069186.857
14:54:04 ChannelStDev3 EURJPY,M15: k=49 a=0.0074 b=146.733 sigma=-1047808.1245
14:54:04 ChannelStDev3 EURJPY,M15: k=48 a=0.0073 b=146.7346 sigma=-1026446.748
14:54:04 ChannelStDev3 EURJPY,M15: k=47 a=0.0069 b=146.7404 sigma=-1005141.2611
14:54:04 ChannelStDev3 EURJPY,M15: k=46 a=0.0064 b=146.7494 sigma=-983876.6836
14:54:04 ChannelStDev3 EURJPY,M15: Optimized algorithm time 31 ms
14:54:05 ChannelStDev3 EURJPY,M15: Ordinary algorithm time 875 ms
14:54:05 ChannelStDev3 EURJPY,M15: They are in 6 series
14:54:05 ChannelStDev3 EURJPY,M15: Found 824 channels that meet the criteria, over 1000 bars
14:54:05 ChannelStDev3 EURJPY,M15: a=0.0064 b=146.7494 lastBar1 firstBar=46 StDev=0.1044
14:54:05 ChannelStDev3 EURJPY,M15: Execute deinit()
14:54:05 ChannelStDev3 EURJPY,M15: deinitialized
14:54:05 ChannelStDev3 EURJPY,M15: removed


Problem with sigma though :)
Reason: