I am trying to calculate a standard deviation of a series. I realize that there is a function for that but what I want to do is a little bit different so I am trying to define a dataseries to do my calculation.
CODE:
Please log in to see this code.
I have broken it down into parts and it all compiles correctly except when I try to use the Sqrt function in the last line. I get an error message
Sqrt is a type but is being using like a variable.
I checked Sqrt in http://www2.wealth-lab.com/WL5Wiki/Sqrt.ashx?HL=sqrt and it gives the definition as:
DataSeries Sqrt(DataSeries ds)
I don't know what I am doing wrong here.
Thanks for your help.
Rich Man
Size:
Color:
1. Install Community Indicators library.
2. Insert a "using" directive (using Community.Indicators;)
2. Change the last line to:
DataSeries MyStdDev = Sqrt.Series(DevSquared);
Even though the Sqrt doesn't come with an example, you should know that any DataSeries from a compiled indicator library can be created and initialized either in the "new DataSeries..." fashion, or via a call to the "Series" method. The abovementioned applies to any formal indicator i.e. DataSeries.
Size:
Color: