About Hurst ratio, Dennis Yang volatility
Author: akuzn
Creation Date: 9/15/2012 8:49 AM
profile picture

akuzn

#1
Hi!
Didnt find Hurst ratios and Dennis Yang and Qiang Zhang volatility.
Do You have it as plans?

I tried to develop code of Hurst ratio. But seems it really increases calculation time of my strategies by 40-60%%. Im talking about computing this serie ones by call in execute method.

1. Could you watch and may be there will be some ideas to improve speed.
2. I tried to calculate 2 ratios in one pass - basic Hurst and Hm (at the end in commas).
Certainly i could create 2 different metods but i think it will take more time in summary.
Could you help me with creating 2 DataSeries by one pass? Just asking this question because still dont feel very friendly with code but i hope it is possible to merge these dataseries in one metod or class.
//
CODE:
Please log in to see this code.
profile picture

Eugene

#2
QUOTE:
1. Could you watch and may be there will be some ideas to improve speed.

Try replacing:
CODE:
Please log in to see this code.

With this block:
CODE:
Please log in to see this code.

Since it's not cached, the .Value method incurs a considerable processing overhead when calculating indicator values for every bar. This is why using the .Series method insures that Wealth-Lab will return a DataSeries from cache.


P.S. Also, you might want to implement caching in your DataSeries like suggested in this API document:

Create an Indicator Library | Download PDF
profile picture

akuzn

#3
CODE:
Please log in to see this code.


and

CODE:
Please log in to see this code.


give same result?.
I mean cached serie.
profile picture

Eugene

#4
Of course, they do give the same result.
profile picture

akuzn

#5
Thanks.
I ve tried to replace all Value. calculations by Series. ()[bar].
But i ve got another problem: 12 strategies load full memory and wealth-lab is working slowly.
So i decided to replace by Series. ()[bar] only mathmetical calculations. And others like Highest, Lowest to leave with Value.(bar,...) calls.
In this case i have 3% of free memory and 8 cores fully loaded! That what i was looking for a long time.
Result seems little bit improved - i mean speed of strategy loading and computing.


But i think there are some ways to improve speed of math functions.
The main load of cores i see with using StdDev, Log functions.
Is it possible to improve their speed by using other libraries?
Or for example is there difference in speed between StdDev call with calculation type sample or population?
If there is 20-30% difference i will replace with more quick call.
profile picture

Eugene

#6
There's nothing to optimize in Log.Series - it's a wrapper for built-in Math.Log function. Likewise, there is virtually no difference between the two StdDev calculation types. There's really pretty simple math behind it.
profile picture

akuzn

#7
Thanks.
Now i know i did all i could with your help.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).