Skip to content

Commit f05c5c2

Browse files
committed
Fix JoinQuantFollowingJob
1 parent fb27c24 commit f05c5c2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

shipane_sdk/jobs/joinquant_following.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class JoinQuantFollowingJob(object):
1212
def __init__(self, config, client):
1313
self._log = logging.getLogger()
1414
self._config = config
15-
self._client = client
15+
self._shipane_client = client
1616
self._jq_client = JoinQuantClient(username=self._config.get('JoinQuant', 'username'),
1717
password=self._config.get('JoinQuant', 'password'),
1818
backtest_id=self._config.get('JoinQuant', 'backtest_id'))
@@ -44,9 +44,9 @@ def __call__(self):
4444

4545
for tx in transactions:
4646
self._processed_transactions.append(tx)
47-
self._log.info("开始以 {}元 {} {}股 {}".format(tx.price, tx.get_cn_type(), tx.amount, tx.symbol))
47+
self._log.info("开始以 {}元 {} {}股 {}".format(tx.price, tx.get_cn_action(), tx.amount, tx.symbol))
4848
response = self._shipane_client.execute(None,
49-
action=tx.type,
49+
action=tx.action,
5050
symbol=tx.symbol,
5151
type='LIMIT',
5252
price=tx.price,

tests/shipane_sdk/joinquant/test_executor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def setUp(self):
2828
self.executor = JoinQuantExecutor(host=config.get('ShiPanE', 'host'))
2929

3030
def test_buy_stock(self):
31-
return
3231
mock_order = self.Order
3332
mock_order.is_buy = True
3433
mock_order.order_id = 1

0 commit comments

Comments
 (0)