Moving Average - page 82

Sergey Golubev
Moderator
113445
Sergey Golubev  
ejazahmed:
We should all be grateful to our friend for reminding and contributing here.

Who is your friend?

permanent talking .. friend .. friend ... on many threads.

The_Snowman
87
The_Snowman  

Did that work OK for you? I put a couple on & it slowed my computer down!

Thanks for posting

biddick
339
biddick  

I do not have CPU consumption problems with the indicator.I am still studying the indicator ,it has some imteresting(strange?) features.

Mladen Rakic
154428
Mladen Rakic  

...

There are 2 reasons why it can do that :

In the calculation it has a double average period loop per each bar (period*period sub-loops, it does not get much slower than that). To avoid it for long ma period calculation the only solution (lacking a completely different calculation way) is to limit the number of calculated bars. Attaching a version that can do that.

Also, if the indicator is saved under different name than the original, in multi time frame it will not work and it will slow the PC down significantly. That is corrected too.

The_Snowman:
Did that work OK for you? I put a couple on & it slowed my computer down! Thanks for posting
Files:
The_Snowman
87
The_Snowman  
mladen:
There are 2 reasons why it can do that :
In the calculation it has a double average period loop per each bar (period*period sub-loops, it does not get much slower than that). To avoid it for long ma period calculation the only solution (lacking a completely different calculation way) is to limit the number of calculated bars. Attaching a version that can do that.

Also, if the indicator is saved under different name than the original, in multi time frame it will not work and it will slow the PC down significantly. That is corrected too.

Thanks for effort, but I put 4 on 1 chart (200, 50, 20 & 10) and very slow to see the chart when I change from Daily to 4 hour to 1 hour, any idea about that?

Mladen Rakic
154428
Mladen Rakic  

...

Limit the bars displayed (set the MA_BarsToCountparameter to some small value - 3 to 4 hundred should be OK) If you try it on all bars, the complexity of it will kill you when you change time frames or symbols (for example for a period 200 it loops 40.000 times on each and every bar). If we want to keep the original values (without making approximations) the only way is to limit the number of calculated bars ...

But even then, long calculating periods will slow you down : indicator will recalculate up to 3 last bars and for ma period set to 200 it means 120.000 lops to calculate appropriate weights ...

The_Snowman:
Thanks for effort, but I put 4 on 1 chart (200, 50, 20 & 10) and very slow to see the chart when I change from Daily to 4 hour to 1 hour, any idea about that?
Mladen Rakic
154428
Mladen Rakic  

iDwma dll version ...

Or better yet, use this one.

It is using the brute force of a c++ dll in order to make the whole thing much faster. Attached the c++ source too (in the zip file). Unpack the dll from the zip file (if there is some problem with unpacking, please use 7zip from this link : 7-Zip ) and copy it to experts\libraries sub-folder of metatrader. It still has the bars limitation in it but you will see that it works much faster

The_Snowman:
Thanks for effort, but I put 4 on 1 chart (200, 50, 20 & 10) and very slow to see the chart when I change from Daily to 4 hour to 1 hour, any idea about that?
Files:
idwma.zip 30 kb
idwma_2.mq4 3 kb
Mladen Rakic
154428
Mladen Rakic  

iDWma metatrader 5 version ...

Here is a metatrader 5 version of iDWma.

It uses the same dll as the metatrader 4 version (no need to change anything in the dll in order to use it in metatrader 5) As an addition, this one has a slope coloring already done. In order to make the indicator work properly, copy the iDWma.dll from the upper post to MQL5\Libraries folder

Files:
idwma_5.png 63 kb
idwma.mq5 4 kb
The_Snowman
87
The_Snowman  
mladen:
Or better yet, use this one. It is using the brute force of a c++ dll in order to make the whole thing much faster. Attached the c++ source too (in the zip file). Unpack the dll from the zip file (if there is some problem with unpacking, please use 7zip from this link : 7-Zip ) and copy it to experts\libraries sub-folder of metatrader. It still has the bars limitation in it but you will see that it works much faster

That's much better now, you must be programmer at work to do all this?

Now we need good system to provide trade signals; any suggestions?