Commit Latest

This commit is contained in:
2025-06-15 22:17:20 -04:00
parent be64273eeb
commit a46d507c7a
3 changed files with 15 additions and 3 deletions

View File

@@ -169,7 +169,7 @@ namespace PortfolioManager.Models
// The least squares might be in the wrong order if the Bollinger band was already sorted by date
public static CompositeDataSource LeastSquares(BollingerBands bollingerBands)
{
if (null == bollingerBands || 0 == bollingerBands.Count) return null;
if (null == bollingerBands || 0 == bollingerBands.Count) return Empty();
LeastSquaresResult leastSquaresResult = bollingerBands.LeastSquaresFitClose();
SortedDateTimeDataAdapter sortedDateTimeDataAdapter = new SortedDateTimeDataAdapter();
List<BollingerBandElement> sortedBollingerBands = bollingerBands.OrderBy(x => x.Date).ToList();

View File

@@ -10,12 +10,23 @@ namespace PortfolioManager.Models
{
public class PortfolioTradeModel
{
private PortfolioTradeModel()
{
}
public static CompositeDataSource Empty()
{
CompositeDataSource compositeDataSource = new CompositeDataSource()
{
DataAdapter = new SortedDateTimeDataAdapter()
};
return compositeDataSource;
}
public static CompositeDataSource PortfolioTrades(PortfolioTrades portfolioTrades)
{
if (null == portfolioTrades || 0 == portfolioTrades.Count) return null;
if (null == portfolioTrades || 0 == portfolioTrades.Count) return Empty();
List<PortfolioTrade> sortedPortfolioTrades = portfolioTrades.OrderBy(x => x.TradeDate).ToList();
SortedDateTimeDataAdapter sortedDateTimeDataAdapter = new SortedDateTimeDataAdapter();
foreach (PortfolioTrade portfolioTrade in sortedPortfolioTrades)

View File

@@ -91,6 +91,7 @@ namespace PortfolioManager.ViewModels
{
Task workerTask = Task.Factory.StartNew(() =>
{
MDTrace.WriteLine(LogLevel.DEBUG, $"WatchListDA.GetWatchLists()");
watchListNames = WatchListDA.GetWatchLists();
watchListNames.Insert(0, UIConstants.CONST_ALL);
selectedWatchList = watchListNames.Find(x => x.Equals("Valuations"));