Build Your Own:
get_deltas() lets you poll only the symbols whose values have changed. Build it step by step:
Step 1 — Import the library
import icepython as iceStep 2 — Subscribe to symbols using get_quotes() with subscribe=True:
symbols = ['BRN 1!-ICE', 'HNG 1!-IUS']
fields = ['last', 'bid', 'ask']
ice.get_quotes(symbols, fields, subscribe=True)
Step 3 — Check which symbols have changed since the last reset:
changed = ice.get_deltas(fields, False)
print(changed)
Step 4 — (Optional) Use the changed list to pull only updated quotes:
data = ice.get_quotes(ice.get_deltas(fields, False), fields, True)
print(data)
Output:
()(('', 'last', 'bid', 'ask'), ('BRN 1!-ICE', 79.89, 79.89, 79.9))