Skip to content

Commit

Permalink
sin data
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantStenger committed Mar 3, 2019
1 parent 01110c4 commit 5e838b8
Show file tree
Hide file tree
Showing 4 changed files with 720,855 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -80,7 +80,8 @@ CAIS++ Spring 2019 Project: Building an Agent to Trade with Reinforcement Learni
- Integrate NLP sentiment analysis as feature
- Add more indicators to model
- Clean up README
- Do we hold positions overnight?
- Do we hold positions overnight? I think initially no. There are also weird jumps over holidays and weekends.
- Take into account high, low, close, volume data

## Interesting Resources

Expand Down
206 changes: 206 additions & 0 deletions data/data-generator.ipynb

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions data/generate-sine-data.py
@@ -0,0 +1,33 @@
# Import dependencies
import pandas as pd
import numpy as np
import math
import matplotlib.pyplot as plt
import random

# Create a sine wave dataset in a similar format to our stock data
# We'll use minute data from 9:30am to 4:00pm.
def main():
minute_data = []
sines = []
for date in pd.date_range("01-02-2014", "01-18-2019"):
new_minutes = list(pd.date_range(str(date.date()) + " 9:30",
str(date.date()) + " 16:00", freq="1min")
)
minute_data += new_minutes

# Create sine data
x = np.arange(len(new_minutes))
y = np.sin(2*np.pi * random.randint(1,8) * (x/len(new_minutes)))

day_sines = y.tolist()
sines += day_sines

df = pd.DataFrame()
df['Times'] = minute_data
df['Sines'] = sines

df.to_csv("sin-data.csv", index=False)

if __name__ == "__main__":
main()

0 comments on commit 5e838b8

Please sign in to comment.