Created
March 4, 2017 08:07
-
-
Save dolphinsue319/36bfc582171010347b8d6075096b7311 to your computer and use it in GitHub Desktop.
This script is related to https://gist.github.com/dolphinsue319/3947bdc0f7b0dbcd51fa1ee53974fe66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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