잡다한 에러수정
This commit is contained in:
@@ -412,7 +412,7 @@ namespace Million_Buyer
|
||||
sw.Stop();
|
||||
if (sw.Elapsed.TotalSeconds > 1)
|
||||
InsertLog("Execute 계산 시간 : " + sw.Elapsed.ToString());
|
||||
|
||||
|
||||
var minDateTime = dic[MCandleTimeType.M1].Select(t => t.DateTime).Min();
|
||||
var maxDateTime = dic[MCandleTimeType.M1].Select(t => t.DateTime).Max().AddHours(1);
|
||||
|
||||
@@ -425,9 +425,24 @@ namespace Million_Buyer
|
||||
|
||||
#region 사고 파는 로직
|
||||
//최신 데이터 가져오기
|
||||
var recentlyData = dic[MCandleTimeType.M1][dic[MCandleTimeType.M1].Count - 1];
|
||||
var recentlyDataList = dic[MCandleTimeType.M1].Where(t=>t.RecentlyDataFlag).ToList();
|
||||
if (recentlyDataList.Count == 0)
|
||||
continue;
|
||||
var maxTime = recentlyDataList.Select(t => t.DateTime).Max();
|
||||
var recentlyData = recentlyDataList.FirstOrDefault(t => t.DateTime == maxTime);
|
||||
|
||||
if (recentlyData == null)
|
||||
continue;
|
||||
|
||||
// Parent Recently Data는 indicator에 따라 달라질수 있으므로 전부다 처리한 후 초기화
|
||||
foreach (var data in dic)
|
||||
{
|
||||
var recentlyList = data.Value.Where(t => t.RecentlyDataFlag).ToList();
|
||||
|
||||
foreach (var recentlyItem in recentlyList)
|
||||
recentlyItem.RecentlyDataFlag = false;
|
||||
}
|
||||
|
||||
/*
|
||||
* 로직 설명
|
||||
* 1. Buy List에 있는지 확인
|
||||
@@ -473,6 +488,11 @@ namespace Million_Buyer
|
||||
{
|
||||
recentlyData.BuyCount = Math.Round(cycleBuyMoney / recentlyData.BuyValue, 8);
|
||||
buyData.Uuid = OrderBuy(buyData.ConGoodsData.CoinFullName, recentlyData.BuyCount, recentlyData.BuyValue);
|
||||
if (buyData.Uuid == "")
|
||||
{
|
||||
InsertLog("Return Data 가 에러라서 구매 불가. Log 확인 바람");
|
||||
continue;
|
||||
}
|
||||
buyCycleCount++;
|
||||
}
|
||||
|
||||
@@ -783,6 +803,7 @@ namespace Million_Buyer
|
||||
InsertLog("------------------------------------");
|
||||
InsertLog("Buy Return Data : " + JsonConvert.SerializeObject(returnData));
|
||||
InsertLog("------------------------------------");
|
||||
if (returnData == null) return "";
|
||||
return returnData.Uuid;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user