A little surprised :) Thought I'd share and ask a NOT rhetorical question. - page 23

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
Are you going to divide one (not necessarily a multiple of 2) by another (not necessarily a multiple of 2) by a bit shift?
Ok, I'll throw in what I've got, and then you can decide for yourself whether you need it or not.
gcd(2n + 1, 2(n + k) + 1) = gcd(2(n + k) + 1, 2n + 1) = gcd(2n + 1, k)
--
Two lectures by STL creator Alexander Stepanov on Yandex
// On the subject of calculating NOD - second lecture. But I suggest to see/listen to both of them. Cool lectures, clever man, just nice. Yes, and useful.If with bit shifts, go for it. If with modulo division, don't.
Dividing by successive offsets
interesting figures at the end of the article:
This algorithm will execute in the worst case in (n-1)! iterations, where n is the bit depth of the divisible. In summary, in comparison with the sequential addition algorithm, this algorithm produces a gain of up to 9 times for 8-bit numbers, and up to 546 times for 16-bit numbers.
So here's what I got:
it seems to be working fine. please test all the holes.
// tweaked it, it's nicer this way.That's weird, it's not very fast.
2011.04.03 22:56:59 gcdSpeedTest (EURUSD,M20) Common time GreatestCommonDivisor(random(),random()) = 7656ms; // 10000000 calls
2011.04.03 22:56:51 gcdSpeedTest (EURUSD,M20) Common time gcd(random(),random()) = 5234ms; // 10000000 calls
That's weird, it's not that much faster.
2011.04.03 22:56:59 gcdSpeedTest (EURUSD,M20) Common time GreatestCommonDivisor(random(),random()) = 7656ms; // 10000000 calls
2011.04.03 22:56:51 gcdSpeedTest (EURUSD,M20) Common time gcd(random(),random()) = 5234ms; // 10000000 calls
I have a bigger difference. Yours is 3-4 times faster, but don't forget that in C++ the difference is reduced by a factor of 2-2.5, so you are honestly 1.5 times faster.
I have a bigger difference. Yours is 3-4 times faster,
but don't forget that in C++ the difference is reduced by 2-2.5 times, so you're honestly ahead by 1.5 times.
And we'll see.
So far we have a preliminary version in mql5. Friendly testing, looking for bugs.
I have made it as a structure.
I have made all operations in two forms - with and without normalization. I have obtained a flexible structure.
If you suspect the possibility of overflow - you use a version with normalization, without fear - you save time (normalization can be done later, when the foam has accumulated).
There is a simple test in archive, but it is desirable to test harder.
thanks at least admit it - you cut emoticons, but who removes whole posts?
About that, Academic, I think it's great that you have a so-called "calculator", but i would like to clarify if you can automatically optimise it in the course of trading?
Especially for this thread I published the latest MT5 tester results (anyone will be able to repeat the tests after the next update).
This is what the MetaTrader 5 tester can do, and even more so with a full infrastructure layout (reports, charts, results, visualisation).
Especially for this thread I published the latest results of MT5 tester (anyone will be able to repeat the tests after the next update).
That's what the MetaTrader 5 tester can do, and even with a full layout (reports, charts, results, visualization).
7 symbols, all ticks, since 2000, two parameters ( variants 200 * 200 )- 40000 passes, with a hundred orders per day for each symbol.
How long does it take?
take 10 years - 356 * 10 * 100 * 7 = 25 000 000 deals
we take approximately 10 ticks per minute
and 10 years - 365 * 10 * 1440 * 10 = 52 000 000 ticks on one symbol. And if we're being honest, they are ticking on every symbol. So, we should honestly multiply by 7. And it is not 10 ticks per minute. And sometimes it's 300.
How long does it take?