diff --git a/MarketData/MarketData/Models/CMT20200817.TXT b/MarketData/MarketData/Models/CMT20200817.TXT
index 985916a..9bd34a2 100755
--- a/MarketData/MarketData/Models/CMT20200817.TXT
+++ b/MarketData/MarketData/Models/CMT20200817.TXT
@@ -133,10 +133,10 @@ Symbol=AZZ|PurchaseDate=2/7/2025 12:00:00 AM|SellDate=3/4/2025 12:00:00 AM|S
Symbol=AWI|PurchaseDate=2/14/2025 12:00:00 AM|SellDate=4/3/2025 12:00:00 AM|Shares=7|PurchasePrice=153.74|CurrentPrice=133.24|Exposure=1076.18|MarketValue=932.6800000000001|GainLoss=-143.5|GainLossPcnt=-0.13334200598412904|PositionRiskDecimal=0.12|R=18.4644|C=145.850071400525|P=7.89898785774382|InitialStopLimit=135.29|TrailingStopLimit=135.29|TotalRiskExposure=129.2508|RMultiple=-1.11R|Volatility=6.83095169067383|Volume=0|LastStopAdjustment=1/1/0001 12:00:00 AM|Comment=Manual close.
Symbol=IDCC|PurchaseDate=2/7/2025 12:00:00 AM|SellDate=4/4/2025 12:00:00 AM|Shares=5|PurchasePrice=204.9|CurrentPrice=189.59|Exposure=1024.5|MarketValue=947.95|GainLoss=-76.54999999999995|GainLossPcnt=-0.0747193753050268|PositionRiskDecimal=0.12|R=24.5268|C=132.993071400525|P=5.422357233741254|InitialStopLimit=180.31|TrailingStopLimit=195.563070678711|TotalRiskExposure=122.63400000000001|RMultiple=-0.62R|Volatility=3.26635074615479|Volume=0|LastStopAdjustment=3/17/2025 12:00:00 AM|Comment=Manual close.
Symbol=EXEL|PurchaseDate=3/4/2025 12:00:00 AM|SellDate=4/4/2025 12:00:00 AM|Shares=84|PurchasePrice=38.14|CurrentPrice=34.65|Exposure=3203.76|MarketValue=2910.6|GainLoss=-293.1600000000003|GainLossPcnt=-0.09150498164656537|PositionRiskDecimal=0.12|R=4.5948|C=389.4065|P=84.74939061547836|InitialStopLimit=33.56|TrailingStopLimit=34.6096426153183|TotalRiskExposure=385.96320000000003|RMultiple=-0.76R|Volatility=0.690388977527618|Volume=0|LastStopAdjustment=3/10/2025 12:00:00 AM|Comment=Manual close.
-Symbol=GWRE|PurchaseDate=5/16/2025 12:00:00 AM|SellDate=7/11/2025 5:14:58 PM|Shares=11|PurchasePrice=215.25|CurrentPrice=221.23|Exposure=2367.75|MarketValue=2433.5299999999997|GainLoss=65.77999999999975|GainLossPcnt=0.027781649245063773|PositionRiskDecimal=0.12|R=26.0436|C=304.705|P=11.699803406595093|InitialStopLimit=189.42|TrailingStopLimit=221.25771627426147|TotalRiskExposure=286.4796|RMultiple=0.23R|Volatility=9.23863506317139|Volume=0|LastStopAdjustment=6/4/2025 12:00:00 AM|Comment=Manual close.
-Symbol=YMM|PurchaseDate=7/11/2025 12:00:00 AM|SellDate=7/25/2025 8:21:34 PM|Shares=159|PurchasePrice=12.63|CurrentPrice=11.62|Exposure=2008.17|MarketValue=1847.58|GainLoss=-160.59000000000015|GainLossPcnt=-0.07996832937450521|PositionRiskDecimal=0.12|R=1.5143999999999997|C=241.41899999999998|P=159.41561014263075|InitialStopLimit=11.105599999999999|TrailingStopLimit=11.105599999999999|TotalRiskExposure=240.78959999999995|RMultiple=-0.67R|Volatility=0.436734020709991|Volume=0|LastStopAdjustment=1/1/0001 12:00:00 AM|Comment=Manual close.
-Symbol=SPOT|PurchaseDate=5/16/2025 12:00:00 AM|SellDate=7/29/2025 11:02:10 AM|Shares=5|PurchasePrice=649|CurrentPrice=637.19|Exposure=3245|MarketValue=3185.9500000000003|GainLoss=-59.04999999999973|GainLossPcnt=-0.018197226502311165|PositionRiskDecimal=0.12|R=78.756|C=468.78|P=5.952308395550815|InitialStopLimit=571.12|TrailingStopLimit=637.6154983520507|TotalRiskExposure=393.78|RMultiple=-0.15R|Volatility=40.1615791320801|Volume=0|LastStopAdjustment=7/3/2025 12:00:00 AM|Comment=Manual close.
-Symbol=CRS|PurchaseDate=5/16/2025 12:00:00 AM|SellDate=7/31/2025 8:53:18 PM|Shares=6|PurchasePrice=228|CurrentPrice=251.29|Exposure=1368|MarketValue=1507.74|GainLoss=139.74|GainLossPcnt=0.10214912280701754|PositionRiskDecimal=0.12|R=27.8256|C=185.3385|P=6.660718906330861|InitialStopLimit=200.64|TrailingStopLimit=251.05464191436766|TotalRiskExposure=166.9536|RMultiple=0.84R|Volatility=11.2141494750977|Volume=0|LastStopAdjustment=7/28/2025 12:00:00 AM|Comment=Manual close.
+Symbol=GWRE|PurchaseDate=5/16/2025 12:00:00 AM|SellDate=7/11/2025 12:00:00 AM|Shares=11|PurchasePrice=215.25|CurrentPrice=221.23|Exposure=2367.75|MarketValue=2433.5299999999997|GainLoss=65.77999999999975|GainLossPcnt=0.027781649245063773|PositionRiskDecimal=0.12|R=26.0436|C=304.705|P=11.699803406595093|InitialStopLimit=189.42|TrailingStopLimit=221.25771627426147|TotalRiskExposure=286.4796|RMultiple=0.23R|Volatility=9.23863506317139|Volume=0|LastStopAdjustment=6/4/2025 12:00:00 AM|Comment=Manual close.
+Symbol=YMM|PurchaseDate=7/11/2025 12:00:00 AM|SellDate=7/25/2025 12:00:00 AM|Shares=159|PurchasePrice=12.63|CurrentPrice=11.62|Exposure=2008.17|MarketValue=1847.58|GainLoss=-160.59000000000015|GainLossPcnt=-0.07996832937450521|PositionRiskDecimal=0.12|R=1.5143999999999997|C=241.41899999999998|P=159.41561014263075|InitialStopLimit=11.105599999999999|TrailingStopLimit=11.105599999999999|TotalRiskExposure=240.78959999999995|RMultiple=-0.67R|Volatility=0.436734020709991|Volume=0|LastStopAdjustment=1/1/0001 12:00:00 AM|Comment=Manual close.
+Symbol=SPOT|PurchaseDate=5/16/2025 12:00:00 AM|SellDate=7/29/2025 12:00:00 AM|Shares=5|PurchasePrice=649|CurrentPrice=637.19|Exposure=3245|MarketValue=3185.9500000000003|GainLoss=-59.04999999999973|GainLossPcnt=-0.018197226502311165|PositionRiskDecimal=0.12|R=78.756|C=468.78|P=5.952308395550815|InitialStopLimit=571.12|TrailingStopLimit=637.6154983520507|TotalRiskExposure=393.78|RMultiple=-0.15R|Volatility=40.1615791320801|Volume=0|LastStopAdjustment=7/3/2025 12:00:00 AM|Comment=Manual close.
+Symbol=CRS|PurchaseDate=5/16/2025 12:00:00 AM|SellDate=7/31/2025 12:00:00 AM|Shares=6|PurchasePrice=228|CurrentPrice=251.29|Exposure=1368|MarketValue=1507.74|GainLoss=139.74|GainLossPcnt=0.10214912280701754|PositionRiskDecimal=0.12|R=27.8256|C=185.3385|P=6.660718906330861|InitialStopLimit=200.64|TrailingStopLimit=251.05464191436766|TotalRiskExposure=166.9536|RMultiple=0.84R|Volatility=11.2141494750977|Volume=0|LastStopAdjustment=7/28/2025 12:00:00 AM|Comment=Manual close.
TotalCandidates=69
Symbol=PLTR|AnalysisDate=5/15/2025 12:00:00 AM|EPSSlope=0.0200000032782555|ProfitMarginSlope=0.320865631103516|PriceSlope=0.0074299551536233|Volatility=6.51536655426025|Volume=0|Violation=False|Slope=0.0074299551536233|Score=6.11409388477527|AnnualizedReturn=6.50355336268116|SharpeRatio=0.660606053256107|RSquared=0.940115894160154|BetaMonths=6|Beta=4.90935542401113
Symbol=EAT|AnalysisDate=6/16/2025 12:00:00 AM|EPSSlope=0.744999885559082|ProfitMarginSlope=0.091644287109375|PriceSlope=0.004453672573238146|Volatility=4.433369159698486|Volume=0|Violation=False|Slope=0.004453672573238146|Score=2.562281347020848|AnnualizedReturn=3.0719897799970104|SharpeRatio=0.25260176193822825|RSquared=0.8340787341497411|BetaMonths=6|Beta=4.066818582379959
diff --git a/MarketData/MarketData/Models/MGSH20250331.TXT b/MarketData/MarketData/Models/MGSH20250331.TXT
index fc08d71..b1e61f8 100644
--- a/MarketData/MarketData/Models/MGSH20250331.TXT
+++ b/MarketData/MarketData/Models/MGSH20250331.TXT
@@ -20,11 +20,11 @@ Slot=2|Symbol=NYT|PurchaseDate=8/29/2025 12:00:00 AM|SellDate=1/1/0001 12:00:0
TotalPositions=7
Symbol=MO|PurchaseDate=3/31/2025 12:00:00 AM|SellDate=5/14/2025 12:00:00 AM|Shares=18|PurchasePrice=59.91|CurrentPrice=56.15|Volume=17335180|Return1D=0|CumReturn252=0|IDIndicator=-15.9362549800797|Score=1.14749269300042|Velocity=0.967136150234742|PE=9|Beta=0.572465642401382|InitialStopLimit=47.93|TrailingStopLimit=56.15650033473968|LastStopAdjustment=5/7/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=12.004|Comment=Closed due to trailing stop.
Symbol=EXC|PurchaseDate=3/31/2025 12:00:00 AM|SellDate=5/14/2025 12:00:00 AM|Shares=24|PurchasePrice=45.76|CurrentPrice=42.6|Volume=14993121|Return1D=0|CumReturn252=0|IDIndicator=-8.76494023904382|Score=0.405636492837393|Velocity=1|PE=18.02|Beta=0.248374476251328|InitialStopLimit=36.61|TrailingStopLimit=42.7107857322693|LastStopAdjustment=4/30/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=9.216|Comment=Closed due to trailing stop.
-Symbol=RGLD|PurchaseDate=4/30/2025 12:00:00 AM|SellDate=7/7/2025 4:16:11 PM|Shares=6|PurchasePrice=179.06|CurrentPrice=162|Volume=872755|Return1D=0|CumReturn252=0|IDIndicator=-12.3505976095618|Score=0.879340632979787|Velocity=0.8398891966759|PE=36.94|Beta=0.672718546494456|InitialStopLimit=143.25|TrailingStopLimit=162.60321449279786|LastStopAdjustment=6/2/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=36.542|Comment=Manual close.
-Symbol=NRG|PurchaseDate=5/30/2025 12:00:00 AM|SellDate=7/16/2025 8:02:48 PM|Shares=11|PurchasePrice=156.54|CurrentPrice=144.91|Volume=3799318|Return1D=0|CumReturn252=0|IDIndicator=-5.5776892430278835|Score=1.1152297855435784|Velocity=0.9311485909479076|PE=24.22|Beta=1.1133261039922626|InitialStopLimit=125.23|TrailingStopLimit=144.98235696792602|LastStopAdjustment=6/30/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=31.180000000000003|Comment=Manual close.
-Symbol=OPRA|PurchaseDate=5/30/2025 12:00:00 AM|SellDate=7/16/2025 8:07:28 PM|Shares=97|PurchasePrice=18.31|CurrentPrice=18.02|Volume=415071|Return1D=0|CumReturn252=0|IDIndicator=-4.382470119521905|Score=0.8751364490743774|Velocity=0.6148705096073518|PE=25.43|Beta=2.3432255715230057|InitialStopLimit=14.65|TrailingStopLimit=18.002285492420196|LastStopAdjustment=7/2/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=3.6700000000000004|Comment=Manual close.
-Symbol=SH|PurchaseDate=6/27/2025 12:00:00 AM|SellDate=8/4/2025 11:52:29 AM|Shares=75|PurchasePrice=39.71|CurrentPrice=39.28|Volume=0|Return1D=0|CumReturn252=0|IDIndicator=0|Score=0|Velocity=0|PE=0|Beta=0|InitialStopLimit=34.94|TrailingStopLimit=39.29447616100312|LastStopAdjustment=8/1/2025 12:00:00 AM|PositionRiskPercentDecimal=0.12|R=4.7844|Comment=Manual close.
-Symbol=DOLE|PurchaseDate=6/30/2025 12:00:00 AM|SellDate=8/11/2025 12:01:13 PM|Shares=2|PurchasePrice=13.93|CurrentPrice=13.65|Volume=621748|Return1D=0|CumReturn252=0|IDIndicator=-15.537848605577693|Score=0.086718072882986|Velocity=0.380038387715931|PE=14.2|Beta=0.023899349951645672|InitialStopLimit=11.14|TrailingStopLimit=13.686428616046905|LastStopAdjustment=7/30/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=2.798|Comment=Manual close.
+Symbol=RGLD|PurchaseDate=4/30/2025 12:00:00 AM|SellDate=7/7/2025 12:00:00 AM|Shares=6|PurchasePrice=179.06|CurrentPrice=162|Volume=872755|Return1D=0|CumReturn252=0|IDIndicator=-12.3505976095618|Score=0.879340632979787|Velocity=0.8398891966759|PE=36.94|Beta=0.672718546494456|InitialStopLimit=143.25|TrailingStopLimit=162.60321449279786|LastStopAdjustment=6/2/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=36.542|Comment=Manual close.
+Symbol=NRG|PurchaseDate=5/30/2025 12:00:00 AM|SellDate=7/16/2025 12:00:00 AM|Shares=11|PurchasePrice=156.54|CurrentPrice=144.91|Volume=3799318|Return1D=0|CumReturn252=0|IDIndicator=-5.5776892430278835|Score=1.1152297855435784|Velocity=0.9311485909479076|PE=24.22|Beta=1.1133261039922626|InitialStopLimit=125.23|TrailingStopLimit=144.98235696792602|LastStopAdjustment=6/30/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=31.180000000000003|Comment=Manual close.
+Symbol=OPRA|PurchaseDate=5/30/2025 12:00:00 AM|SellDate=7/16/2025 12:00:00 AM|Shares=97|PurchasePrice=18.31|CurrentPrice=18.02|Volume=415071|Return1D=0|CumReturn252=0|IDIndicator=-4.382470119521905|Score=0.8751364490743774|Velocity=0.6148705096073518|PE=25.43|Beta=2.3432255715230057|InitialStopLimit=14.65|TrailingStopLimit=18.002285492420196|LastStopAdjustment=7/2/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=3.6700000000000004|Comment=Manual close.
+Symbol=SH|PurchaseDate=6/27/2025 12:00:00 AM|SellDate=8/4/2025 12:00:00 AM|Shares=75|PurchasePrice=39.71|CurrentPrice=39.28|Volume=0|Return1D=0|CumReturn252=0|IDIndicator=0|Score=0|Velocity=0|PE=0|Beta=0|InitialStopLimit=34.94|TrailingStopLimit=39.29447616100312|LastStopAdjustment=8/1/2025 12:00:00 AM|PositionRiskPercentDecimal=0.12|R=4.7844|Comment=Manual close.
+Symbol=DOLE|PurchaseDate=6/30/2025 12:00:00 AM|SellDate=8/11/2025 12:00:00 AM|Shares=2|PurchasePrice=13.93|CurrentPrice=13.65|Volume=621748|Return1D=0|CumReturn252=0|IDIndicator=-15.537848605577693|Score=0.086718072882986|Velocity=0.380038387715931|PE=14.2|Beta=0.023899349951645672|InitialStopLimit=11.14|TrailingStopLimit=13.686428616046905|LastStopAdjustment=7/30/2025 12:00:00 AM|PositionRiskPercentDecimal=0.2|R=2.798|Comment=Manual close.
TotalStopLimits=18
Symbol=EXC|AnalysisDate=4/30/2025 12:00:00 AM|PreviousStop=36.61|NewStop=42.7107857322693|CurrentPriceLow=42.6|CurrentPriceClose=46.9|PriceTrendIndicatorSlope=0.0870828032493591|StopLimitId=EXC20250331120000AM
Symbol=SXT|AnalysisDate=4/30/2025 12:00:00 AM|PreviousStop=59.18|NewStop=85.4177850723267|CurrentPriceLow=92.4|CurrentPriceClose=93.95|PriceTrendIndicatorSlope=0.931879639625549|StopLimitId=SXT20250331120000AM
diff --git a/MarketData/MarketDataLib/Generator/MGSHMomentum/MGSHBacktest.cs b/MarketData/MarketDataLib/Generator/MGSHMomentum/MGSHBacktest.cs
index 44222e0..92b9cc9 100755
--- a/MarketData/MarketDataLib/Generator/MGSHMomentum/MGSHBacktest.cs
+++ b/MarketData/MarketDataLib/Generator/MGSHMomentum/MGSHBacktest.cs
@@ -248,6 +248,20 @@ namespace MarketData.Generator.MGSHMomentum
}
}
+ ///
+ /// Retrieve open/closed positions on specified date for the given session.
+ ///
+ ///
+ ///
+ ///
+ public static (MGSHPositions openPositions, MGSHPositions closedPositions) GetPositionsOn(MGSHSessionParams sessionParams,DateTime currentDate)
+ {
+ MGSHPositions combinedPositions=sessionParams.GetCombinedPositions();
+ MGSHPositions openPositions=new MGSHPositions(combinedPositions.Where(x => (x.PurchaseDate<=currentDate&&(!Utility.IsEpoch(x.SellDate)&&x.SellDate>currentDate))||(x.PurchaseDate<=currentDate&&Utility.IsEpoch(x.SellDate))).ToList());
+ MGSHPositions closedPositions=new MGSHPositions(combinedPositions.Where(x => (!Utility.IsEpoch(x.SellDate)&&x.SellDate.Equals(currentDate))).ToList());
+ return (openPositions, closedPositions);
+ }
+
public static ModelPerformanceSeries GetModelPerformance(MGSHSessionParams sessionParams)
{
Profiler profiler=new Profiler();