Add BarChart

This commit is contained in:
2025-06-30 13:17:13 -04:00
parent 99fa821f79
commit 332ed89e5a
3 changed files with 125 additions and 48 deletions

View File

@@ -105,8 +105,13 @@ namespace MarketData.Generator.MGSHMomentum
MGSHPosition position = activePositions.Where(x => x.Symbol.Equals(symbol) && x.PurchaseDate.Equals(purchaseDate)).FirstOrDefault();
if (null == position)
{
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Cannot locate position for symbol '{0}' purchased on {1}.", symbol, purchaseDate.ToShortDateString()));
return false;
MGSHPositions hedgePositions = HedgePositions;
position = hedgePositions.Where(x => x.Symbol.Equals(symbol) && x.PurchaseDate.Equals(purchaseDate)).FirstOrDefault();
if(null == position)
{
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("Cannot locate position for symbol '{0}' purchased on {1}.", symbol, purchaseDate.ToShortDateString()));
return false;
}
}
if (!position.PurchaseDate.Equals(purchaseDate)) position.PurchaseDate = purchaseDate;
if (!position.TrailingStopLimit.Equals(trailingStop)) position.TrailingStopLimit = trailingStop;

View File

@@ -316,7 +316,7 @@ namespace MarketData.MarketDataModel
// ***************************************************************************************************************************************************************************
public class Price
{
public enum PriceSource{Other=0,BigCharts=1,Yahoo=2,Fidelity=3,Google=4};
public enum PriceSource{Other=0,BigCharts=1,Yahoo=2,Fidelity=3,Google=4,BarChart=5};
private String symbol;
private DateTime date;
private double open;
@@ -377,6 +377,8 @@ namespace MarketData.MarketDataModel
return "Fidelity";
case PriceSource.Google :
return "Google";
case PriceSource.BarChart :
return "BarChart";
default :
return Constants.CONST_QUESTION;
}