Skip to content

Commit 7ac62cf

Browse files
committed
fix myalgo.py
1 parent 116255a commit 7ac62cf

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bin/input.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ A,31000,1.02,JF
77
A,5000,1.04,ML
88
A,2000,1.05,SC
99
A,2000,1.09,HS
10-
C,algo-start
10+
C,start-algo
11+

bin/myalgo.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from decimal import Decimal
22

33
class Algorithm(object):
4-
def __init__(self):
4+
def __init__(self, order_book):
55
self.active = False
6-
pass
7-
def process_order(self, line, trade, order, orderbook):
6+
self.order_book = order_book
7+
8+
def process_order(self, line, trade, order):
89
tokens = line.strip().split(",")
9-
if tokens[0] == 'C' and tokens[1] == 'algo-start':
10+
if tokens[0] == 'C' and tokens[1] == 'start-algo':
1011
print("starting-algo")
1112
self.active = True
1213
return self.start()
@@ -18,4 +19,4 @@ def start(self):
1819
"side": "bid",
1920
"quantity": 10000,
2021
"price": Decimal(1.0 ),
21-
"trade_id" : 10000}]
22+
"trade_id" : "ME"}]

0 commit comments

Comments
 (0)