Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_meta_recorder():
recorder = ChinaStockMetaRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_1wk_kdata_recorder():
recorder = ChinaStockKdataRecorder(codes=SAMPLE_STOCK_CODES, sleeping_time=0, level=IntervalLevel.LEVEL_1WEEK,
real_time=False)
try:
recorder.run()
except:
assert False
def test_top_ten_tradable_holder_recorder():
recorder = TopTenTradableHolderRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_income_statement_recorder():
recorder = ChinaStockIncomeStatementRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_manager_trading_recorder():
recorder = ManagerTradingRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_dividend_detail():
recorder = DividendDetailRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
def test_finance_factor_recorder():
recorder = ChinaStockFinanceFactorRecorder(codes=SAMPLE_STOCK_CODES)
try:
recorder.run()
except:
assert False
df = get_rights_issue_detail(provider=self.provider, entity_id=item.entity_id,
columns=[RightsIssueDetail.timestamp,
RightsIssueDetail.rights_raising_fund],
start_timestamp=item.timestamp,
end_timestamp="{}-12-31".format(item.timestamp.year))
if pd_is_not_null(df):
item.rights_raising_fund = df['rights_raising_fund'].sum()
self.session.commit()
super().on_finish()
if __name__ == '__main__':
# init_log('rights_issue.log')
recorder = RightsIssueDetailRecorder(codes=SAMPLE_STOCK_CODES)
recorder.run()
start_timestamp=None, end_timestamp=None, long_threshold=0.8, short_threshold=0.2,
level=IntervalLevel.LEVEL_1DAY, provider='joinquant', block_selector=None) -> None:
super().__init__(entity_ids, entity_type, exchanges, codes, the_timestamp, start_timestamp, end_timestamp,
long_threshold, short_threshold, level, provider, block_selector)
def init_factors(self, entity_ids, entity_type, exchanges, codes, the_timestamp, start_timestamp, end_timestamp,
level):
bull_factor = BullFactor(entity_ids=entity_ids, entity_type=entity_type, exchanges=exchanges,
codes=codes, the_timestamp=the_timestamp, start_timestamp=start_timestamp,
end_timestamp=end_timestamp, provider='joinquant', level=level)
self.add_filter_factor(bull_factor)
if __name__ == '__main__':
s = TechnicalSelector(codes=SAMPLE_STOCK_CODES, start_timestamp='2018-01-01', end_timestamp='2019-06-30')
s.run()
s.draw()
meta.metas['security_type'] = marshal_object_for_ui(cls.security_type)
return meta
if __name__ == '__main__':
# CoinTrader(start_timestamp='2019-06-03',
# end_timestamp='2019-06-22',
# level=TradingLevel.LEVEL_1MIN,
# security_list=['coin_binance_EOS/USDT'],
# real_time=False,
# kdata_use_begin_time=True).run()
StockTrader(start_timestamp='2015-01-01',
end_timestamp='2019-06-21',
provider=Provider.NETEASE,
codes=SAMPLE_STOCK_CODES,
level=TradingLevel.LEVEL_1DAY).run()