Beta calculation for a list of stocks
Author: spaceman1969
Creation Date: 1/28/2010 12:26 PM
profile picture

spaceman1969

#1
I am new to programming in C#. I have some code that calculates Beta on a list of stocks and output the values to a text file.

Anyone who can see why the script is not working?

Thanks,
Jorgen

CODE:
Please log in to see this code.
profile picture

Eugene

#2
Install Community.Indicators from Extensions and run this code, making sure the number of bars loaded is at least = Beta Period:
CODE:
Please log in to see this code.
profile picture

aykuts

#3
Hi,

I copied / pasted the following code to my strategy:
CODE:
Please log in to see this code.


But the code returns `type or namespace name Beta doesnt exist.... are you missing an assembly difference?` error.

- I think I have an updated version of community components,
- Used `using Community.Components;` in the directives,
- And, despite the fact that I dont need to, I gave a reference to the respective dll that is saved under the wealthlab default folder.

Still, this code doesnt work for me.

Any suggestions?

thanks in advance.

Aykut




profile picture

aykuts

#4

I am sorry, it is the `community indicators` not the `community components` that I should be using.

problem is resolved.

thanks.

profile picture

Eugene

#5
Hi Aykut,

The only suggestion is to carefully reread my post #2 above:

* The very first sentence in post #2 instructs to install Community Indicators.
* The code in #2 doesn't refer to Community Components at all.
* Beta is an indicator. So you need to add a "using Community Indicators"; instead.

I know we've all been there. Happened to me as well. ;)
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).