10. Market Maker Trading Strategies (Tutorial Version)

Reference source: docs/_joinquant_migration_source/Example_10_Market Maker Trading.ipynb First Markdown cell.

10.1. Strategy and Ideas

  • Real market-making strategies rely on tick-by-tick order book, order queues, and order priority.

  • The qteasy backtesting layer is a Bar-level matching abstraction. This example approximates market-making behavior with “mean regression bilateral order placement”.

  • Sell when the price deviates from the upper band of the average, buy when it deviates from the lower band, and observe in the middle range.

10.2. Honesty

  • This example is not a real market-making simulation at the exchange level;

  • This is only intended to explain the VS signal and stepwise backtesting process of qteasy in high-frequency style scenarios.

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

stg = Example10MarketMakingApprox()
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=['000651.SZ'],
    benchmark_asset='000651.SZ',
    invest_start='20230101',
    invest_end='20231231',
    invest_cash_amounts=[1000000],
    trade_batch_size=100,
    sell_batch_size=1,
    trade_log=True,
)

10.3. Executable script

  • examples/strategy_example_10.py