¿ªÔÆÌåÓý

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

Re: Multiple symbol request speed


 

Try to obtain the data asynchronically



Example from ib-ruby

Source-code:

Documentation: https://ib-ruby.github.io/ib-doc/market_price.html

i.e.
> market_data = ["BMY", "CAT","DE","FL","GE","IBM","K","KO","T","VZ"].map{|y| IB::Stock.new( symbol: y).verify.first}
> market_data.map{|c| c.market_price(thread: true)}.join
> puts market_data.sort_by( &:symbol).map{|c| [c.symbol, c.misc.to_f].join " -> "? }.join "\n"
BMY -> 54.05
CAT -> 129.99
DE -> 147.87
FL -> 50.88
GE -> 8.02
IBM -> 121.7
K -> 61.98
KO -> 50.3
RH -> 113.2
T -> 30.32
VZ -> 60.23
?=> nil
>
It takes about 10 sec. to obtain the results.

have fun.

Join [email protected] to automatically receive all group messages.