Math Functions
Author: pfelix
Creation Date: 8/9/2008 8:59 PM
profile picture

pfelix

#1
Hi, I am new to C# so bear with me if this is a basic question.

How do I make basic math functions available (abs, round, etc...)? I tried to add "using System.Math", but that namespace does not seem to be available.

Also, is there a document that list the contents of each of the available namespaces? I have reviewed the documents supplied with WLP5, but am still a little fuzzy on this issue.

Thanks,
Paul
profile picture

Eugene

#2
Hi Paul,

QUOTE:
I tried to add "using System.Math", but that namespace does not seem to be available.


You don't have to add System.Math to the list of included namespaces as it's already available with the using System directive - just prefix desired function with Math. in your code:

CODE:
Please log in to see this code.


QUOTE:
Also, is there a document that list the contents of each of the available namespaces?


Yes, and it's MSDN. Googling a .NET function with "msdn" in your query will bring up the MSDN page as a rule. Alternatively, you could download entire MSDN and install it on your PC:

Visual Studio Express 2008 Offline install (All-in-One DVD) - includes MSDN
MSDN Library (April 2007 Edition) – Includes Visual® Studio 2005 Service Pack 1 documentation.
profile picture

pfelix

#3
Thank you, Eugene. As a follow up, I am familiar with the MSDN, but was wondering where to get a list of available namespaces and a description of their contents for Wealthlab specific namespaces. So far I see the one namespace, WealthLab, with three class libraries. Are there any others? Is there a description of each of their contents such that I will know which to include in scripts?
profile picture

Eugene

#4
QUOTE:
Is there a description of each of their contents such that I will know which to include in scripts?


We follow this policy: if description of something isn't found in the QuickRef, User Guide or WealthScript (Language) Guide, then it's considered undocumented.
profile picture

Eugene

#5
P.S. And there you'll find many documented examples of using WealthLab namespaces and types e.g. WealthLab.LineStyle, WealthLab.Indicators and many more.