custom indicator crashes app

Bug reports and errors in the program
Message
Author
varontron
Posts: 5
Joined: Sat Apr 18, 2009 11:36 pm

custom indicator crashes app

#1 Postby varontron » Wed May 20, 2009 10:35 pm

Hi,
Attempting to load _really_ simple (like one horiz. line) indicators in FT2 crashes the app.

I assume it's because Delphi is compiling with the old FT1 libs.

If true, can you recommend the best proc for resolving--I'd like to avoid a teardown. If false, what could it be? I'm stumped.

Thx,
dv

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

Re: custom indicator crashes app

#2 Postby Terranin » Thu May 21, 2009 10:24 am

varontron wrote:Hi,
Attempting to load _really_ simple (like one horiz. line) indicators in FT2 crashes the app.

I assume it's because Delphi is compiling with the old FT1 libs.

If true, can you recommend the best proc for resolving--I'd like to avoid a teardown. If false, what could it be? I'm stumped.

Thx,
dv


It is not a compillation problem I think, maybe some problems in code. Send your source code and I will see.
Hasta la vista
Mike

varontron
Posts: 5
Joined: Sat Apr 18, 2009 11:36 pm

#3 Postby varontron » Thu May 21, 2009 7:53 pm

Hi,

I sent a bug report from the crash.

Here is the code that caused the crash:

Code: Select all

library TestIndicator;
uses
// use interace unit
IndicatorInterfaceUnit;

//var
//i: Integer;
// external parameters

procedure Init; stdcall;

begin

end;

procedure Calculate(index: integer); stdcall;

begin
Print('test');


end;

exports

Init, Calculate;

end.


It compiled and installed without error. Adding it to the chart--no go.

Thx,
dv

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#4 Postby Terranin » Thu May 21, 2009 11:07 pm

varontron wrote:Hi,

I sent a bug report from the crash.

Here is the code that caused the crash:

Code: Select all

library TestIndicator;
uses
// use interace unit
IndicatorInterfaceUnit;

//var
//i: Integer;
// external parameters

procedure Init; stdcall;

begin

end;

procedure Calculate(index: integer); stdcall;

begin
Print('test');


end;

exports

Init, Calculate;

end.


It compiled and installed without error. Adding it to the chart--no go.

Thx,
dv


Init procedure is not complete, you should at least have following lines:

IndicatorShortName(<Indicator name>);
SetOutputWindow(ow_ChartWindow);
Hasta la vista

Mike

varontron
Posts: 5
Joined: Sat Apr 18, 2009 11:36 pm

#5 Postby varontron » Fri May 22, 2009 5:57 am

Hi,

Thanks for the tip. I added the lines as you suggested--unfortunately, no luck.

I sent another bug report, fwiw.

thx,
dv

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#6 Postby Terranin » Fri May 22, 2009 11:46 am

varontron wrote:Hi,

Thanks for the tip. I added the lines as you suggested--unfortunately, no luck.

I sent another bug report, fwiw.

thx,
dv


Ok, I compiled your indicator, it needs one more line in Init - IndicatorBuffers(0);
Hasta la vista

Mike

varontron
Posts: 5
Joined: Sat Apr 18, 2009 11:36 pm

#7 Postby varontron » Fri May 22, 2009 4:47 pm

You have the magic touch. Thanks!

For clarity, here is what worked:

Code: Select all

library TestIndicator;
uses
// use interace unit
IndicatorInterfaceUnit;

//var
//i: Integer;
// external parameters

procedure Init; stdcall;
begin
IndicatorShortName('test');
SetOutputWindow(ow_ChartWindow);
IndicatorBuffers(0);
end;

procedure Calculate(index: integer); stdcall;
begin
Print('test');
end;

exports
Init, Calculate;

end.


Thanks again!


Return to “Bug reports”

Who is online

Users browsing this forum: No registered users and 45 guests