Skip to content

Commit

Permalink
Fix formatting to satisfy style check
Browse files Browse the repository at this point in the history
  • Loading branch information
stockmarketpotato committed Sep 6, 2023
1 parent 1e5988b commit 82870bb
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,19 +371,26 @@ private void addDepotStatementTransaction()
BigDecimal shares = asBigDecimal(v.get("quantity"));
t.setShares(Values.Share.factorize(shares.doubleValue() * 100));
t.setSecurity(getOrCreateSecurity(v));
// Expiration means it can be a long or short position that expired OTM
if (v.get("type").equals("EXPIRED")) {
BigDecimal quantity = ExtractorUtils.convertToNumberBigDecimal(v.get("quantity"), Values.Amount, "en", "US");
if (quantity.signum() == 1) {
// Expiration means it can be a long or short
// position that expired OTM
if (v.get("type").equals("EXPIRED"))
{
BigDecimal quantity = ExtractorUtils.convertToNumberBigDecimal(v.get("quantity"),
Values.Amount, "en", "US");
if (quantity.signum() == 1)
{
t.setType(PortfolioTransaction.Type.BUY);
t.setNote("Expired: Buy To Close");
}
else if (quantity.signum() == -1) {
else if (quantity.signum() == -1)
{
t.setType(PortfolioTransaction.Type.SELL);
t.setNote("Expired: Sell To Close");
}
}
// Assignment means this was a short position
} else if (v.get("type").equals("ASG")) {
else if (v.get("type").equals("ASG"))
{
t.setNote("Assigned: Buy To Close");
t.setType(PortfolioTransaction.Type.BUY);
}
Expand Down

0 comments on commit 82870bb

Please sign in to comment.