The DLL has 2 basic functions returning the value of data1.Close[bars] and data2.Close[bars].
The function using data1 stream works fine. But when attempting to use data2 stream an error occurs.
Here is the code of the functions
Code: Select all
var C30,C2 :double;
function GetCloseData1(pELObj : IEasyLanguageObject; Bars : integer): double; stdcall;
begin
C2 := pELObj.CloseMD[data1].AsDouble[Bars];
Result := C2;
end;
function GetCloseData2(pELObj : IEasyLanguageObject; Bars : integer): double; stdcall;
begin
C30 := pELObj.CloseMD[data2].AsDouble[Bars];
Result := C30;
end;
exports GetCloseData1;
exports GetCloseData2;
Code: Select all
inputs: barsback(0);
vars: myCloseData1(0),myCloseData2(0);
external: "TmolosMechano.dll", double, "GetCloseData1", IEasyLanguageObject {self},int {length};
external: "TmolosMechano.dll", double, "GetCloseData2", IEasyLanguageObject {self},int {length};
myCloseData1 = GetCloseData1(self,barsback);
myCloseData2 = GetCloseData2(self,barsback);
plot1(myCloseData1);
plot2(myCloseData2);
Is there something special to do when referencing a data stream other than the first one (data1) in the DLL? Isn't IEasyLanguageObject carrying all data streams available in a chart?
Any help would greatly appreciated. I am out of ideas since data1 works fine.