GetLastProcessedTickTime

Returns the timestamp of the last processed tick for a symbol.

Syntax

GetLastProcessedTickTime(symbol: string): FTODate

Parameters

  • symbol: string - The symbol to get the last processed tick time for

Return Value

Returns an FTODate object representing the time of the last processed tick.

Description

The GetLastProcessedTickTime method returns the timestamp of the last processed tick for a specified symbol. This can be used to track the most recent market activity and ensure data freshness.

Example

// Get last tick time
const lastTickTime = this.api.GetLastProcessedTickTime("EURUSD");
console.log(`Last tick time: ${lastTickTime.toString()}`);

// Format components
console.log(
  `Date: ${lastTickTime.yearOf()}.${lastTickTime.monthOf()}.${lastTickTime.dayOfMonth()}`
);
console.log(
  `Time: ${lastTickTime.hour()}:${lastTickTime.minute()}:${lastTickTime.second()}`
);

// Check data freshness
const currentTime = this.api.TimeCurrent();
const timeDiff = currentTime.getTime() - lastTickTime.getTime();
const secondsDiff = Math.floor(timeDiff / 1000);
console.log(`Seconds since last tick: ${secondsDiff}`);

// Check if data is recent
const isRecent = secondsDiff < 60;
console.log(`Data is recent: ${isRecent}`);

Last updated