Skip to content

Commit

Permalink
Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulSquires committed Sep 2, 2023
1 parent 9d29a48 commit 0c82488
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion IB-Tracker/src/Config/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SOFTWARE.

#pragma once

constexpr std::wstring version = L"2.4.2";
constexpr std::wstring version = L"2.4.3";

bool SaveConfig();
bool LoadConfig();
Expand Down
3 changes: 3 additions & 0 deletions IB-Tracker/src/Database/trade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ void Trade::setTradeOpenStatus()
this->isOpen = (aggregate == 0 ? false : true);
return;
}

// If the Trade is closed then set the latest Buying Power date tot he close date
this->BPendDate = this->OldestTradeTransDate;
}


Expand Down
14 changes: 7 additions & 7 deletions IB-Tracker/src/Utilities/ListBoxData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ void ListBoxData_TradeROI(HWND hListBox, const std::shared_ptr<Trade>& trade, Ti
COLOR_WHITEDARK, font8, FontStyleRegular);

// Days In Trade
int days = AfxDaysBetween(startDate, (trade->isOpen ? AfxCurrentDate() : endDate));
text = AfxMoney(days, true, 0);
int daysInTrade = AfxDaysBetween(startDate, (trade->isOpen ? AfxCurrentDate() : endDate));
text = AfxMoney(daysInTrade, true, 0);
ld->SetData(4, trade, tickerId, text, StringAlignmentFar, StringAlignmentCenter, COLOR_GRAYDARK,
COLOR_WHITELIGHT, font8, FontStyleRegular);
text = L"DIT";
Expand All @@ -446,18 +446,18 @@ void ListBoxData_TradeROI(HWND hListBox, const std::shared_ptr<Trade>& trade, Ti

// Totals Days for Trade
ld = new ListBoxData;
days = AfxDaysBetween(startDate, endDate);
text = AfxMoney(days, true, 0);
int daysTotal = AfxDaysBetween(startDate, endDate);
text = AfxMoney(daysTotal, true, 0);
ld->SetData(2, trade, tickerId, text, StringAlignmentFar, StringAlignmentCenter, COLOR_GRAYDARK,
COLOR_WHITELIGHT, font8, FontStyleRegular);
text = L"Days";
ld->SetData(3, trade, tickerId, text, StringAlignmentNear, StringAlignmentCenter, COLOR_GRAYDARK,
COLOR_WHITEDARK, font8, FontStyleRegular);

// ROI% per 30 days
// ROI% per 30 days
text = AfxMoney(0, true, 1) + L"%";
if (trade->TradeBP != 0 && days != 0) {
text = AfxMoney((trade->ACB / trade->TradeBP * 100 / days * 30), true, 1) + L"%";
if (trade->TradeBP != 0 && daysTotal != 0) {
text = AfxMoney((trade->ACB / trade->TradeBP * 100 / daysTotal * 30), true, 1) + L"%";
}
ld->SetData(4, trade, tickerId, text, StringAlignmentFar, StringAlignmentCenter, COLOR_GRAYDARK,
COLOR_WHITELIGHT, font8, FontStyleRegular);
Expand Down

0 comments on commit 0c82488

Please sign in to comment.