Skip to content

Commit

Permalink
#update
Browse files Browse the repository at this point in the history
  • Loading branch information
yutiansut committed Aug 1, 2020
1 parent 9d28160 commit 87b1548
Show file tree
Hide file tree
Showing 134 changed files with 392 additions and 466 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion EXAMPLE/test_backtest/backtest_debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2019 yutiansut/QUANTAXIS
Copyright (c) 2016-2020 yutiansut/QUANTAXIS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion QUANTAXIS/QAARP/QAAccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion QUANTAXIS/QAARP/QAAccountPro.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 5 additions & 7 deletions QUANTAXIS/QAARP/QAPortfolio.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
# Copyright (c) 2016-2020 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -186,7 +186,6 @@ def init_hold_table(self):
def init_hold(self):
return self.init_hold_table.groupby('code').sum()


@property
def cash_available(self):
return self.cash[-1]
Expand Down Expand Up @@ -504,14 +503,16 @@ def get_cash(self):
return sum(
[account.cash_available for account in self.accounts.values()]
)

def hold_table(self, datetime=None):
"""返回每个acc的hold
Keyword Arguments:
datetime {[type]} -- [description] (default: {None})
"""
return pd.concat(
[account.hold_table(datetime).reset_index().assign(account_cookie= account.account_cookie) for account in self.accounts.values()]
[account.hold_table(datetime).reset_index().assign(
account_cookie=account.account_cookie) for account in self.accounts.values()]
).set_index(['code', 'account_cookie']).sort_index()

@property
Expand All @@ -530,7 +531,6 @@ def daily_hold(self):
.groupby('date').sum().assign(account_cookie=self.portfolio_cookie)\
.reset_index().set_index(['date', 'account_cookie'])


@property
def daily_frozen(self):
return pd.concat([account.daily_frozen for account in list(self.accounts.values())], axis=1).sum(axis=1)
Expand Down Expand Up @@ -797,12 +797,10 @@ def daily_hold(self):
.groupby('date').sum().assign(account_cookie=self.account_cookie)\
.reset_index().set_index(['date', 'account_cookie'])


@property
def daily_frozen(self):
return pd.concat([account.daily_frozen for account in self.accounts], axis=1, sort=False).sum(axis=1)


@property
def trade(self):
return pd.concat([item.trade for item in self.accounts], sort=False).groupby(level=0).sum()\
Expand Down
Loading

0 comments on commit 87b1548

Please sign in to comment.