I'm trying to use a DLL original written for Tradestation in my PB DLL without having to use Tradestation.
The syntax of an external statement in EasyLanguage is:
external: ["<PATH>”,] [RETURN TYPE,] "<DLL FUNCTION NAME>",
[ARGUGMENT 1 TYPE, ARGUMENT 2 TYPE, …] ;
In EasyLanguage the code used with these DLL's is:
For my PB DLL I have come up so far with:
Can you help me to make me understand how IEasyLanguageObjectpointer (self) can be replaced in my PB, and turn this into a working code.
I suspect Tradestation passes an adres to that pointer which is not available in my DLL.
Kind Regards,
Rob
The syntax of an external statement in EasyLanguage is:
external: ["<PATH>”,] [RETURN TYPE,] "<DLL FUNCTION NAME>",
[ARGUGMENT 1 TYPE, ARGUMENT 2 TYPE, …] ;
In EasyLanguage the code used with these DLL's is:
external: "TSLpp.dll", float, "ProcessData", IEasyLanguageObject, LPSTR, double, double, double, double, double, double, double, int;
external: "TSLpp.dll", float, "GetArray1", IEasyLanguageObject, LPSTR;
ProcessData(self, "MyArrayOut1", Open, High, Low, Close, dayofweek(date), 0, 0, 1{put});
ProcessData(self, "MyArrayOut1", Open, High, Low, Close, dayofweek(date), 1, 0, 2{get});
for n=1 to 62 begin
v1[n]=MyArrayOut1[n];
end;
external: "TSLpp.dll", float, "GetArray1", IEasyLanguageObject, LPSTR;
ProcessData(self, "MyArrayOut1", Open, High, Low, Close, dayofweek(date), 0, 0, 1{put});
ProcessData(self, "MyArrayOut1", Open, High, Low, Close, dayofweek(date), 1, 0, 2{get});
for n=1 to 62 begin
v1[n]=MyArrayOut1[n];
end;
Code:
DECLARE FUNCTION ProcessData LIB "TSLpp.dll" (BYVAL pELObject AS PTR, BYVAL ArrayName AS ASCIIZ PTR, BYVAL SetOpen AS DOUBLE, BYVAL SetHigh AS DOUBLE, BYVAL SetLow AS DOUBLE, BYVAL SetClose AS DOUBLE, BYVAL SetDayofWeek AS DOUBLE, BYVAL PreprocessType AS DOUBLE, BYVAL unused4 AS DOUBLE, BYVAL SetPutGet AS INTEGER) AS SINGLE DECLARE FUNCTION GetArray1 LIB "TSLpp.dll" (BYVAL pELObject AS PTR, BYVAL ArrayName AS ASCIIZ PTR) AS SINGLE FOR i=0 TO Barcounter-1 CALL ProcessData(i, STRPTR("MyArrayOut1"), Open, High, Low, Close, dayofweek(),0,0,1) CALL ProcessData(i, STRPTR("MyArrayOut1"),Open, High, Low, Close, Dayofweek,1,0,2) CALL GetArray1(i ,STRPTR("MyArrayOut1")) FOR n=1 to 62 v1(n)=MyArrayOut1(n) Next n 'My Applicationcode Next i
I suspect Tradestation passes an adres to that pointer which is not available in my DLL.
Kind Regards,
Rob
Comment