
In quantitative trading and asset management, relying on a single market’s data often provides an incomplete view of strategy opportunities. Multi-asset data analysis allows you to observe price fluctuations and trends across different markets, helping to identify potential trading opportunities more accurately. This article demonstrates, using Python, how to combine historical market data with real-time tick data to analyze multiple assets and optimize trading strategies.
Retrieving Historical Market Data for Multiple Assets
The first step in multi-asset analysis is obtaining reliable historical data. For example, you can fetch OHLC data for foreign exchange and cryptocurrency markets via the AllTick API, then unify the data format for easier analysis:
import requests
import pandas as pd
API_URL = "https://api.alltick.co/forex/history"
API_KEY = "your_api_key_here"
symbols = ["EURUSD", "BTCUSD", "ETHUSD"]
dfs = []
for symbol in symbols:
params = {
"symbol": symbol,
"interval": "1h",
"limit": 500,
"apikey": API_KEY
}
resp = requests.get(API_URL, params=params)
df = pd.DataFrame(resp.json())
df['timestamp'] = pd.to_datetime(df['timestamp'])
df['symbol'] = symbol
dfs.append(df)
data = pd.concat(dfs)
print(data.head())
By processing multi-asset data in a consistent format, you can simplify the calculation of indicators and subsequent strategy analysis.
Calculating Common Indicators
In multi-asset analysis, common indicators such as moving averages (MA), volatility, and the Relative Strength Index (RSI) are used to determine trend direction, market volatility, and overbought/oversold conditions:
def calculate_indicators(df):
df = df.copy()
df['MA20'] = df['close'].rolling(20).mean()
df['MA50'] = df['close'].rolling(50).mean()
df['returns'] = df['close'].pct_change()
df['volatility'] = df['returns'].rolling(20).std()
delta = df['close'].diff()
up, down = delta.clip(lower=0), -delta.clip(upper=0)
roll_up = up.rolling(14).mean()
roll_down = down.rolling(14).mean()
rs = roll_up / roll_down
df['RSI'] = 100 - (100 / (1 + rs))
return df
data = data.groupby('symbol').apply(calculate_indicators)
print(data[['symbol','close','MA20','MA50','volatility','RSI']].tail())
These indicators provide a foundation for trend analysis, volatility observation, and market strength assessment, supporting the generation of trading signals.
Exploring Trading Signals Across Multiple Assets
Once data for different assets is prepared, potential trading signals can be explored. For instance, a moving average crossover on one asset combined with an oversold RSI on another may indicate cross-market arbitrage or hedging opportunities:
def generate_signal(df):
df['signal'] = 0
df.loc[df['MA20'] > df['MA50'], 'signal'] = 1
df.loc[df['MA20'] < df['MA50'], 'signal'] = -1
return df
signals = data.groupby('symbol').apply(generate_signal)
print(signals[['symbol','close','MA20','MA50','RSI','signal']].tail())
Analyzing multiple asset indicators simultaneously allows for more refined trading opportunities beyond trends in a single market.
Integrating Real-Time Tick Data
Historical data provides trend references, while real-time tick data captures every price movement, supporting dynamic strategy analysis. A stable tick data stream allows you to:
- Update indicators and trading signals dynamically
- Adjust strategy parameters in real time
- Feed continuous data into visualization dashboards
Combining historical indicators with real-time tick data forms a complete multi-asset strategy analysis loop, extending from backtesting to live monitoring.
Analysis and Optimization Insights
The main benefits of multi-asset analysis include:
- Cross-Market Signal Discovery: Trends that are difficult to identify in a single market become clearer through multi-asset comparison.
- Strategy Optimization: Indicators like volatility, RSI, and moving averages can help optimize position sizing and stop-loss strategies.
- Real-Time Decision Support: Combining historical and tick data enables more precise entry and exit signals for trading strategies.
By integrating historical market data with real-time tick data, you can build a comprehensive multi-asset strategy optimization workflow, improving data efficiency and providing a reliable foundation for testing and refining complex strategies.


