diff --git a/UIUtils/ClosePositionDialogNoStop.xaml.cs b/UIUtils/ClosePositionDialogNoStop.xaml.cs index 070dec5..c1b3f12 100644 --- a/UIUtils/ClosePositionDialogNoStop.xaml.cs +++ b/UIUtils/ClosePositionDialogNoStop.xaml.cs @@ -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.");