<jupyter_start><jupyter_text>Indices Lab  SP500 symbol list<jupyter_code>from liualgotrader.common.market_data import index_data
sp500 = await index_data("SP500")
sp500<jupyter_output><empty_output><jupyter_text>SP500 historical data feed<jupyter_code>from liualgotrader.common.market_data import index_history

sp500_data = await index_history("SP500", 200)
sp500_data
sp500_data.Close.pct_change()<jupyter_output><empty_output><jupyter_text>Is SP500 trending up?<jupyter_code>last_200 = sp500_data.Close[-200:]
sma_200 = 1.0 * last_200.sum() / len(last_200)
sp500 = sp500_data.Close.values[-1]
print(f"SP500 SMA 200: ${round(sma_200, 2)}\n\nSP500: ${round(sp500,2)}")
sp500 > sma_200<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12307692307692308, 'fraction_numerical': 0.11608391608391608, 'mean_word_length': 9.529411764705882, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '557998', 'license': 'MIT', 'n_tokens_mistral': 343, 'n_tokens_neox': 286, 'n_words': 42, 'path': 'analysis/notebooks/indices.ipynb', 'repo_name': 'TheSnoozer/LiuAlgoTrader', 'size': '715'}