Skip to content

A tool for tracing stock transactions, mainly focusing on recording, cost calculation, etc.

Notifications You must be signed in to change notification settings

cgx-avenue/stock_helper

Repository files navigation

stock_helper

A tool for tracing stock transactions, mainly focusing on recording, cost calculation, etc.

2024-03-05

At the beginning I want to use Flask + Vue.js for this project. But during searching on the Internet, I found NiceGUI seems to be a good alternative for this simple and quick use case. https://nicegui.io/ Let's try and see how it works and how well it works.

Environment

Python

  1. Conda environment
conda create -n shenv python=3.10
conda activiate shenv
  1. Install dependencies

Database

Sqlite3

sudo apt update 
sudo apt install sqlite3
sqlite3 --version
# change to project folder and then
sqlite3 stock_trading_records.db

Then the terminal will enter sql mode.

-- to activate creation of db file, input a line only with ;
; 
-- create table
CREATE TABLE stock_trading_record (
	id INTEGER PRIMARY KEY AUTOINCREMENT,
	"action" TEXT,
	"timestamp" TEXT,
	price REAL,
	quantity INTEGER,
	amount REAL,
	fee REAL,
	code TEXT,
	stock_name TEXT
);
CREATE INDEX stock_trading_record_id_IDX ON stock_trading_record (id,code,stock_name);


to-do

  • change table to ui.refreshable and using ui.timer(5) to update every 5 seconds
  • insert done, change from notification to dialog
  • total_profit conditional format
  • check Quasar, especially QTable
  • ui_total_profit change to ui.refreshable

About

A tool for tracing stock transactions, mainly focusing on recording, cost calculation, etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published