Add warning for PurchaseDate not on Business Day.
This commit is contained in:
@@ -55,7 +55,7 @@ namespace TradeBlotter.UIUtils
|
|||||||
{
|
{
|
||||||
SellDate=position.SellDate;
|
SellDate=position.SellDate;
|
||||||
}
|
}
|
||||||
// SellPrice=position.TrailingStopLimit;
|
SellPrice=position.CurrentPrice;
|
||||||
txtSymbol.Text=Symbol;
|
txtSymbol.Text=Symbol;
|
||||||
dpPurchaseDate.SelectedDate=PurchaseDate;
|
dpPurchaseDate.SelectedDate=PurchaseDate;
|
||||||
dpSellDate.SelectedDate=SellDate;
|
dpSellDate.SelectedDate=SellDate;
|
||||||
@@ -174,6 +174,11 @@ namespace TradeBlotter.UIUtils
|
|||||||
SetMessage("Market closed on Sell Date.");
|
SetMessage("Market closed on Sell Date.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if(!dateGenerator.IsMarketOpen(PurchaseDate))
|
||||||
|
{
|
||||||
|
SetMessage("Market closed on Purchase Date.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if(double.IsNaN(SellPrice))
|
if(double.IsNaN(SellPrice))
|
||||||
{
|
{
|
||||||
SetMessage("Invalid Sell Price.");
|
SetMessage("Invalid Sell Price.");
|
||||||
|
|||||||
Reference in New Issue
Block a user