.. _demo_strategy: 交易策略示例 ==================================================== .. contents:: 目录 经典策略 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Aberration 策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/aberration/ .. literalinclude:: ../../tqsdk/demo/example/aberration.py :language: python Doublema 双均线策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" .. literalinclude:: ../../tqsdk/demo/example/doublema.py :language: python 价格动量策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/momentum-strategy/ .. literalinclude:: ../../tqsdk/demo/example/momentum.py :language: python 自动扶梯策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/escalator/ .. literalinclude:: ../../tqsdk/demo/example/escalator.py :language: python 菲阿里四价 策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/fairy-four-price/ .. literalinclude:: ../../tqsdk/demo/example/fairy_four_price.py :language: python R-Breaker 交易策略 - 隔夜留仓 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/r-breaker/ .. literalinclude:: ../../tqsdk/demo/example/rbreaker.py :language: python R-Breaker 交易策略 - 非隔夜留仓 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/r-breaker/ .. literalinclude:: ../../tqsdk/demo/example/rbreaker2.py :language: python Dual Thrust 策略 (难度:中级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/dual-thrust/ .. literalinclude:: ../../tqsdk/demo/example/dualthrust.py :language: python 网格交易策略 (难度:中级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/grid-trading/ .. literalinclude:: ../../tqsdk/demo/example/gridtrading.py :language: python 网格交易策略 - 异步代码 (难度:中级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/grid-trading/ .. literalinclude:: ../../tqsdk/demo/example/gridtrading_async.py :language: python 随机森林 (难度:中级) """""""""""""""""""""""""""""""""""""""""""""""" .. literalinclude:: ../../tqsdk/demo/example/random_forest.py :language: python 海龟交易策略 (难度:中级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/turtle/ .. literalinclude:: ../../tqsdk/demo/example/turtle.py :language: python Volume Weighted Average Price 策略 (难度:高级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/blog/vwap/ .. literalinclude:: ../../tqsdk/demo/example/vwap.py :language: python 趋势策略 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 三重指数平滑平均线 (TRIX) 趋势策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/trix-strategy .. literalinclude:: ../../tqsdk/demo/example/TRIX.py :language: python 基于分形的趋势突破策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/fractal-trend-strategy .. literalinclude:: ../../tqsdk/demo/example/fractal-trend.py :language: python 基于钱德动量震荡指标(CMO)的期货量化交易策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/cmo-strategy .. literalinclude:: ../../tqsdk/demo/example/CMO.py :language: python 涡旋指标期货量化策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/vortex-indicator-strategy .. literalinclude:: ../../tqsdk/demo/example/vortex-indicator.py :language: python Hull移动平均线策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/hull-strategy .. literalinclude:: ../../tqsdk/demo/example/hull.py :language: python Keltner Channel策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/keltner-channel-strategy .. literalinclude:: ../../tqsdk/demo/example/Keltner_Channel.py :language: python Qstick趋势策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/qstick-strategy .. literalinclude:: ../../tqsdk/demo/example/Qstick.py :language: python Aroon指标趋势策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/aroon-strategy .. literalinclude:: ../../tqsdk/demo/example/Aroon.py :language: python 量价趋势策略(VPT) (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/trend-following/vpt-strategy .. literalinclude:: ../../tqsdk/demo/example/volume_price.py :language: python 套利策略 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTA产业链套利 (涤纶短纤生产利润)策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/pta-spread .. literalinclude:: ../../tqsdk/demo/example/pta_spread.py :language: python 养殖价差套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/smash-spread .. literalinclude:: ../../tqsdk/demo/example/smash_spread.py :language: python 双焦(焦煤-焦炭)套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/jm-j-spread .. literalinclude:: ../../tqsdk/demo/example/jm-j-spread.py :language: python 甲醇制烯烃(MTO)产业链套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/mto-spread .. literalinclude:: ../../tqsdk/demo/example/mto_spread.py :language: python 铜铝比价套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/cu-al-spread .. literalinclude:: ../../tqsdk/demo/example/cu-al-spread.py :language: python 压榨价差套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/crush-spread .. literalinclude:: ../../tqsdk/demo/example/crush_spread.py :language: python 裂解价差套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/crack-spread .. literalinclude:: ../../tqsdk/demo/example/crack_spread_arbitrage.py :language: python 股指期货跨期套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/stock-future-cross-period-spread .. literalinclude:: ../../tqsdk/demo/example/stock-future-cross-period-spread.py :language: python 钢厂利润套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/rb-i-jt-spread .. literalinclude:: ../../tqsdk/demo/example/rb-i-jt-spread.py :language: python 菜油、豆油、棕榈油多品种套利策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/arbitrage/oi-y-p-spreads .. literalinclude:: ../../tqsdk/demo/example/oi-y-p-spreads.py :language: python 均值回归策略 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 卡尔曼滤波配对交易策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/mean-reversion/kalman-filter-strategy .. literalinclude:: ../../tqsdk/demo/example/kalman_filter_pairs_trading.py :language: python 基于距离的配对交易策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/mean-reversion/distance-based-strategy .. literalinclude:: ../../tqsdk/demo/example/distance_based.py :language: python 枢轴点反转策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/mean-reversion/pivot-point-strategy .. literalinclude:: ../../tqsdk/demo/example/pivot_point.py :language: python CCI均值回归策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/mean-reversion/cci-strategy .. literalinclude:: ../../tqsdk/demo/example/CCI.py :language: python RSI超买/超卖交易策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/mean-reversion/rsi-strategy .. literalinclude:: ../../tqsdk/demo/example/RSI.py :language: python Z-Score均值回归策略 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/mean-reversion/zscore-strategy .. literalinclude:: ../../tqsdk/demo/example/z_score.py :language: python 算法交易策略 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 冰山订单算法 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/other/iceberg-order .. literalinclude:: ../../tqsdk/demo/example/iceberg_algorithm.py :language: python 盘口下单算法 (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/other/handicap .. literalinclude:: ../../tqsdk/demo/example/handicap_algorithm.py :language: python 跟量下单算法(POV) (难度:初级) """""""""""""""""""""""""""""""""""""""""""""""" 策略说明 https://www.shinnytech.com/articles/trading-strategy/other/pov .. literalinclude:: ../../tqsdk/demo/example/pov.py :language: python