Created
October 26, 2019 08:42
-
-
Save mementum/aba92e2ca48d01746e61a6d029015869 to your computer and use it in GitHub Desktop.
Generate Cancles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
COLUMNS = ['open', 'high', 'low', 'close', 'volume', 'openinterest'] | |
CANDLES = 20000 | |
STOCKS | |
dateindex = pd.date_range(start='2010-01-01', periods=CANDLES, freq='15min') | |
for i in range(STOCKS): | |
data = np.random.randint(10, 20, size=(CANDLES, len(COLUMNS))) | |
df = pd.DataFrame(data * 1.01, dateindex, columns=COLUMNS) | |
df = df.rename_axis('datetime') | |
df.to_csv('candles{:02d}.csv'.format(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment