Using external Math/Stat Libraries
Author: ItsMyWealthLab
Creation Date: 5/2/2010 10:25 AM
profile picture

ItsMyWealthLab

#1
After working a few Weeks with WL5.6 now i at the point where i need advanced mathematic functions (residuing in an external dll)
in stratgies.
I have for the com library CatSSA.dll already created a runtime callable wrapper CatSSARCW.dll and struggle since days to ge the Functions
implemented in WL.

Below my code (Namespace, Class and Obj assigned) but still getting error messages cs0534 and cs0115.

Appreciate any help.

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using CatSSARCW;


namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
public class SSA : CatSSARCW.CatMainClass
{
protected override void Execute()// public static void Main()
{
SSA obj = new SSA();
bool set_DisplayMessages = true;
double[] arr = new double[50];
arr[0] = 50;
for (int i = 1; i < arr.Length; i++)
arr[i] = i + 1;
DrawLabel(PricePane, "The value is " + arr[0], Color.Black);
profile picture

Eugene

#2
QUOTE:
After working a few Weeks with WL5.6

There must be a time machine in your garage then. ;) Your trial has been taken less than a week ago.
QUOTE:
still getting error messages cs0534 and cs0115.

1. Because you've defined SSA as a nested class vs. creating an instance of CatSSARCW.CatMainClass:
CODE:
Please log in to see this code.

2. And because void Execute() is no longer a part of the MyStrategy class that derives from WealthScript.

P.S. When posting code, please always wrap it in between a pair of CODE tags.
profile picture

ItsMyWealthLab

#3
Got it. Thank you for your fast Reply.

Moved now forward to find a solution for converting an onedimensional double Array to an SafeArray to be sent out to the dll
and then getting back a safearray with the results to be plotted in the pricepane.

Did not figure out so far how to do this conversion array to safearray back and forth. Any Idea how to do that?

PS: It took my Friend 2 Weeks letting me playing with his WL to stop me using MS - so i am finally 3 Weeks now with WL.
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).