I would like to develop some functions (or more appropriately methods) within a strategy code. To give you something specific lets assume that I would like to create some functions for skew and kurtosis. Since I am new to C# but do have some VBA, R and Matlab knowledge can you please help me with an example code of how a generic syntax could be. The point is to get familiar with developing some methods that get a Bars obsect or a DataSeries object or any other type of variables and returns another DataSeries. In the future I suppose that all these functions methods could be part of a DLL file that I could call into any strategy just by typing "using ABC" for example. Is this correct?
Size:
Color:
There is nothing specific to Wealth-Lab in developing a method. It's completely up to you what to put in getter,
Bars or
DataSeries, and what to return in setter.
A lot of sample classes, functions, and methods in:
Community Components library.
Some generic code illustrating how to access
properties.
Let me suggest something from our Wealth-Lab Wiki FAQ:
How do I start with C# ?
Size:
Color:
Is it possible to help me spot the mistake in the below code - The target is to find the average 1 bar return over the past n bars - the error I get is "Runtime Error: Index was out of range"
CODE:
Please log in to see this code.
Size:
Color:
First let me kindly ask, what's wrong about using Sum.Series vs. creating "your own" summation?
CODE:
Please log in to see this code.
Size:
Color:
Nothing wrong about Sum.Series - just trying to create some simples examples to move forward to more complicated methods I want to develop. Would you consider this kind of approach as inappropriate?
Size:
Color:
No, it's appropriate. I just changed the misbehaving loop slightly (IOOR error) and replaced S with Sum.Series for optimization.
Size:
Color: