Skip to content

Instantly share code, notes, and snippets.

@dolphinsue319
Created March 4, 2017 08:07
Show Gist options
  • Save dolphinsue319/36bfc582171010347b8d6075096b7311 to your computer and use it in GitHub Desktop.
Save dolphinsue319/36bfc582171010347b8d6075096b7311 to your computer and use it in GitHub Desktop.
# coding=utf-8
from peewee import *
import datetime
class DateHandler:
def __init__(self):
pass
THIS_YEAR = datetime.datetime.now().year
FIRST_YEAR = 1992
DB = SqliteDatabase('TWSE.db')
class DailyTradeResult(Model):
stock_id = CharField()
date = DateField()
unit_count = IntegerField()
total_money = IntegerField()
o_price = FloatField()
h_price = FloatField()
l_price = FloatField()
c_price = FloatField()
diff = CharField()
trade_count = IntegerField()
day_from_1970 = IntegerField()
MA5 = FloatField()
MA20 = FloatField()
MA60 = FloatField()
MA240 = FloatField()
class Meta:
database = DB
class StockID(Model):
stock_id = CharField(primary_key=True)
class Meta:
database = DB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment