|
@@ -89,7 +89,7 @@ def sell_trader(data, positions_list):
|
|
|
# print(m, data[m]['lastPrice'])
|
|
|
print('卖出函数:', dt.now())
|
|
|
# positions = xt_trader.query_stock_positions(acc)
|
|
|
- # print('持仓总数:', len(positions))
|
|
|
+ # print('持仓总数:', len(positions_list))
|
|
|
for stock in data:
|
|
|
if stock in positions_list:
|
|
|
print('持仓', stock, data[stock])
|
|
@@ -187,7 +187,7 @@ def buy_trader(data):
|
|
|
if stock in new_keep_stock:
|
|
|
current_price = data[stock]['lastPrice']
|
|
|
if cash > 2000:
|
|
|
- volume = int((cash / 2 / current_price) // 100 * 100)
|
|
|
+ volume = int((cash / 3 / current_price) // 100 * 100)
|
|
|
print('volume:', volume)
|
|
|
print('买入信号!!!!!!', stock, volume, current_price)
|
|
|
order_id = xt_trader.order_stock(acc, stock, xtconstant.STOCK_BUY, volume, xtconstant.LATEST_PRICE, current_price, 'strategy1', 'order_test')
|