9. Intraday Turnaround Trading Strategy (Equivalent to Tutorial Version)

Reference source: docs/_joinquant_migration_source/Example_09_日内回转交易.ipynb First Markdown cell.

9.1. Strategy and Ideas

  • Calculate MACD using minute-level prices;

  • Add to your position when the MACD is positive and reduce your position when it is negative.

  • By outputting a fixed number of trades using the VS signal, an intraday reversal style can be formed.

9.2. Honesty

  • The original strategy emphasized intraday reversals in A-shares, but in reality, A-shares are subject to T+1 restrictions.

  • This example only demonstrates the intraday signal processing chain of qteasy and is not equivalent to a real executable A-share T+0 turnaround;

  • If you need to closely resemble live trading, please use ETFs or futures contracts and calibrate the trading system parameters.

from examples.strategies.example_strategies import Example09IntradayRotation
import qteasy as qt

stg = Example09IntradayRotation()
op = qt.Operator(stg, signal_type='VS')
op.op_type = 'stepwise'
op.set_blender('1.0*s0')
res = qt.run(
    op,
    mode=1,
    asset_type='E',
    asset_pool=['600000.SH'],
    benchmark_asset='600000.SH',
    invest_start='20230101',
    invest_end='20231231',
    invest_cash_amounts=[1000000],
    trade_batch_size=100,
    sell_batch_size=1,
    trade_log=True,
)

9.3. Executable script

  • examples/strategy_example_09.py