Navigation:  ActFX > Algorithmic Trading > Writing a strategy >

Using the tick history

Previous pageReturn to chapter overviewNext page

 

clip0725

 

In order to access tick chart data, you must declare an object from the TTickHistory class. The tick history will be stored in this object:

 

var

   History:TTickHistory;

 

You must also add a tick history setting (AddTickHistorySetting) in the procedure OnCreate, and indicate the procedures that will run when a new rate is received. This can be done as follows:

 

 

Example:

 

var

   History: TTickHistory;

 

procedure OnCreate;

begin

AddTickHistorySetting(@History, 'Tick History', 'EURUSD', 100);

History.OnNewRateEvent := @OnNewRate;

end;

 

 

procedure OnNewRate;

begin

...

end;

 

Note that the names of the procedures should be written with the @-prefix.