[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TS2000 Easy Language / DLL interface



PureBytes Links

Trading Reference Links

Here's an update after several hours of trial and error...

If any of the veterans sees any problems with this, feel free to correct me.

At 01:34 PM 9/22/99 -0700, David Wieringa wrote:
>I've got a working DLL, but I'm having trouble passing my own data back and
>forth.

I've found that values can be passed back and forth between EasyLanguage
(EL) and DLL's by value or by reference.

Currently I'm only doing it by value, but I also have an example of passing
by reference (compliments of TS Developer Support -- currently waiting for
permission to share it -- it has some good info).

When passing by value...

EL DATE  is a  float
EL TIME  is an int
EL OPEN  is a  float
EL HIGH  is a  float
EL LOW   is a  float
EL CLOSE is a  float

Passing by value has sufficed for me, since I'm building a C++ vector of
all of the price information inside my DLL and setting my EasyLanguage
studies to a MaxBarsBack of 0.

>Can any provide some examples?
>
>Please provide example code (EasyLanguage and VC++) to accomplish the
>following:
>
>1) pass a DATE from an EasyLanguage study to a 32bit DLL function

C++ CODE:

	float PASS_DATE(float theDate) {
		return theDate;
	}

EASY LANGUAGE CODE:

	DefineDLLFunc: "c:\dev\MyDLL.DLL", FLOAT, "PASS_DATE", FLOAT;
	theDate = GET_OPEN_VAL(DATE);

>
>2) pass a TIME from an EasyLanguage study to a 32bit DLL function
>

Same as DATE example, but replace float with int and DATE with TIME.

>3) pass a PRICE (O, H, L, C) from an EasyLanguage study to a 32bit DLL
>function

Just like the date.

>4) pass an input to an EasyLanguage study to a 32bit DLL function

Currently the only one I tried was an integer input (e.g. 300).  It just
occurred to me that the TS user could input a non-integer if they were
awnry, so I'll probably need to research this more for the safest possible
solution.

>5) pass a result from an EasyLanguage function (e.g. PriceScale) to a 32bit
>DLL function

I haven't tried this yet.


I'm using TS2000i and MS VC++ 5.0.

Hope that saves someone some frusteration.

Dave