OnParametersChange statements not executed [Resolved]

Bug reports and errors in the program
Message
Author
dema
Posts: 4
Joined: Fri Mar 29, 2013 1:29 am

OnParametersChange statements not executed [Resolved]

#1 Postby dema » Fri Mar 29, 2013 1:37 am

Hi, I am attempting to code an FT2 indicator but it seems that the OnParametersChange procedure is not executing statements when I change a parameter value when using my indicator in FT2.

A very simplistic code sample is below to demonstrate the problem. What I am expecting is that a Journal line is written upon a parameter value being changed in the FT2 -> List of Indicators -> (Select Indicator Name) -> Edit -> (Change a value) -> Apply -> Open Chart / X

Instead nothing happens.

I am using FT2 v.2.9.3 and Lazarus v.1.0.6 (full clean builds).

Any help & assistance is greatly appreciated.


Code: Select all

//---------------------------------------------------------------------------
// FT2_z1
//---------------------------------------------------------------------------

library FT2_z1;

uses
  IndicatorInterfaceUnit, TechnicalFunctions;

var

  // External variables
  SomeBoolean: boolean = true;
  SomeInteger: integer = 10;


//---------------------------------------------------------------------------
// Initialization procedure
//---------------------------------------------------------------------------

procedure Init; stdcall;
begin

  // indicator configuration
  IndicatorShortName('FT2_z1');
  SetOutputWindow(ow_ChartWindow);

  // external parameter definition
  AddSeparator('Common');
  RegOption('Some Boolean', ot_Boolean, SomeBoolean);
  RegOption('Some Integer', ot_Integer, SomeInteger);

end;


//---------------------------------------------------------------------------
// Deinitialization procedure (can be omitted)
//---------------------------------------------------------------------------

procedure Done; stdcall;
begin
     // do nothing
end;



//---------------------------------------------------------------------------
// On parameters change procedure (can be omitted)
//---------------------------------------------------------------------------

procedure OnParametersChange; stdcall;
begin
  Print('OnParametersChange');
end;



//---------------------------------------------------------------------------
// Calculation of a single bar
//---------------------------------------------------------------------------
procedure Calculate(index: integer); stdcall;
begin
  // do nothing
end;



exports
// these procedures should be declared as external
Init, Done, OnParametersChange, Calculate;


end.
Last edited by dema on Mon Apr 01, 2013 2:36 am, edited 1 time in total.

dema
Posts: 4
Joined: Fri Mar 29, 2013 1:29 am

Resolved.

#2 Postby dema » Mon Apr 01, 2013 2:35 am

Ok so I've been reviewing other code samples on this site and it seems that the correct procedure name is actually "OnParamsChange" not "OnParametersChange" (as per help file/template).

Thanks all for posting & sharing your code on this forum & also to the FT2 developers putting heaps of them in the examples FT2 directory.


Return to “Bug reports”

Who is online

Users browsing this forum: No registered users and 34 guests