File tree Expand file tree Collapse file tree 1 file changed +0
-6
lines changed Expand file tree Collapse file tree 1 file changed +0
-6
lines changed Original file line number Diff line number Diff line change 1
- import bisect
2
- import collections
3
1
from datetime import timedelta
4
2
from enum import Enum
5
3
6
4
from .timeseries import TimeSeries
7
5
8
- PriceEvent = collections .namedtuple ("PriceEvent" , ["timestamp" , "price" ])
9
-
10
6
11
7
class StockSignal (Enum ):
12
8
buy = 1
@@ -20,7 +16,6 @@ class Stock:
20
16
21
17
def __init__ (self , symbol ):
22
18
self .symbol = symbol
23
- self .price_history = []
24
19
self .history = TimeSeries ()
25
20
26
21
@property
@@ -33,7 +28,6 @@ def price(self):
33
28
def update (self , timestamp , price ):
34
29
if price < 0 :
35
30
raise ValueError ("price should not be negative" )
36
- bisect .insort_left (self .price_history , PriceEvent (timestamp , price ))
37
31
self .history .update (timestamp , price )
38
32
39
33
def is_increasing_trend (self ):
You can’t perform that action at this time.
0 commit comments