Sqrt is a type but is being using like a variable
Author: rmandel00
Creation Date: 12/16/2010 7:56 PM
profile picture

rmandel00

#1
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



profile picture

Eugene

#2
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.
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).