Weighted Moving Average bit slow compare to other moving average & I need WMA as its important part of my coding strategy. Can’t WMA be little faster?
any alternative like for example Wilders(100) == EMA(199)
@Fossil I don't know why in your case there is such discrepancy in execution times between WMA and other averages. In my case it is not as big:
...but most importantly, you didn't tell us why it bothers you so much? If your code seems sluggish it is most probably because of something else ...
@Milosz
May be you used value less than 15,, use 100+ value with WMA...
Is not that much of big deal but still this WMA speed troublesome & it’s the main ingredient of my secret sauce.
After much testing with different Moving Average, WMA work best with rest of my code.
@Fossil, one of the many great things about AmiBroker is that @Tomasz has put so much effort into making it as efficient as possible. I can say with a great deal of confidence that you will not find a way to implement a faster version of WMA that is still computationally correct.
Yes, I have used the default settings ...
I have asked, why does it bother you, because I still can't imagine a situation in which you notice this 35 milliseconds delay... Are you running this code 10 times per second or (the worst case scenario) inside a loop or what?
Even if you are a prop-trader or a scalper - average human reaction time is about 200-250ms.
For example, you can test your reaction time Here --> My record 216 ms
While WMA is slower than other MA functions (its calculation is more complex) I will not rely too much on a single execution Check&Profile result. Better evaluate the average Time per Call.
The speed displayed depends also on the number of loaded bars (images grabbed using 2 different tickers).
Anyway, I agree with @mradtke!
@mradtke Complete agree with you but trust me I am not complaining, it just simple query.
@Milosz I am way slower than you
The code run fine every day (no delay), just ask to find alternative of WMA and yes you are right this milliseconds difference doesn’t matter that much.
@beppe in my code I am not using WMA inside loop
Well, let's just say I have a faster mouse Here's the proof that I was not lying:
... but if you want to know the truth, I master my skills playing every day Buttons Hunter - The Game for AmiBroker 6.25. That's the key to "outstanding" mind-eye-hand coordination
But I'm sure, many users will beat me ...
Contrary to other averages, WMA is not single loop. MA, EMA, Wilders are all implemented as single loop so their complexity is constant regardless moving average period. WMA is two loops (nested) hence it is slower. 100-bar WMA is approximately 100 times slower than MA.