dev 6
This commit is contained in:
22
py-client/strategy/ipo/boot.py
Normal file
22
py-client/strategy/ipo/boot.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from sdk import Client
|
||||
import config
|
||||
|
||||
def AutoBuyIpo() -> None:
|
||||
client = Client(
|
||||
config.global_config.qmt_base_url,
|
||||
config.global_config.qmt_token,
|
||||
config.HTTP_TIMEOUT,
|
||||
)
|
||||
|
||||
result = client.ipo_data("STOCK")
|
||||
for stock in result:
|
||||
ipo_price = result[stock]['issuePrice'] # 发行价
|
||||
maxPurchaseNum = result[stock]['maxPurchaseNum'] # 可申购额度
|
||||
client.passorder(
|
||||
op_type=23,
|
||||
stock=stock,
|
||||
volume=maxPurchaseNum,
|
||||
pr_type=11,
|
||||
price=ipo_price,
|
||||
strategy_name="新股申购",
|
||||
)
|
||||
Binary file not shown.
Binary file not shown.
@@ -84,7 +84,10 @@ def StartTrend() -> None:
|
||||
storeState.reconcile(positions, orders, deals)
|
||||
|
||||
# 获取本策略的信号开仓数据
|
||||
signals = init_signals(config.global_config,["morning","tail","arbitrage"])
|
||||
signals = init_signals(
|
||||
config.global_config,
|
||||
config.account_config.signal_allow,
|
||||
)
|
||||
run = Runtime(
|
||||
client=client,
|
||||
global_cfg=config.global_config,
|
||||
@@ -182,11 +185,3 @@ def RunOnce(run: Runtime, signals) -> None:
|
||||
|
||||
# 8. 持仓计算。当前 Go 版本的 managePositions 为空,保留扩展入口。
|
||||
manage_positions(run, ticks, positions, market_ok,assets.available)
|
||||
|
||||
|
||||
def SignalFilter(signals, allowed_names):
|
||||
"""只保留账户配置明确允许使用的信号。"""
|
||||
if not allowed_names:
|
||||
return []
|
||||
allowed = set(allowed_names)
|
||||
return [signal for signal in signals if signal.signal_key in allowed]
|
||||
|
||||
Reference in New Issue
Block a user