Changes to support MGSHMomentumView

This commit is contained in:
2025-02-10 08:02:49 -05:00
parent 549f9ca7d1
commit 230d84904a
10 changed files with 324 additions and 436 deletions

View File

@@ -16,6 +16,7 @@ using MarketData.Generator.Momentum;
using MarketData.DataAccess;
using System.CodeDom;
using MarketData.Generator.MGSHMomentum;
using TradeBlotter.Interface;
namespace TradeBlotter.Model
{
@@ -47,7 +48,7 @@ namespace TradeBlotter.Model
base.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset,null));
}
}
public class MGSHPositionModel : ModelBase
public class MGSHPositionModel : ModelBase, IPositionModel
{
private MGSHPosition position = new MGSHPosition();
private int slot;
@@ -111,6 +112,37 @@ namespace TradeBlotter.Model
Comment=position.Comment;
}
public MGSHPosition Position
{
get{return position;}
set
{
Slot=-1;
Symbol=position.Symbol;
PurchaseDate=position.PurchaseDate;
SellDate=position.SellDate;
Shares=position.Shares;
PurchasePrice=position.PurchasePrice;
CurrentPrice=position.CurrentPrice;
Volume=position.Volume;
Return1D=position.Return1D;
CumReturn252=position.CumReturn252;
IDIndicator=position.IDIndicator;
Score=position.Score;
MaxDrawdown=position.MaxDrawdown;
MaxUpside=position.MaxUpside;
Velocity=position.Velocity;
PE=position.PE;
Beta=position.Beta;
ZacksRank=position.ZacksRank;
InitialStopLimit=position.InitialStopLimit;
TrailingStopLimit=position.TrailingStopLimit;
LastStopAdjustment=position.LastStopAdjustment;
Comment=position.Comment;
this.position.R=position.R;
}
}
private void UpdateProperties()
{
base.OnPropertyChanged("CurrentPrice");