임시 커밋

This commit is contained in:
kyh
2022-10-26 23:16:24 +09:00
parent a30777b7a8
commit 535927cb3c
2 changed files with 51 additions and 27 deletions

View File

@@ -223,11 +223,13 @@ namespace Million_Buyer
orderList = orderList.Distinct().ToList();
this.BeginInvoke(new Action(delegate ()
{
tl_RealtimeOrder.Nodes.Clear();
foreach (var item in orderList)
try
{
tl_RealtimeOrder.AppendNode(new object[]
tl_RealtimeOrder.Nodes.Clear();
foreach (var item in orderList)
{
tl_RealtimeOrder.AppendNode(new object[]
{
item.Uuid,
item.CoinFullName,
item.Side,
@@ -236,13 +238,18 @@ namespace Million_Buyer
item.Volume,
item.ExecutedVolume,
item.CreateOrderTime.ToString("yyyy-MM-dd HH:mm:ss")
}, null);
}
}, null);
}
var tempData = orderList.Select(t => t.Uuid).ToList();
tempData.AddRange(buyList.Select(t => t.Uuid).ToList());
buyCycleCount = tempData.Distinct().ToList().Count;
lb_BuyMarketCount.Text = tempData.Distinct().ToList().Count.ToString();
var tempData = orderList.Select(t => t.Uuid).ToList();
tempData.AddRange(buyList.Select(t => t.Uuid).ToList());
buyCycleCount = tempData.Distinct().ToList().Count;
lb_BuyMarketCount.Text = tempData.Distinct().ToList().Count.ToString();
}
catch (Exception e)
{
InsertLog("Order Thread Error : " + e.Message);
}
}));
//1초에 한번씩 부르게 처리
@@ -466,10 +473,18 @@ namespace Million_Buyer
//grid 처리 구매항목, 구매 가격, 구매 개수, 구매시점
this.BeginInvoke(new Action(delegate ()
{
tl_BuyList.AppendNode(new object[]
{buyData.ConGoodsData.CoinFullName, recentlyData.BuyValue, recentlyData.BuyCount, time.ToString("yyyy-MM-dd HH:mm:ss") }, null);
try {
tl_BuyList.AppendNode(new object[]
{
buyData.ConGoodsData.CoinFullName, recentlyData.BuyValue, recentlyData.BuyCount, time.ToString("yyyy-MM-dd HH:mm:ss")
}, null);
lb_BuyMarketCount.Text = buyList.Count.ToString();
lb_BuyMarketCount.Text = buyList.Count.ToString();
}
catch (Exception e)
{
InsertLog("Buy 후 Grid Insert Error : " + e.Message);
}
}));
sw.Stop();
if (sw.Elapsed.TotalSeconds > 1)
@@ -535,21 +550,23 @@ namespace Million_Buyer
InsertLog(buyItem.ConGoodsData.CoinFullName + " Market Data 판매 DateTime : " + time.ToString("yyyy-MM-dd HH:mm:ss"));
this.BeginInvoke(new Action(delegate ()
{
//Grid 처리
TreeListNode buyNode = null;
foreach (TreeListNode node in tl_BuyList.Nodes)
try
{
if (node.GetValue("BuyMarket").ToString() == buyItem.ConGoodsData.CoinFullName)
//Grid 처리
TreeListNode buyNode = null;
foreach (TreeListNode node in tl_BuyList.Nodes)
{
buyNode = node;
break;
if (node.GetValue("BuyMarket").ToString() == buyItem.ConGoodsData.CoinFullName)
{
buyNode = node;
break;
}
}
}
var moneyVal = (sellVal * (1 - 0.0015) - buyCandleData.BuyValue * (1 - 0.0015)) * result.SellCount;
var moneyVal = (sellVal * (1 - 0.0015) - buyCandleData.BuyValue * (1 - 0.0015)) * result.SellCount;
tl_Result.AppendNode(new object[] {
tl_Result.AppendNode(new object[] {
buyNode.GetValue("BuyMarket"),
buyNode.GetValue("BuyValue"),
buyNode.GetValue("BuyCount"),
@@ -561,9 +578,14 @@ namespace Million_Buyer
moneyVal
}, null);
tl_BuyList.Nodes.Remove(buyNode);
tl_BuyList.Nodes.Remove(buyNode);
lb_BuyMarketCount.Text = buyList.Count.ToString();
lb_BuyMarketCount.Text = buyList.Count.ToString();
}
catch (Exception e)
{
InsertLog("Sell Logic Grid Error" + e.Message);
}
}));
if (sw.Elapsed.TotalSeconds > 1)
InsertLog("Sell 계산 로직 : " + sw.Elapsed.ToString());
@@ -572,7 +594,7 @@ namespace Million_Buyer
#endregion
}
cnt++;
if (cnt % 60 == 0)
if (cnt % 100000 == 0)
{
InsertLog("Scanning......" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
cnt = 0;

View File

@@ -636,7 +636,9 @@ namespace Million.Manager
//최초로 매수, 매도 진행 시 사전 조건과의 Tick거리를 예외할 수 있어야 함
//OverlapValue는 사야할 데이터, beforeIndiValue는 사전 데이터
var beforeIndiValue = parent.IndicatorDic[subKey].value;
if (!GetTickDifferenceCount(overlapData, beforeIndiValue, 3)) return;
if (beforeIndiValue == 0) continue;
if (!GetTickDifferenceCount(overlapData, beforeIndiValue, 3)) continue;
//최초 시점이 아닐 경우
if ((subManagement != null && subManagement[coinFullName]) || !firstFlag)
@@ -668,7 +670,7 @@ namespace Million.Manager
/// <returns></returns>
public static bool GetTickDifferenceCount(double standardValue, double compareValue, int tickCount)
{
var bigData = standardValue > compareValue ? standardValue : compareValue;
var bigData = standardValue> compareValue ? standardValue : compareValue;
var smallData = standardValue < compareValue ? standardValue : compareValue;
var calBigData = OrderbookManager.GetAskPrice(bigData, false);