public void calculateFuturePriceData() { display = ""; generateEmptyandRecentEmptyDateList(); int startCalculationIndex = 0; int endCalculationIndex = 0; int existFuturePriceDataCount = futurePriceData.Count; addDisplay($"- exist Future Price Data Count = {existFuturePriceDataCount}"); int existAnalyzedDataCount = analyzedData.Count; addDisplay($"- exist Analyzed Data Count = {existAnalyzedDataCount}"); int MAX_AFTER_DAYS = FuturePriceDataInformation.FUTURE_PRICE_DAYS.Last(); if (existFuturePriceDataCount + BaseParameterCalculator.PRE_DATA >= existAnalyzedDataCount - MAX_AFTER_DAYS) { addDisplay("- no new data to calculate"); return; } else { startCalculationIndex = Math.Max(BaseParameterCalculator.PRE_DATA, existFuturePriceDataCount + 1); endCalculationIndex = existAnalyzedDataCount - MAX_AFTER_DAYS; addDisplay($"- Calculate from index={startCalculationIndex} to {endCalculationIndex}"); } int belowMinVolumeCount = 0; for (int i = startCalculationIndex; i <= endCalculationIndex; i++) { var newFuturePriceData = new FuturePriceDataInformation(analyzedData[i]); if (analyzedData[i].recentMinVolume < MIN_VOLUME_THRESHOLD) { belowMinVolumeCount++; newFuturePriceData.isLowVolume = true; } for (int n = 0; n < FuturePriceDataInformation.FUTURE_PRICE_DAYS.Length; n++) { int dayAfter = FuturePriceDataInformation.FUTURE_PRICE_DAYS[n]; newFuturePriceData.futurePrices[n] = analyzedData[i + dayAfter - 1].N_avg / analyzedData[i].N_avg * 100 - 100; } futurePriceData.Add(newFuturePriceData); } addDisplay($"- below Min Volume Threshold: {belowMinVolumeCount}"); }
public FuturePriceStockInfromation(string stockID, FuturePriceDataInformation CopyFrom) { this.stockID = stockID; futurePrice = CopyFrom.futurePrices; }