Remove Fix purchase date/sell date fall on weekend from the aggregators
This commit is contained in:
@@ -50,6 +50,7 @@ namespace TradeBlotter.Model
|
||||
public CMPositionModel()
|
||||
{
|
||||
}
|
||||
|
||||
public CMPositionModel(Position position, int slot)
|
||||
{
|
||||
Slot = slot;
|
||||
@@ -64,6 +65,7 @@ namespace TradeBlotter.Model
|
||||
SharpeRatio = position.SharpeRatio;
|
||||
CNNPrediction = position.CNNPrediction;
|
||||
}
|
||||
|
||||
public CMPositionModel(Position position)
|
||||
{
|
||||
slot = -1;
|
||||
@@ -78,15 +80,32 @@ namespace TradeBlotter.Model
|
||||
SharpeRatio = position.SharpeRatio;
|
||||
CNNPrediction = position.CNNPrediction;
|
||||
}
|
||||
|
||||
public Position Position
|
||||
{
|
||||
get
|
||||
{
|
||||
return position;
|
||||
}
|
||||
}
|
||||
|
||||
public String Symbol
|
||||
{
|
||||
get { return position.Symbol; }
|
||||
set { position.Symbol = value; base.OnPropertyChanged("Symbol"); }
|
||||
}
|
||||
|
||||
public DateTime PurchaseDate
|
||||
{
|
||||
get { return position.PurchaseDate; }
|
||||
set { position.PurchaseDate = value; base.OnPropertyChanged("PurchaseDate"); }
|
||||
get
|
||||
{
|
||||
return position.PurchaseDate;
|
||||
}
|
||||
set
|
||||
{
|
||||
position.PurchaseDate = value;
|
||||
base.OnPropertyChanged("PurchaseDate");
|
||||
}
|
||||
}
|
||||
|
||||
public Brush PurchaseDateColor
|
||||
@@ -127,11 +146,13 @@ namespace TradeBlotter.Model
|
||||
return dateGenerator.DaysBetween(PurchaseDate, SellDate);
|
||||
}
|
||||
}
|
||||
|
||||
public int Slot
|
||||
{
|
||||
get { return slot; }
|
||||
set { slot = value; base.OnPropertyChanged("Slot"); }
|
||||
}
|
||||
|
||||
public String SlotAsString
|
||||
{
|
||||
get
|
||||
@@ -140,16 +161,19 @@ namespace TradeBlotter.Model
|
||||
return Slot.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public double Shares
|
||||
{
|
||||
get { return position.Shares; }
|
||||
set { position.Shares = value; base.OnPropertyChanged("Shares"); base.OnPropertyChanged("Exposure"); base.OnPropertyChanged("ActiveExposure"); base.OnPropertyChanged("MarketValue"); base.OnPropertyChanged("ActiveMarketValue"); base.OnPropertyChanged("GainLoss"); base.OnPropertyChanged("GainLossPcnt"); }
|
||||
}
|
||||
|
||||
public double PurchasePrice
|
||||
{
|
||||
get { return position.PurchasePrice; }
|
||||
set { position.PurchasePrice = value; base.OnPropertyChanged("PurchasePrice"); base.OnPropertyChanged("Exposure"); base.OnPropertyChanged("ActiveExposure"); base.OnPropertyChanged("GainLoss"); base.OnPropertyChanged("GainLossPcnt"); }
|
||||
}
|
||||
|
||||
public double CurrentPrice
|
||||
{
|
||||
get { return position.CurrentPrice; }
|
||||
@@ -170,6 +194,7 @@ namespace TradeBlotter.Model
|
||||
base.OnPropertyChanged("CurrentPriceColor");
|
||||
}
|
||||
}
|
||||
|
||||
public double RSI3
|
||||
{
|
||||
get { return rsi3; }
|
||||
@@ -181,11 +206,13 @@ namespace TradeBlotter.Model
|
||||
base.OnPropertyChanged("RSI3Color");
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime LastUpdated
|
||||
{
|
||||
get { return lastUpdated; }
|
||||
set { lastUpdated = value; base.OnPropertyChanged("LastUpdated"); }
|
||||
}
|
||||
|
||||
public Brush CurrentPriceColor
|
||||
{
|
||||
get
|
||||
@@ -196,6 +223,7 @@ namespace TradeBlotter.Model
|
||||
else return BrushCollection.GetContextBrush(BrushCollection.BrushColor.Black);
|
||||
}
|
||||
}
|
||||
|
||||
public Brush RSI3Color
|
||||
{
|
||||
get
|
||||
@@ -205,14 +233,17 @@ namespace TradeBlotter.Model
|
||||
return BrushCollection.GetContextBrush(BrushCollection.BrushColor.Black);
|
||||
}
|
||||
}
|
||||
|
||||
public double Exposure
|
||||
{
|
||||
get { return Shares * PurchasePrice; }
|
||||
}
|
||||
|
||||
public double ActiveExposure
|
||||
{
|
||||
get { return IsActivePosition ? Exposure : 0.00; }
|
||||
}
|
||||
|
||||
public Brush ActiveExposureColor
|
||||
{
|
||||
get
|
||||
@@ -221,19 +252,23 @@ namespace TradeBlotter.Model
|
||||
else return BrushCollection.GetContextBrush(BrushCollection.BrushColor.Black);
|
||||
}
|
||||
}
|
||||
|
||||
public bool CNNPrediction
|
||||
{
|
||||
get { return position.CNNPrediction; }
|
||||
set { position.CNNPrediction = value; base.OnPropertyChanged("CNNPrediction"); }
|
||||
}
|
||||
|
||||
public double MarketValue
|
||||
{
|
||||
get { return Shares * CurrentPrice; }
|
||||
}
|
||||
|
||||
public double ActiveMarketValue
|
||||
{
|
||||
get { return IsActivePosition ? MarketValue : 0.00; }
|
||||
}
|
||||
|
||||
public Brush ActiveMarketValueColor
|
||||
{
|
||||
get
|
||||
@@ -244,10 +279,12 @@ namespace TradeBlotter.Model
|
||||
else return BrushCollection.GetContextBrush(BrushCollection.BrushColor.Black);
|
||||
}
|
||||
}
|
||||
|
||||
public double GainLoss
|
||||
{
|
||||
get { return MarketValue - Exposure; }
|
||||
}
|
||||
|
||||
public Brush GainLossColor
|
||||
{
|
||||
get
|
||||
@@ -258,10 +295,12 @@ namespace TradeBlotter.Model
|
||||
else return BrushCollection.GetContextBrush(BrushCollection.BrushColor.Black);
|
||||
}
|
||||
}
|
||||
|
||||
public double GainLossPcnt
|
||||
{
|
||||
get { return (MarketValue - Exposure) / Exposure; }
|
||||
}
|
||||
|
||||
public Brush GainLossPcntColor
|
||||
{
|
||||
get
|
||||
@@ -272,21 +311,25 @@ namespace TradeBlotter.Model
|
||||
else return BrushCollection.GetContextBrush(BrushCollection.BrushColor.Black);
|
||||
}
|
||||
}
|
||||
|
||||
public double Beta
|
||||
{
|
||||
get { return position.Beta; }
|
||||
set { position.Beta = value; base.OnPropertyChanged("Beta"); }
|
||||
}
|
||||
|
||||
public int BetaMonths
|
||||
{
|
||||
get { return position.BetaMonths; }
|
||||
set { position.BetaMonths = value; base.OnPropertyChanged("BetaMonths"); }
|
||||
}
|
||||
|
||||
public double SharpeRatio
|
||||
{
|
||||
get { return position.SharpeRatio; }
|
||||
set { position.SharpeRatio = value; base.OnPropertyChanged("SharpeRatio"); }
|
||||
}
|
||||
|
||||
public bool IsActivePosition
|
||||
{
|
||||
get { return Utility.IsEpoch(SellDate) ? true : false; }
|
||||
|
||||
Reference in New Issue
Block a user