<jupyter_start><jupyter_text>Show how to supply a different handler for subscription items<jupyter_code>def show(msg):
    '''
    Sample price handler. If on_price_update is registered for a symbol,
    it will update the symbol's values (stored in a symbol hash) with
    that price update.symbol hash.

    :return: none
    '''
    try:
        md = json.loads(msg)
        symbol = md["Symbol"]
        t = trader
        si = trader.symbol_info.get(symbol, {})
        p_up = dict(symbol_info=t.symbol_info[symbol], parent=t)
        t.symbols[symbol] = t.symbols.get(symbol, fxcm_rest_api
                                          .PriceUpdate(p_up,
                                                       symbol_info=si))
        trader.symbols[symbol].bid, trader.symbols[symbol].ask,\
            trader.symbols[symbol].high,\
            trader.symbols[symbol].low = md['Rates']
        trader.symbols[symbol].updated = md['Updated']
        print(t.symbols[symbol])
    except Exception as e:
        trader.logger.error("Can't handle price update: " + str(e))

# trader = fx
trader.subscribe_symbol("EUR/USD", handler=show)
result = trader.subscribe_symbol("GBP/JPY")
print(result)
print(trader.subscriptions)
print(trader.symbols["GBP/JPY"])
print(trader.symbols["GBP/JPY"].bid)
print(trader.symbols["GBP/JPY"].ask)
print(trader.symbols['GBP/JPY'].parent)
trader.open_trade(trader.account_id, "USD/JPY", True, 1, at_market=1, time_in_force="FOK")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13096037609133646, 'fraction_numerical': 0.001343183344526528, 'mean_word_length': 2.850129198966408, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '650345', 'license': 'MIT', 'n_tokens_mistral': 492, 'n_tokens_neox': 481, 'n_words': 91, 'path': 'RestApiNotebook_Revised_Valentin.ipynb', 'repo_name': 'FXCM-ValentinMandev/FXCM_uploads', 'size': '1489'}