Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

CTP Strategy Template 📈

Python Status Market

Standardized CTA Strategy Interface for DeepAlpha Terminal.

This repository defines the base classes and interfaces used by Trading Brains Studio for developing high-frequency strategies on the Shanghai Futures Exchange (SHFE) and other Chinese markets.

Architecture

  • Event Driven: Based on tick-level data updates.
  • Low Latency: Optimized for CTP (Comprehensive Transaction Platform) API.
  • Risk Control: Built-in pre-trade risk checks in the buy/sell methods.

Example Usage

from strategy_base import CtaTemplate, TickData

class DualThrustStrategy(CtaTemplate):
    author = "Roy Dai"
    
    def on_init(self):
        self.write_log("Strategy Initialized")
        
    def on_tick(self, tick: TickData):
        if tick.last_price > self.upper_rail:
            self.buy(tick.last_price, 1)


Copyright © 2026 Trading Brains Studio. All rights reserved.
Internal use only.

About

High-frequency CTA strategy base class for Chinese Futures Markets (CTP).

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages