Method Developing
Author: Christos
Creation Date: 4/5/2011 3:54 AM
profile picture

Christos

#1
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?
profile picture

Eugene

#2
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# ?
profile picture

Christos

#3
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.
profile picture

Eugene

#4
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.
profile picture

Christos

#5
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?
profile picture

Eugene

#6
No, it's appropriate. I just changed the misbehaving loop slightly (IOOR error) and replaced S with Sum.Series for optimization.
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).