-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnvironment.py
71 lines (46 loc) · 1.34 KB
/
Environment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#Jaden Alberding
import time
import random
import math
import keyboard
import pandas as pd
import BrowianMotion as bm
import FileControl as fp
import PlAItus as pai
def main():
fp.resetFile("Stock_Data.txt")
fp.resetFile("TrainingData.txt")
#Should be a inital price, inital deviation and ticks per day and that is it
price = 100
delta = 0.01 # standard deviation/Volitility
T = 1 # days
N = 1000 # data points per day
dt = T/N
amount = 1000
volume = 1000
avg_volume = volume
count = 0
x = 0
Timesegment = 5
datainfo = []
dataset = []
while x < 600:
price = bm.BrowianMotion(delta, N, dt, T, price,x)
if x < Timesegment:
datainfo.append(price)
else:
temp = []
for i in range(len(datainfo)-1):
datainfo[i] = datainfo[i+1]
temp.append(datainfo[i])
datainfo[len(datainfo)-1 ]= price
temp.append(datainfo[len(datainfo)-1])
dataset.append(temp)
fp.write1ToFile(datainfo, "TrainingData.txt")
fp.write2ToFile(x,price, "Stock_Data.txt")
x+= 1
time.sleep(1/250)
dataset = pd.DataFrame(dataset)
print(dataset)
if __name__ == "__main__":
main()