top of page
Modern Architecture

Stock Simulation Trading (Training) Platform

Problem/Opportunities:

Aspiring investors want to enter the stock market but hesitate due to fear of losing money, lack of knowledge as practical knowledge in the real financial decisions can lead to loss of money.

Solution:

A simple stock simulation and trading platform allows user to apply their knowledge in the real world, test their trading strategies safely and build confidence without risking their financial position.

Approach:

The application is designed to be used after research has been done and to go directly into trading. This can be used in conjunction with Case 1 but is built as a standalone application at this moment.

  • Request entry from user; user can enter the ticker

  • the type of transaction, “Buy” or “Sell”

  • choose by dollar amount or by stock quantity

(Validation is done online to check for errors on entry and position in their current portfolio)

  • Obtain other information such as the next business day (currently using T+1 logic, latest stock price, etc)

  • Validations performed

  • Create each execution transaction in TR_SUMMARY, which consists of all individual transactions

  • Update PORT_SUMMARY, which captures each stock by no of shares with the average price. There is only one record per stock in this database

  • Build add-on functions to enrich the platform; a Portfolio Summary to list the current portfolio and AI review will review the current holdings, analyse asset allocation, spot risks, categorise holdings, and flag duplicate exposure

Challenges:

Encountered database read/write conflict, and the database is being locked. I have changed to use WAL concurrency to avoid locking issues. “Buy” is a straightforward transaction when compared with the “Sell”. “Sell” logic must check the portfolio holding and do some validation before executing the transaction; in real life, other complex situations could arise, like FIFO, LIFO logic, but for illustration purposes I am using a very simple logic here to make this work. For SQLite3, I did not install the client frontend, making it harder on myself, as all retrieving and testing of transactions are performed using command-line format.  

 

Conclusion:

A practical project being built leveraging mostly Python code with a small piece of AI review that showcases the ability of LLMs as a tool that would provide us with unparalleled advantages.

 

Future Consideration:

Use in conjunction with Case 1 platform. Would be great if we can link up two applications together and interchange them by pressing a button. Add a timestamp field in the tables to accurately capture the transaction date/time, and this is good for audit trail purposes. Enhance the current database to use something more complex, e.g. PostgreSQL and deploy code to the cloud. Enriching with other investment vehicles like ETFs, mutual funds, etc

Application of use:

As currently indicated, this can be used for personal investment research and can be extended to be used in brokerage firms and the wealth management sector for training purposes. Using the same methodology and in conjunction with Case 1, it can extend to currency trading and wine trade Liv-ex

01.

Video Output:  

Cecilia's Portfolio

No copying without consent of the owner 

©2023 by Cecilia's Portfolio. Proudly created with Wix.com

bottom of page