Spaces:
Sleeping
Sleeping
| def fetch_forex_data(pair, timeframe): | |
| """ | |
| Fetch historical forex data for a given currency pair and timeframe. | |
| This function generates dummy data for testing purposes. | |
| Args: | |
| pair (str): Currency pair (e.g., "EUR/USD"). | |
| timeframe (str): Timeframe for the data (e.g., "15m"). | |
| Returns: | |
| pd.DataFrame: DataFrame containing Date and Close price. | |
| """ | |
| import pandas as pd | |
| import numpy as np | |
| dates = pd.date_range(start="2025-01-01", periods=100, freq="15T") | |
| prices = np.random.uniform(1.1, 1.2, len(dates)) | |
| df = pd.DataFrame({"Date": dates, "Close": prices}) | |
| df.set_index("Date", inplace=True) | |
| return df | |