Skip to content

Commit

Permalink
Create ai_market_maker.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 14, 2024
1 parent 5ebd181 commit 279bbab
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions features/high_frequency_trading/ai_market_maker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ai_market_maker.py
import zipline
from zipline.algorithm import TradingEnvironment

def ai_market_maker():
# Create a trading environment
env = TradingEnvironment()

# Define the AI-powered market making strategy
strategy = env.add_strategy('ai_market_making_strategy')
strategy.add_rule('buy', 'tock', 'when', 'input_data > 0.5')
strategy.add_rule('sell', 'tock', 'when', 'input_data < 0.5')

# Run the AI-powered market making strategy
env.run(strategy)

return env.get_portfolio()

# trading_strategy.py
import zipline
from zipline.algorithm import TradingEnvironment

def trading_strategy():
# Create a trading environment
env = TradingEnvironment()

# Define the trading strategy
strategy = env.add_strategy('trading_strategy')
strategy.add_rule('buy', 'tock', 'when', 'input_data > 0.5')
strategy.add_rule('sell', 'tock', 'when', 'input_data < 0.5')

# Run the trading strategy
env.run(strategy)

return env.get_portfolio()

0 comments on commit 279bbab

Please sign in to comment.