Update StopLimits

This commit is contained in:
2025-12-12 17:11:58 -05:00
parent e1bae730f2
commit 73cb48d9b9
5 changed files with 248 additions and 248 deletions

View File

@@ -27,7 +27,7 @@ namespace MarketData.MarketDataModel.GainLoss
if(null==gainLossGenerator || null==activeGainLossGenerator)return;
Dictionary<String,String> companyNames = PricingDA.GetNamesForSymbols(symbols);
Dictionary<String,bool> stopLimits = PortfolioDA.HasStopLimit(symbols);
Dictionary<String,bool> stopLimits = StopLimitDA.HasStopLimit(symbols);
foreach(String symbol in symbols)
{
@@ -100,7 +100,7 @@ namespace MarketData.MarketDataModel.GainLoss
{
List<String> symbols=portfolioTrades.Symbols;
Dictionary<String,bool> stopLimits = PortfolioDA.HasStopLimit(symbols);
Dictionary<String,bool> stopLimits = StopLimitDA.HasStopLimit(symbols);
foreach(String symbol in symbols)
{

View File

@@ -57,20 +57,11 @@ namespace MarketData.MarketDataModel
public double StopPrice{get;set;}
public double Shares{get;set;}
public String StopType{get;set;}
public int Active{get;set;}
public DateTime EffectiveDate{get;set;} // if the EffectiveDate is Epoch then the StopLimit is taken to be in effect and is the most recent. Otherwise it is considered an historical stop limit
public StopLimit()
{
}
public StopLimit(String symbol,double stopPrice,int shares,String stopType,int active)
{
this.Symbol=symbol;
this.StopPrice=stopPrice;
this.Shares=shares;
this.StopType=stopType;
this.Active=active;
}
public override String ToString()
{
StringBuilder sb=new StringBuilder();
@@ -78,7 +69,6 @@ namespace MarketData.MarketDataModel
sb.Append(Utility.FormatCurrency(StopPrice)).Append(",");
sb.Append(Utility.FormatNumber(Shares,3)).Append(",");
sb.Append(StopType).Append(",");
sb.Append(Active.ToString()).Append(",");
sb.Append(EffectiveDate.ToShortDateString());
return sb.ToString();
}
@@ -89,7 +79,6 @@ namespace MarketData.MarketDataModel
nvpCollection.Add(new NVP("StopPrice",StopPrice.ToString()));
nvpCollection.Add(new NVP("Shares",Shares.ToString()));
nvpCollection.Add(new NVP("StopType",StopType.ToString()));
nvpCollection.Add(new NVP("Active",Active.ToString()));
nvpCollection.Add(new NVP("EffectiveDate",EffectiveDate.ToShortDateString()));
return nvpCollection;
}