Skip to content

Commit b7a566d

Browse files
committed
Run new-stocks-purchasing only for paper trading
1 parent fb9ee29 commit b7a566d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

examples/joinquant/new_stocks_purchase.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@ def process_initialize(context):
2323

2424

2525
def purchase_new_stocks(context):
26-
g.__executor.purchase_new_stocks()
26+
if context.run_params.type == 'sim_trade':
27+
g.__executor.purchase_new_stocks()
28+
else:
29+
log.info('回测中不进行新股申购')

examples/ricequant/new_stocks_purchase.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ def before_trading(context):
2424

2525

2626
def purchase_new_stocks(context, bar_dict):
27-
context.__executor.purchase_new_stocks()
27+
if context.run_info.run_type == RUN_TYPE.PAPER_TRADING:
28+
context.__executor.purchase_new_stocks()
29+
else:
30+
logger.info('回测中不进行新股申购')

0 commit comments

Comments
 (0)