Skip to content

Commit

Permalink
The old chart code was removed as it is not used after change of tran…
Browse files Browse the repository at this point in the history
…sfer and corporate actions processing.
  • Loading branch information
titov-vv committed May 23, 2024
1 parent 8bc5e95 commit 8c576ef
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions jal/widgets/price_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,13 @@ def load_open_trades(self, account, asset, end_time):
trades = []
positions = account.open_trades_list(asset, end_time)
for trade in positions:
marker_color = CustomColor.LightYellow
text = ''
operation = trade.open_operation()
if operation.type() == LedgerTransaction.Trade:
if trade.open_qty() >= 0:
marker_color = CustomColor.LightGreen
text = self.tr("Buy")
else:
marker_color = CustomColor.LightRed
text = self.tr("Sell")
if operation.type() == LedgerTransaction.Transfer:
transfer_out = LedgerTransaction().get_operation(operation.type(), operation.id(), Transfer.Outgoing)
trades += self.load_open_trades(transfer_out.account(), asset, transfer_out.timestamp()-1) # get position just before the transfer
text = self.tr("Transfer ") + f"{transfer_out.account_name()}"
if operation.type() == LedgerTransaction.CorporateAction and operation.subtype() == CorporateAction.Split:
trades += self.load_open_trades(account, asset, operation.timestamp()-1) # get position just before the split
text = operation.description().split('\n')[0]
if trade.open_qty() >= 0:
marker_color = CustomColor.LightGreen
text = self.tr("Buy")
else:
marker_color = CustomColor.LightRed
text = self.tr("Sell")
if operation.type() == LedgerTransaction.AssetPayment:
text = operation.name() + "\n" + operation.description().split('\n')[0]
trades.append({
Expand Down

0 comments on commit 8c576ef

Please sign in to comment.