1212
1313def handle_instrument_info (addon , alias , full_name , is_crypto , pips , size_multiplier , instrument_multiplier ):
1414 global req_id
15- global alias_to_order_book
16- global alias_to_instrument
17- global liquidity_sizes
18- global DEFAULT_LIQUIDITY_SIZE
1915
2016 instrument = {
2117 "alias" : alias ,
@@ -44,26 +40,17 @@ def handle_instrument_info(addon, alias, full_name, is_crypto, pips, size_multip
4440
4541
4642def handle_instrument_detached (addon , alias ):
47- global alias_to_order_book
48- global alias_to_instrument
4943 del alias_to_order_book [alias ]
5044 del alias_to_instrument [alias ]
5145
5246
5347def handle_depth_info (addon , alias , is_bid , price , size ):
54- global alias_to_order_book
5548 order_book = alias_to_order_book [alias ]
5649 bm .on_depth (order_book , is_bid , price , size )
5750
5851
5952# callback triggered with periodic interval, right not it is not configurable and used
6053def on_interval_draw_liquidity_info (addon ):
61- global alias_to_order_book
62- global alias_to_ask_liquidity_indicator
63- global alias_to_bid_liquidity_indicator
64- global alias_to_instrument
65- global liquidity_sizes
66-
6754 for alias , order_book in alias_to_order_book .items ():
6855 if alias in alias_to_ask_liquidity_indicator and alias in alias_to_bid_liquidity_indicator :
6956 ask_liquidity_indicator = alias_to_ask_liquidity_indicator [alias ]
@@ -81,10 +68,6 @@ def on_interval_draw_liquidity_info(addon):
8168
8269
8370def handle_register_indicator_response (addon , request_id , indicator_id ):
84- global alias_to_ask_liquidity_indicator
85- global alias_to_bid_liquidity_indicator
86- global request_id_to_related_indicator_alias
87-
8871 alias , is_bid = request_id_to_related_indicator_alias [request_id ]
8972 if is_bid :
9073 alias_to_bid_liquidity_indicator [alias ] = indicator_id
@@ -95,7 +78,6 @@ def handle_register_indicator_response(addon, request_id, indicator_id):
9578# handler called each time respective UI settings are changed. Value type depends on initial registered type,
9679# might be floated, boolean, str, or tuple representing color
9780def on_settings_change_handler (addon , alias : str , setting_name : str , field_type : str , new_value ):
98- global liquidity_sizes
9981 print ("Received settings changed " + str (alias ) + " " + str (setting_name ) +
10082 " " + str (field_type ) + " " + str (new_value ), flush = True )
10183
0 commit comments