public static void GetOS225OPZData(Workbook book, ref OS225OPZOriginData data) { if (book == null || data == null) { return; } Worksheet sheet = book.Worksheets[1] as Worksheet; if (sheet == null) { return; } string updateDate = ExcelUtil.GetRange("A2", sheet).Text.ToString(); data.updateDate = JapanShared.TransferJpDate(updateDate); string putTradingDate = ExcelUtil.GetRange("B4", sheet).Text; putTradingDate = putTradingDate.Replace("プット", ""); data.putTradingDate = JapanShared.TransferJpDate(putTradingDate); string callTradingDate = ExcelUtil.GetRange("I4", sheet).Text; callTradingDate = callTradingDate.Replace("コール", ""); data.callTradingDate = JapanShared.TransferJpDate(callTradingDate); int offset = 17; for (int i = 0; i < 5; i++) { string exchangeCount = ExcelUtil.GetRange(6 + i * offset, 1, sheet).Text.ToString(); exchangeCount = exchangeCount.Replace("(", "").Replace(")", "").Replace("円", "").Replace(",", "").Trim(); data.putExchangeCount.Add(exchangeCount); exchangeCount = ExcelUtil.GetRange(6 + i * offset, 8, sheet).Text.ToString(); exchangeCount = exchangeCount.Replace("(", "").Replace(")", "").Replace("円", "").Replace(",", "").Trim(); data.callExchangeCount.Add(exchangeCount); for (int j = 0; j < 15; j++) { OSETradeCompanyInfo Info = OS225FUU.GetTradingInfo(sheet, 8 + i * offset + j, 2); data.putInfo.Add(Info); Info = OS225FUU.GetTradingInfo(sheet, 8 + i * offset + j, 4); data.putInfo.Add(Info); Info = OS225FUU.GetTradingInfo(sheet, 8 + i * offset + j, 9); data.callInfo.Add(Info); Info = OS225FUU.GetTradingInfo(sheet, 8 + i * offset + j, 11); data.callInfo.Add(Info); } } }
private void GenerateOS225FUU(Workbook book, OS225FUUOriginData data) { OS225FUU.WriteOS225FUU(book, data); OS225FUU.WriteOS225FUX(book, data); OS225FUU.WriteOSTRADF(book, data); }
private void GetOS225FUUData(Workbook book, ref OS225FUUOriginData data) { if (book == null || data == null) { return; } try { Worksheet sheet = book.Worksheets[1] as Worksheet; if (sheet == null) { return; } string updateDate = ExcelUtil.GetRange("A2", sheet).Text.ToString(); data.updateDate = JapanShared.TransferJpDate(updateDate); int lastUsedRow = sheet.UsedRange.Row + sheet.UsedRange.Rows.Count - 1; int currentRow = 1; while (currentRow <= lastUsedRow) { if (ExcelUtil.GetRange(currentRow, 1, sheet).Value2 != null && ExcelUtil.GetRange(currentRow, 1, sheet).Value2.ToString() != string.Empty) { string text = ExcelUtil.GetRange(currentRow, 1, sheet).Value2.ToString(); if (text.Contains("日経225先物")) { string date = ExcelUtil.GetRange(currentRow + 1, 2, sheet).Text.ToString(); data.OS225FUU.tradingDate1 = JapanShared.TransferJpDate(date); date = ExcelUtil.GetRange(currentRow + 1, 9, sheet).Text.ToString(); data.OS225FUU.tradingDate2 = JapanShared.TransferJpDate(date); for (int i = 0; i < 15; i++) { OSETradeCompanyInfo companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 2); updateCompanyInfo(companyInfo, nameDic); data.OS225FUU.info1.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 4); updateCompanyInfo(companyInfo, nameDic); data.OS225FUU.info1.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 9); updateCompanyInfo(companyInfo, nameDic); data.OS225FUU.info2.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 11); updateCompanyInfo(companyInfo, nameDic); data.OS225FUU.info2.Add(companyInfo); } currentRow += 20; } else if (text.Contains("日経225mini")) { string date = ExcelUtil.GetRange(currentRow + 1, 2, sheet).Text.ToString(); data.OS225FUX.tradingDate1 = JapanShared.TransferJpDate(date); date = ExcelUtil.GetRange(currentRow + 1, 9, sheet).Text.ToString(); data.OS225FUX.tradingDate2 = JapanShared.TransferJpDate(date); for (int i = 0; i < 15; i++) { OSETradeCompanyInfo companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 2); updateCompanyInfo(companyInfo, nameDic); data.OS225FUX.info1.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 4); updateCompanyInfo(companyInfo, nameDic); data.OS225FUX.info1.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 9); updateCompanyInfo(companyInfo, nameDic); data.OS225FUX.info2.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 11); updateCompanyInfo(companyInfo, nameDic); data.OS225FUX.info2.Add(companyInfo); } currentRow += 20; } else if (text.Contains("TOPIX先物")) { string date = ExcelUtil.GetRange(currentRow + 1, 2, sheet).Text.ToString(); data.OSTRADF.tradingDate1 = JapanShared.TransferJpDate(date); date = ExcelUtil.GetRange(currentRow + 1, 9, sheet).Text.ToString(); data.OSTRADF.tradingDate2 = JapanShared.TransferJpDate(date); for (int i = 0; i < 15; i++) { OSETradeCompanyInfo companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 2); updateCompanyInfo(companyInfo, nameDic); data.OSTRADF.info1.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 4); updateCompanyInfo(companyInfo, nameDic); data.OSTRADF.info1.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 9); updateCompanyInfo(companyInfo, nameDic); data.OSTRADF.info2.Add(companyInfo); companyInfo = OS225FUU.GetTradingInfo(sheet, currentRow + 4 + i, 11); updateCompanyInfo(companyInfo, nameDic); data.OSTRADF.info2.Add(companyInfo); } currentRow += 20; } else { currentRow++; } } else { currentRow++; } } } catch (Exception ex) { Logger.Log("GetOS225FUUData failed" + ex.Message); LogMessage("GetOS225FUUData failed"); } }