This repository contains Python code for implementing various algorithmic trading strategies. Each strategy is implemented as a separate function within a class and is designed to execute specific trading actions based on market conditions.
To use these trading strategies, follow these steps:
- Clone this repository to your local machine.
- Install the required dependencies. You can do this by running
pip install -r requirements.txt
. - Import the trading strategy functions into your project.
- Initialize the trading environment and provide necessary parameters such as trading state, market data, and any additional indicators required by the strategy.
- Call the desired trading strategy function with the appropriate parameters.
- Execute the returned orders generated by the trading strategy.
- Description: Executes trades based on the bid-ask spread of a specific asset.
- Function:
amethyst_strategy(self, state: TradingState)
- Parameters:
state
- The current trading state containing market data. - Logic: Determines whether to buy or sell based on the bid-ask spread relative to a default price.
- Description: Implements trades based on the position and exponential moving average (EMA) of an asset.
- Function:
starfruit_strategy(self, state: TradingState)
- Parameters:
state
- The current trading state containing market data. - Logic: Adjusts buy and sell orders based on the position and EMA of the asset.
- Description: Executes trades based on the derivatives of sunlight and humidity.
- Function:
orchids_strategy(self, state: TradingState, sunlight, humidity)
- Parameters:
state
- The current trading state containing market data,sunlight
- Time series data for sunlight,humidity
- Time series data for humidity. - Logic: Buys or sells based on the derivatives of sunlight and humidity, resetting the position if they become discordant.
- Description: Implements trades based on the spread between a gift basket and its components.
- Function:
choco_straw_rose_bask_strategy(self, state: TradingState)
- Parameters:
state
- The current trading state containing market data. - Logic: Determines whether to buy or sell the gift basket based on the spread between its price and the combined price of its components.
- Description: Executes trades based on the spread between coconut and coconut_coupon.
- Function:
coco_strategy(self, state: TradingState)
- Parameters:
state
- The current trading state containing market data. - Logic: Waits for enough data points to estimate the mean and standard deviation of the spread, then buys or sells based on predefined thresholds.