-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1)add multiple stock trader examples 2)marshal factors of trader 3)dr…
…aw multiple securities with indicators and trading signals 4)some refactor Former-commit-id: 345b5f5
- Loading branch information
Showing
19 changed files
with
284 additions
and
137 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
from ..context import init_context | ||
|
||
init_context() | ||
|
||
from zvt.api.technical import get_securities, get_securities_in_blocks | ||
|
||
|
||
def test_basic_get_securities(): | ||
items = get_securities(security_type='stock', provider='eastmoney') | ||
print(items) | ||
items = get_securities(security_type='index', provider='eastmoney') | ||
print(items) | ||
items = get_securities(security_type='coin', provider='ccxt') | ||
print(items) | ||
|
||
|
||
def test_get_security_blocks(): | ||
hs300 = get_securities_in_blocks(block_names=['HS300_']) | ||
assert len(hs300) == 300 | ||
assert 'stock_sz_000338' in hs300 |
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# -*- coding: utf-8 -*- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
from zvt.factors.finance_factor import FinanceGrowthFactor | ||
from zvt.selectors.selector import TargetSelector | ||
|
||
|
||
class FundamentalSelector(TargetSelector): | ||
def init_factors(self, security_list, security_type, exchanges, codes, the_timestamp, start_timestamp, | ||
end_timestamp): | ||
factor = FinanceGrowthFactor(security_list=security_list, security_type=security_type, exchanges=exchanges, | ||
codes=codes, the_timestamp=the_timestamp, start_timestamp=start_timestamp, | ||
end_timestamp=end_timestamp, keep_all_timestamp=True, provider=self.provider) | ||
self.score_factors.append(factor) | ||
|
||
|
||
if __name__ == '__main__': | ||
selector: TargetSelector = FundamentalSelector(start_timestamp='2018-01-01', end_timestamp='2019-06-30') | ||
selector.run() | ||
print(selector.get_result_df()) |
Oops, something went wrong.