Chart widgets receive the chart's selected instrument and timeframe in their Framework.context, and subsequent changes are similarly received as a WIDGET_CONTEXT_CHANGE message. Your widget can also detect the selected instrument and timeframe, together with a list of the chart's candles, using a ChartWidget_OnContextChange() handler.
A chart widget can change its chart's instrument and/or timeframe by using ReportContext().