diff --git a/Million Prototype/Form1.cs b/Million Prototype/Form1.cs index 85ff032..325b7d4 100644 --- a/Million Prototype/Form1.cs +++ b/Million Prototype/Form1.cs @@ -324,6 +324,7 @@ namespace Million_Prototype result = new SearchResult(); result.BuyList.CandleDataLists_Im.Add(buy); + result.CodeFullName = result.BuyList.ConGoodsData.CodeFullName; sellData = sellList.FirstOrDefault(t => t.DateTime > buy.DateTime); } } @@ -407,25 +408,23 @@ namespace Million_Prototype result.SellData = sellData; errorResultList.Add(result); } - } - - double total = 0; - foreach (var item in resultList) - { - Console.WriteLine(item.TotalEarningRate); - total += item.TotalEarningRate; - } - Console.WriteLine("Total 수익률 : " + total/resultList.Count); - Console.WriteLine("Win : " + win); - Console.WriteLine("Lose : " + lose); - Console.WriteLine("승률 : " + win * 100 / (win + lose)); - sellList.ToString(); - - - ExportManager.CreateResultOfExcel(@"ExcelFile.xlsx", resultList); + } + } } + double total = 0; + foreach (var item in resultList) + { + Console.WriteLine(item.CodeFullName); + Console.WriteLine(item.TotalEarningRate); + total += item.TotalEarningRate; + } + + Console.WriteLine("Total 수익률 : " + total / resultList.Count); + Console.WriteLine("Win : " + win); + Console.WriteLine("Lose : " + lose); + Console.WriteLine("승률 : " + win * 100 / (win + lose)); resultList.ToString(); } } diff --git a/Million/Manager/ExportManager.cs b/Million/Manager/ExportManager.cs index fd7b2e8..ce0bfba 100644 --- a/Million/Manager/ExportManager.cs +++ b/Million/Manager/ExportManager.cs @@ -40,10 +40,10 @@ namespace Million.Manager //result 돌면 서 데이터 처리 var fieldList = new List(); - fieldList + // Insert the text into the SharedStringTablePart. - int index = InsertSharedStringItem(text, shareStringPart); + int index = InsertSharedStringItem("", shareStringPart); // Insert a new worksheet. WorksheetPart worksheetPart = InsertWorksheet(spreadSheet.WorkbookPart); diff --git a/Million/Manager/SellLogicManager.cs b/Million/Manager/SellLogicManager.cs index a55727e..c1aa7af 100644 --- a/Million/Manager/SellLogicManager.cs +++ b/Million/Manager/SellLogicManager.cs @@ -50,5 +50,15 @@ namespace Million.Manager return list; } + public static List GetSellLogicLossCut(List candleDataM, int lossFactor, double buyValue) + { + var lossVal = buyValue * ((100 - lossFactor) / 100); + var list = candleDataM.Where(t => t.EndValue < lossVal).ToList(); + foreach (var item in list) + { + item.SellLogicFlag["LossCut"] = true; + } + return list; + } } }