Add warning for PurchaseDate not on Business Day.

This commit is contained in:
2025-02-25 15:47:51 -05:00
parent d17dd3673c
commit e21e01c566

View File

@@ -55,7 +55,7 @@ namespace TradeBlotter.UIUtils
{
SellDate=position.SellDate;
}
// SellPrice=position.TrailingStopLimit;
SellPrice=position.CurrentPrice;
txtSymbol.Text=Symbol;
dpPurchaseDate.SelectedDate=PurchaseDate;
dpSellDate.SelectedDate=SellDate;
@@ -174,6 +174,11 @@ namespace TradeBlotter.UIUtils
SetMessage("Market closed on Sell Date.");
return false;
}
if(!dateGenerator.IsMarketOpen(PurchaseDate))
{
SetMessage("Market closed on Purchase Date.");
return false;
}
if(double.IsNaN(SellPrice))
{
SetMessage("Invalid Sell Price.");