Skip to content

lorenzourera/rotman-liability-trading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RIT Liability Trading 3

Overview

The advisory_only.py script is designed to interact with a local API for managing tender offers and calculating weighted average costs (WAC) based on market liquidity. It retrieves tender offers, evaluates them against market conditions, and makes decisions on whether to accept, decline, or remain neutral regarding these offers. It is meant as a supplement to the Liability Trading 3 of the RIT Decision cases (link)

Trading Strategy

The trading strategy implemented in the advisory_only.py script involves several key components that work together to make informed decisions on tender offers based on market conditions. Below is a detailed explanation of the strategy:

1. Tender Offer Retrieval

  • The script retrieves tender offers from a local API. A tender offer represents a proposal to purchase securities at a specified price.

2. Filtering Offers

  • The script filters the retrieved tender offers to focus on those that contain specific phrases, such as "An institution would like to," ensuring that only relevant offers are considered.

3. Market Data Acquisition

  • It fetches current market data, including bid and ask prices for relevant securities, using the local API.

4. Liquidity Assessment

  • The script assesses the liquidity available in the market for the relevant securities by analyzing order books. It gathers orders that are either bids (for buying) or asks (for selling) based on the action specified in the tender offer.

5. Weighted Average Cost (WAC) Calculation

  • The WAC is calculated based on the orders sourced from the market. This involves aggregating costs from multiple orders until the required quantity for the tender offer is reached.
  • The calculation considers both the price and quantity of each order, allowing for a dynamic assessment of market conditions.

6. Decision-Making Process

  • Accept Decision: If enough liquidity is sourced to meet or exceed the quantity specified in the tender offer, and if the WAC is greater than the offer price for a buy action or less than the offer price for a sell action, then the decision is to "Accept."
  • Neutral Decision: If insufficient quantity is sourced but still meets favorable WAC conditions, it results in a "Neutral" decision, indicating that while there isn’t enough liquidity to fully accept the offer, it may still be worth considering.
  • Decline Decision: If there isn’t enough liquidity sourced and the WAC does not favorably compare to the offer price, then the decision is to "Decline."

7. Trading Strategy Summary

  • The strategy effectively combines market data analysis with liquidity assessment to make informed trading decisions regarding tender offers.
  • By leveraging real-time data and calculating WAC, it aims to optimize trading outcomes while managing risk effectively.

Functions

  • Signal Handling: Gracefully handles shutdown signals to ensure the program can exit cleanly.
  • API Interaction: Communicates with a local API to fetch tender offers and market data.
  • Tender Offer Filtering: Filters tender offers based on specific criteria.
  • WAC Calculation: Calculates the weighted average cost (WAC) and assesses liquidity based on current market conditions.
  • Decision Making: Makes decisions on whether to accept or decline tender offers based on calculated WAC and market prices.

Requirements

  • Python 3.x
  • requests library
  • python-dotenv for environment variable management

You can install the required libraries using pip:

pip install -r requirements.txt

Areas for improvement

  • automated trading
  • order sizing based on available liquidity to minimize market impact

References

Limitations

  • This code is meant as an advisor to manual trade execution.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contact Information

  • You may contact me at zo125 on telegram for inquiries.

Releases

No releases published

Packages

No packages published

Languages