<jupyter_start><jupyter_text>Moving average<jupyter_code>df.close.plot()
df.close.rolling(5000).mean().plot()<jupyter_output><empty_output><jupyter_text>MACD exampleWith getgains=True returns the percentage gains<jupyter_code># there are duplicate indexes
df = df.drop(df[df.index.duplicated()].index)
technical.macd(df.close, 10000, 1000, getgains=True, commissions=0.005).cumsum().plot()<jupyter_output><empty_output><jupyter_text>Ultimate oscillatorUltimate is good, but is also very sensitive and the commissions play a strong role<jupyter_code>technical.ultimate(df.close, df.low, df.high, buylevel=30, selllevel=70, days=7, getgains=True, commissions=0.005, mingain=0.005, firstopportunity=True, stoploss=0.005).cumsum().plot()
technical.ultimate(df.close, df.low, df.high, buylevel=30, selllevel=70, days=7, getgains=True, commissions=0).cumsum().plot()
technical.ultimate(df.close, df.low, df.high, buylevel=30, selllevel=70, days=7, winning=True, commissions=0)<jupyter_output><empty_output><jupyter_text>Test hourly ticket<jupyter_code>df_hour_ticket = df.close.iloc[::60]
df_hour_high = df.high.rolling(60).max().iloc[::60]
df_hour_low = df.high.rolling(60).min().iloc[::60]
technical.ultimate(df_hour_ticket, df_hour_low, df_hour_high, buylevel=30, selllevel=70, days=7, getgains=True, commissions=0).cumsum().plot()
ultpolicy = technical.ultimate(df.close, df.low, df.high, buylevel=30, selllevel=70, days=7, strategy=True, commissions=0)
plottable = df.close.iloc[:500]
plottable.plot()
plottable[ultpolicy].iloc[::2].plot(style=".", c="g")
plottable[ultpolicy].iloc[1::2].plot(style=".", c="r")<jupyter_output><empty_output><jupyter_text>Bollinger bands<jupyter_code>df.close.plot()
lower, upper = technical.bollinger_bands(df.close, k=3, period=100000)
lower.plot()
upper.plot()
technical.bollinger_bands(df.close, k=1, period=1000, getgains=True, commissions=0).cumsum().plot()<jupyter_output><empty_output><jupyter_text>Williams %R<jupyter_code>technical.williams(df.close, df.low, df.high, buylevel=-80, selllevel=-20, days=10, getgains=True, commissions=0).cumsum().plot()<jupyter_output><empty_output><jupyter_text>Momentum<jupyter_code>technical.momentum(df.close, period=10, getgains=True, commissions=0).cumsum().plot()<jupyter_output><empty_output><jupyter_text>Policy combination example<jupyter_code>macd = technical.macd(df.close, 10000, 1000)
lower, upper = technical.bollinger_bands(df.close, k=1, period=1000)
buy = (macd > 0) & (df.close < lower)
sell = (macd < 0) & (df.close > upper)
policy = technical.getpolicy(buy, sell, prices=df.close)
technical.gains(prices=df.close, policy=policy).cumsum().plot()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16529235382308846, 'fraction_numerical': 0.04235382308845577, 'mean_word_length': 9.507874015748031, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '419916', 'license': 'MIT', 'n_tokens_mistral': 1109, 'n_tokens_neox': 998, 'n_words': 142, 'path': 'examples/data_exploration.ipynb', 'repo_name': 'giuliovv/cryptotrading', 'size': '2668'}