Floor function
Author: nexial_1002002
Creation Date: 10/5/2009 5:53 PM
profile picture

nexial_1002002

#1
Hi, I seem to require an exact rounded calculation in one of my scripts. I need to know what the .NET equivalent for a "floor" call is. That is I want to round an amount to the nearest whole integer, and I was able to do this in WL4 with the floor function, and I really got to say the programming guide in WL5 is useless essentially, certainly not as useful as the older guide from WL4.

Anyway, the old call was value=floor(aseriesvalue); from a float. The guide did not actually explain what the significance of declaring a variable by,say double sum = 0d; It is unclear if by the "0d" equalling this value if that is the function that will round a double to an integer.
profile picture

Cone

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


QUOTE:
I really got to say the programming guide in WL5 is useless essentially, certainly not as useful as the older guide from WL4
We don't intend to rewrite all the material already available to you about .NET and C#. The WealthScript Programming Guide instructs, by example, how to accomplish typical tasks for programming Trading Strategies with WealthScript.
profile picture

thodder

#3
You may want to reference the Microsoft .NET Framework library for help on C# (currently: http://msdn.microsoft.com/en-us/library/d11h6832(VS.80).aspx). Depending on how you use the Floor method, the Math.Round() method may be what you want for rounding (http://msdn.microsoft.com/en-us/library/system.math.round(VS.80).aspx).

It would be helpful if the WLP Help menu contained a link to the Microsoft Framework documentation on the web.

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