In order to access a candle chart data, you must declare an object from the TCandleHistory class. The candle history will be stored in that object:
var History: TCandleHistory; |
You must also add a candle history setting (AddCandleHistorySetting) in the procedure OnCreate, and indicate the procedures that will run when a new rate is received, and when a new candle opens on the chart. This can be done as follows:
Example:
var History: TCandleHistory;
procedure OnCreate; begin AddCandleHistorySetting(@History, 'Candle History', 'EURUSD', CI_1_Minute, 200); History.OnNewCandleEvent := @OnNewCandle; History.OnNewRateEvent := @OnNewRate; end;
-------------------------------------------------------------------------------------------------
procedure OnNewCandle; begin ... end;
procedure OnNewRate; begin ... end; |
Note that the names of the procedures should be written with the @-prefix.