Now, let's analyze the StatArb signal using the following steps:
- Let's visualize a few more details about the signals in this trading strategy, starting with the correlations between CAD/USD and the other currency pairs as it evolves over time:
# Plot correlations between TRADING_INSTRUMENT and other currency pairscorrelation_data = pd.DataFrame()for symbol in SYMBOLS: if symbol == TRADING_INSTRUMENT: continue correlation_label = TRADING_INSTRUMENT + '<-' + symbol correlation_data = correlation_data.assign(label=pd.Series(correlation_history[correlation_label], index=symbols_data[symbol].index)) ax = correlation_data['label'].plot(color=next(cycol), lw=2., label='Correlation ' + correlation_label) ...