¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Anyway to load symbols and dates into IB charts using code (not manually) from Excel?


 

I wanted to load specific symbols and dates (i.e.: WFC 2/3/2016, C 4/1/2015, etc.... ) into IB charts using code (Python, preferably), and wanted to know if that was possible using the TWS API interface. Ideally, it would load 9 charts per tab, and do so for multiple tabs using an Excel spreadsheet, without needing to manually enter anything.?


Also, I would like to program a keyboard key (i.e.: shift+r) so that the date of the current, selected chart could be recorded and fed into an Excel spreadsheet. (i.e: shift +r would record current chart's symbol and date).?



Any help would be greatly appreciated.


Thanks




 

Hi,

Are you referring to TWS charts? If so, unfortunately no there's no way that the parameters of a particular TWS chart could me modified or read through the API.

Josh


 

I'm pretty surprised.. Do you know anyway to auto-load symbols/dates onto the TWS charts? It would seem like a task everyone with a backtester would need to do without having to mindlessly type in symbols to view specific dates/symbols (task can be quite tedious with a large enough sample size).?


 

I think more typically a backtesting engine would simply extract data from the Tws API and not using its charting capabilities, since there would is no way to plot arbitrary graphs in Tws- for instance showing the performance of a customized strategies over time. However with the IB API however because of the historical data limitations more commonly the data would have to be stored externally anyway, in a database or some other structure.

Its possible to save charts and chart templates in Tws but there isn't a generalized way to automate this.?

Josh


 

Analyzing dates is more for strategy optimization, not replacing backtesting. ?For example, when analyzing a sample, you want to look or all the times the algorithm lost money. You then compare it to the ones it made money, and then try optimize your factors (doing it graphically). A backtest would only tell you if the algorithm is net positive/negative.?

Just wondering if IB charts save the date and symbol you saved it as. (i.e.: if you save a chart with the ticker "C" and date "12/21/2015, would it be able to load both if you open up the chart?) Learning code right now, so haven't had the chance to pay for IB data fees. . ?