Commit Latest

This commit is contained in:
2025-06-27 22:09:13 -04:00
parent 3fb36991ff
commit 80bfd595ee
2 changed files with 10 additions and 7 deletions

View File

@@ -4574,6 +4574,7 @@ namespace MarketData.Helper
return null;
}
DateTime currentMarketDate=PremarketDA.GetLatestMarketDate();
// LatestPriceDelegate[] latestPriceDelegates=new LatestPriceDelegate[]{GetLatestPriceYahoo,GetLatestPriceBigCharts,GetLatestPriceBarChart,GetLatestPriceGoogle};
LatestPriceDelegate[] latestPriceDelegates=new LatestPriceDelegate[]{GetLatestPriceYahoo,GetLatestPriceBigCharts,GetLatestPriceGoogle};
Price latestPrice=null;
foreach(LatestPriceDelegate latestPriceDelegate in latestPriceDelegates)

View File

@@ -403,18 +403,20 @@ namespace MarketData.Helper
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[GetMissingPrices]End, total took {0}(ms)",profiler.End()));
}
}
public bool UpdateLatestPriceSymbol(String symbol)
{
List<String> symbols=new List<String>();
List<String> symbols = new List<String>();
symbols.Add(symbol);
return UpdateLatestPrices(symbols);
}
public bool UpdateLatestPrices(List<String> symbols)
{
Profiler profiler=new Profiler();
Profiler profiler = new Profiler();
try
{
DateTime pricingDate=DateTime.Now;
DateTime pricingDate = DateTime.Now;
this.symbols = symbols;
currentIndex = 0;
while (true)
@@ -428,18 +430,18 @@ namespace MarketData.Helper
}
for (int index = 0; index < queueSymbols.Count; index++)
{
PricingThreadHelper pricingThreadHelper = new PricingThreadHelper(queueSymbols[index], pricingDate,resetEvents[index]);
PricingThreadHelper pricingThreadHelper = new PricingThreadHelper(queueSymbols[index], pricingDate, resetEvents[index]);
ThreadPool.QueueUserWorkItem(ThreadPoolCallbackUpdateLatestPrice, pricingThreadHelper);
try{Thread.Sleep(WaitBetweenRequests);}catch(Exception){;}
try { Thread.Sleep(WaitBetweenRequests); } catch (Exception) {; }
}
MDTrace.WriteLine(LogLevel.DEBUG,"Load prices, waiting for queued items to complete.");
MDTrace.WriteLine(LogLevel.DEBUG, "Load prices, waiting for queued items to complete.");
WaitHandle.WaitAll(resetEvents);
}
return true;
}
finally
{
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[UpdateLatestPrices]End, total took {0}(ms)",profiler.End()));
MDTrace.WriteLine(LogLevel.DEBUG, String.Format("[UpdateLatestPrices]End, total took {0}(ms)", profiler.End()));
}
}
public bool LoadPrices(List<String> symbols)