def __init__(self, product, enddate=None):
     self.product = product
     self.enddate = enddate
     td = TradingDay()
     ltd = td.getLastTradingDay()
     if enddate is None:
         self.enddate = ltd
Пример #2
0
 def __init__(self):
     config = GlobalConfig()
     path = config.getConfig('SubConfigPath', 'StressTesting_win')
     self.cp = configparser.ConfigParser()
     self.cp.read(path, encoding='utf-8-sig')
     td = TradingDay()
     self.ltd = td.getLastTradingDay()
Пример #3
0
 def setBPIH(self):
     BPI_table = self.getConfig('BPI_table', 'table')
     td = TradingDay()
     lastTradingDay = td.getLastTradingDay()
     sqls = "select * from %s where Occur_Date = '%s'" % (BPI_table,
                                                          lastTradingDay)
     return sqls
Пример #4
0
 def __init__(self, productID, EndDate=None):
     self.productID = productID
     if EndDate is None:
         td = TradingDay()
         self.EndDate = td.getLastTradingDay()
     else:
         self.EndDate = EndDate
Пример #5
0
 def __init__(self):
     config = GlobalConfig()
     path = config.getConfig('SubConfigPath', 'StressTesting_win')
     self.cp = configparser.ConfigParser()
     self.cp.read(path, encoding='utf-8-sig')
     td = TradingDay()
     self.ltd = td.getLastTradingDay()
     print("---- %s has been initialized! ----" % self.__class__.__name__)
Пример #6
0
 def __init__(self):
     config = GlobalConfig()
     path = config.getConfig('SubConfigPath', 'API_conf_win')
     # path = config.getConfig('SubConfigPath', 'API_conf_linux')
     # print(path)
     self.cp = configparser.ConfigParser()
     self.cp.read(path, encoding='utf-8-sig')
     td = TradingDay()
     self.ltd = td.getLastTradingDay()
Пример #7
0
 def __init__(self):
     config = GlobalConfig()
     self.mailserver = config.getConfig('email', 'mailserver')
     self.from_addr = config.getConfig('email', 'from_addr')
     self.sender_password = config.getConfig('email', 'sender_password')
     self.recipient = config.getConfig('email', 'recipient')
     td = TradingDay()
     self.date_of_subject = td.getLastTradingDay()
     self.subject = config.getConfig('email', 'subject') + self.date_of_subject
     self.attachmentFilePath = config.getConfig('email', 'attachmentFilePath')
Пример #8
0
    def __init__(self, productID, EndDate=None):
        config = GlobalConfig()
        path = config.getConfig('SubConfigPath', 'StressTesting_win')
        self.cp = configparser.ConfigParser()
        self.cp.read(path, encoding='utf-8-sig')
        td = TradingDay()
        self.ltd = td.getLastTradingDay()

        self.productID = productID
        self.EndDate = EndDate
Пример #9
0
from Common.GlobalConfig import GlobalConfig
from Common.TradingDay import TradingDay
from StressTesting.DailyGenerate_StressScenarioCal import DGSSC

#  Get product list fromm config.ini
gc = GlobalConfig()
product_list_tmp = gc.getConfig('product', 'list')
product_list = product_list_tmp.split(", ")
print(product_list)

#  Get last trade day
td = TradingDay()
date = td.getLastTradingDay()
# tradeday = "%s-%s-%s" % (lastTradingDay[:4], lastTradingDay[4:6], lastTradingDay[-2:])
# date = "20190211"

#  Use product id and trade day to generate basic info and finish import to Basic Performance Info table
for p in product_list:
    dgssc = DGSSC(p, date)
    dgssc.Data_Insert()
Пример #10
0
 def __init__(self):
     td = TradingDay()
     self.ltd = td.getLastTradingDay()
     ss = StressScenario()
     self.scenario = ss.ScenarioDataRetrieve('ScenarioList_Stock')
Пример #11
0
from Common.GlobalConfig import GlobalConfig
from Common.TradingDay import TradingDay
from PerformanceAnalysis.DailyGenerate_BasicPerformanceInfo import DGBPI


 # ---------- Daily BPI data generate and import to MySQL ------------

#  Get product list fromm config.ini
gc = GlobalConfig()
product_list_tmp = gc.getConfig('product', 'list')
product_list = product_list_tmp.split(", ")
print(product_list)

#  Get last trade day
td = TradingDay()
lastTradingDay = td.getLastTradingDay()
tradeday = "%s-%s-%s" % (lastTradingDay[:4], lastTradingDay[4:6], lastTradingDay[-2:])
print(tradeday)

# Import by designated day, use only when amend history data
# td = "2018-10-15"

#  Use product id and trade day to generate basic info and finish import to Basic Performance Info table
for p in product_list:
    dgbpi = DGBPI()
    dgbpi.composeArray(p, tradeday)
    dgbpi.insertArray()