SetChartSymbolAndTimeframe
Description
Syntax
public SetChartSymbolAndTimeframe(symbol: string, period: number): booleanParameters
Return Value
Example
try {
// Change both symbol and timeframe
const success = this.api.SetChartSymbolAndTimeframe('EURUSD', 60)
if (success) {
console.log('Chart symbol and timeframe updated successfully')
}
// Change only timeframe
const timeframeOnly = this.api.SetChartSymbolAndTimeframe('', 240)
if (timeframeOnly) {
console.log('Chart timeframe updated to H4')
}
} catch (error) {
console.error('Failed to update chart:', error.message)
}Last updated