Browse Source

穷举范围

daniel-ali 2 years ago
parent
commit
0dad8cc26a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      QMT/real_time.py

+ 2 - 2
QMT/real_time.py

@@ -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')