Merge branch 'master' of http://59.26.54.110/BitGet_API
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -128,7 +128,6 @@
|
|||||||
<EmbeddedResource Include="MainForm.resx">
|
<EmbeddedResource Include="MainForm.resx">
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
|||||||
@@ -188,6 +188,10 @@ namespace BitgetAPI
|
|||||||
M30 = 30,
|
M30 = 30,
|
||||||
[Description("1H")]
|
[Description("1H")]
|
||||||
H1 = 60,
|
H1 = 60,
|
||||||
|
[Description("2H")]
|
||||||
|
H2 = 120,
|
||||||
|
[Description("3H")]
|
||||||
|
H3 = 180,
|
||||||
[Description("4H")]
|
[Description("4H")]
|
||||||
H4 = 240,
|
H4 = 240,
|
||||||
[Description("6H")]
|
[Description("6H")]
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ using BitgetAPI.IndicatorConditionSetup;
|
|||||||
using BitgetAPI.WebService;
|
using BitgetAPI.WebService;
|
||||||
using DevExpress.Internal.WinApi.Windows.UI.Notifications;
|
using DevExpress.Internal.WinApi.Windows.UI.Notifications;
|
||||||
using DevExpress.Utils.IoC;
|
using DevExpress.Utils.IoC;
|
||||||
|
using DevExpress.Xpo.Logger;
|
||||||
using DevExpress.XtraPrinting.Native;
|
using DevExpress.XtraPrinting.Native;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Serilog;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
@@ -117,6 +119,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
|
|
||||||
public void calProcess()
|
public void calProcess()
|
||||||
{
|
{
|
||||||
|
|
||||||
IchimokuConditionSetup ichimokuConditionSetup = new IchimokuConditionSetup();
|
IchimokuConditionSetup ichimokuConditionSetup = new IchimokuConditionSetup();
|
||||||
MovingAverageConditionSetup movingAverageConditionSetup = new MovingAverageConditionSetup();
|
MovingAverageConditionSetup movingAverageConditionSetup = new MovingAverageConditionSetup();
|
||||||
|
|
||||||
@@ -262,8 +265,6 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
if (checked구름떼상향돌파 && candleData_전봉.Open < candleData_전봉.IchimokData.상한선 && candleData.Open > candleData.IchimokData.상한선 && candleData.Low > candleData.IchimokData.상한선
|
if (checked구름떼상향돌파 && candleData_전봉.Open < candleData_전봉.IchimokData.상한선 && candleData.Open > candleData.IchimokData.상한선 && candleData.Low > candleData.IchimokData.상한선
|
||||||
&& candleData.Close > candleData.IchimokData.상한선)
|
&& candleData.Close > candleData.IchimokData.상한선)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var indicatorPrice = candleData.Open;
|
var indicatorPrice = candleData.Open;
|
||||||
var indicatorRate = (candleData.Close / indicatorPrice) * 100 - 100;
|
var indicatorRate = (candleData.Close / indicatorPrice) * 100 - 100;
|
||||||
|
|
||||||
@@ -302,7 +303,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
|
|
||||||
// 없으면 생성
|
// 없으면 생성
|
||||||
if (signalData == null)
|
if (signalData == null)
|
||||||
{
|
{
|
||||||
var price = candleData.Close;
|
var price = candleData.Close;
|
||||||
var rate = (candleData.Close / candleData.Open) * 100 - 100;
|
var rate = (candleData.Close / candleData.Open) * 100 - 100;
|
||||||
|
|
||||||
@@ -372,15 +373,15 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
var Bol12 = candleData.movingAverageDataList[12].BolangerValue;
|
var Bol12 = candleData.movingAverageDataList[12].BolangerValue;
|
||||||
var Bol24 = candleData.movingAverageDataList[24].BolangerValue;
|
var Bol24 = candleData.movingAverageDataList[24].BolangerValue;
|
||||||
|
|
||||||
|
//5분봉이 default이지만 15분봉으로 변경
|
||||||
if ((int)interval != 5)
|
if ((int)interval != 15)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 15분봉 처리
|
#region 15분봉 처리
|
||||||
//60분봉 관련 처리
|
//15분봉이지만 60분봉으로 변경
|
||||||
var candleDatas15 = findedMarket.candleDataList[MCandleTimeType.M15];
|
var candleDatas15 = findedMarket.candleDataList[MCandleTimeType.H1];
|
||||||
var candleDatas15_정렬 = candleDatas15.ToList().OrderBy(i => i.Argument).ToList();
|
var candleDatas15_정렬 = candleDatas15.ToList().OrderBy(i => i.Argument).ToList();
|
||||||
|
|
||||||
var candleData15 = candleDatas15.Find(i => i.Argument == candleDatas15_정렬.Last().Argument);
|
var candleData15 = candleDatas15.Find(i => i.Argument == candleDatas15_정렬.Last().Argument);
|
||||||
@@ -434,8 +435,8 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 1분봉 처리
|
#region 1분봉 처리
|
||||||
|
//1분봉이지만 3분봉으로 변경
|
||||||
var candleDatas1 = findedMarket.candleDataList[MCandleTimeType.M1];
|
var candleDatas1 = findedMarket.candleDataList[MCandleTimeType.M3];
|
||||||
var candleDatas1_정렬 = candleDatas1.ToList().OrderBy(i => i.Argument).ToList();
|
var candleDatas1_정렬 = candleDatas1.ToList().OrderBy(i => i.Argument).ToList();
|
||||||
|
|
||||||
var candleData1 = candleDatas1.Find(i => i.Argument == candleDatas1_정렬.Last().Argument);
|
var candleData1 = candleDatas1.Find(i => i.Argument == candleDatas1_정렬.Last().Argument);
|
||||||
@@ -483,7 +484,8 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 60분봉 처리
|
#region 60분봉 처리
|
||||||
var candleDatas60 = findedMarket.candleDataList[MCandleTimeType.H1];
|
//60분봉이지만 180분 처리
|
||||||
|
var candleDatas60 = findedMarket.candleDataList[MCandleTimeType.H2];
|
||||||
var candleDatas60_정렬 = candleDatas60.ToList().OrderBy(i => i.Argument).ToList();
|
var candleDatas60_정렬 = candleDatas60.ToList().OrderBy(i => i.Argument).ToList();
|
||||||
|
|
||||||
var candleData60 = candleDatas60.Find(i => i.Argument == candleDatas60_정렬.Last().Argument);
|
var candleData60 = candleDatas60.Find(i => i.Argument == candleDatas60_정렬.Last().Argument);
|
||||||
@@ -816,14 +818,22 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
{
|
{
|
||||||
double.TryParse(orderDic["Size"].ToString(), out var size);
|
double.TryParse(orderDic["Size"].ToString(), out var size);
|
||||||
var sellOrder = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.SellLong, OrderType.market, YHKIM_Leverage, orderDic["orderId"].ToString());
|
var sellOrder = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.SellLong, OrderType.market, YHKIM_Leverage, orderDic["orderId"].ToString());
|
||||||
var sellOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(sellOrder["data"]));
|
|
||||||
|
|
||||||
var detail = GetFutureOrderDetail(market, sellOrderDic["orderId"]);
|
if (sellOrder != null)
|
||||||
var detailOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(detail["data"]));
|
{
|
||||||
|
var sellOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(sellOrder["data"]));
|
||||||
double.TryParse(detailOrderDic["price"].ToString(), out var sellPriceValue);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error("Sell 안됨 확인 필요");
|
||||||
|
}
|
||||||
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
|
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
|
||||||
var resultRateData = ((sellPriceValue - buyPriceValue) / buyPriceValue) * 100;
|
//var detail = GetFutureOrderDetail(market, sellOrderDic["orderId"]);
|
||||||
|
//var detailOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(detail["data"]));
|
||||||
|
|
||||||
|
//double.TryParse(detailOrderDic["price"].ToString(), out var sellPriceValue);
|
||||||
|
|
||||||
|
var resultRateData = ((price - buyPriceValue) / buyPriceValue) * 100;
|
||||||
|
|
||||||
var orderResult = new Dictionary<string, object>()
|
var orderResult = new Dictionary<string, object>()
|
||||||
{
|
{
|
||||||
@@ -834,7 +844,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
{ "MCandleTimeType", (int)interval },
|
{ "MCandleTimeType", (int)interval },
|
||||||
{ "BuyCandle", buyItem["Candle"] },
|
{ "BuyCandle", buyItem["Candle"] },
|
||||||
{ "SellDate", nowTime},
|
{ "SellDate", nowTime},
|
||||||
{ "SellPrice", detailOrderDic["price"] },
|
{ "SellPrice", price},
|
||||||
{ "SellCandle", candleData },
|
{ "SellCandle", candleData },
|
||||||
{ "Rate", resultRateData }
|
{ "Rate", resultRateData }
|
||||||
};
|
};
|
||||||
@@ -1048,7 +1058,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
전저점Data["flag"] = false;
|
전저점Data["flag"] = false;
|
||||||
전저점Data["clearFlag"] = false;
|
전저점Data["clearFlag"] = false;
|
||||||
|
|
||||||
if(ShortCount < 3)
|
if(ShortCount < 2)
|
||||||
{
|
{
|
||||||
double size = YHKIM_OrderAmount / price;
|
double size = YHKIM_OrderAmount / price;
|
||||||
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyShort, OrderType.limit, YHKIM_Leverage);
|
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyShort, OrderType.limit, YHKIM_Leverage);
|
||||||
@@ -1119,14 +1129,24 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
{
|
{
|
||||||
double.TryParse(orderDic["Size"].ToString(), out var size);
|
double.TryParse(orderDic["Size"].ToString(), out var size);
|
||||||
var sellOrder = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.SellShort, OrderType.market, YHKIM_Leverage, orderDic["orderId"].ToString());
|
var sellOrder = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.SellShort, OrderType.market, YHKIM_Leverage, orderDic["orderId"].ToString());
|
||||||
var sellOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(sellOrder["data"]));
|
|
||||||
|
|
||||||
var detail = GetFutureOrderDetail(market, sellOrderDic["orderId"]);
|
if (sellOrder != null)
|
||||||
var detailOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(detail["data"]));
|
{
|
||||||
|
var sellOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(sellOrder["data"]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.Error("Sell 안됨 확인 필요");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
double.TryParse(detailOrderDic["price"].ToString(), out var sellPriceValue);
|
|
||||||
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
|
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
|
||||||
var resultRateData = ((sellPriceValue - buyPriceValue) / buyPriceValue) * 100;
|
//var detail = GetFutureOrderDetail(market, sellOrderDic["orderId"]);
|
||||||
|
//var detailOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(detail["data"]));
|
||||||
|
|
||||||
|
//double.TryParse(detailOrderDic["price"].ToString(), out var sellPriceValue);
|
||||||
|
|
||||||
|
var resultRateData = ((price - buyPriceValue) / buyPriceValue) * 100;
|
||||||
|
|
||||||
var orderResult = new Dictionary<string, object>()
|
var orderResult = new Dictionary<string, object>()
|
||||||
{
|
{
|
||||||
@@ -1137,7 +1157,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
{ "MCandleTimeType", (int)interval },
|
{ "MCandleTimeType", (int)interval },
|
||||||
{ "BuyCandle", buyItem["Candle"] },
|
{ "BuyCandle", buyItem["Candle"] },
|
||||||
{ "SellDate", nowTime},
|
{ "SellDate", nowTime},
|
||||||
{ "SellPrice", detailOrderDic["price"] },
|
{ "SellPrice", price },
|
||||||
{ "SellCandle", candleData },
|
{ "SellCandle", candleData },
|
||||||
{ "Rate", resultRateData }
|
{ "Rate", resultRateData }
|
||||||
};
|
};
|
||||||
@@ -1330,7 +1350,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
var result = CancelFutureOrder(symbol, id);
|
var result = CancelFutureOrder(symbol, id);
|
||||||
if (result == null || result["msg"]?.ToString() != "success")
|
if (result == null || result["msg"]?.ToString() != "success")
|
||||||
{
|
{
|
||||||
Console.WriteLine("Sell에서 Cancel관련 Error");
|
Log.Error("Sell에서 Cancel관련 Error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ using DevExpress.XtraEditors.Filtering;
|
|||||||
using DevExpress.XtraExport.Xls;
|
using DevExpress.XtraExport.Xls;
|
||||||
using DevExpress.Utils.Filtering.Internal;
|
using DevExpress.Utils.Filtering.Internal;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace BitgetAPI.WebService
|
namespace BitgetAPI.WebService
|
||||||
{
|
{
|
||||||
@@ -207,6 +208,12 @@ namespace BitgetAPI.WebService
|
|||||||
case CommonProperty.MCandleTimeType.H1:
|
case CommonProperty.MCandleTimeType.H1:
|
||||||
timespan_add = new System.TimeSpan(1, 0, 0);
|
timespan_add = new System.TimeSpan(1, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
case CommonProperty.MCandleTimeType.H2:
|
||||||
|
timespan_add = new System.TimeSpan(2, 0, 0);
|
||||||
|
break;
|
||||||
|
case CommonProperty.MCandleTimeType.H3:
|
||||||
|
timespan_add = new System.TimeSpan(3, 0, 0);
|
||||||
|
break;
|
||||||
case CommonProperty.MCandleTimeType.H4:
|
case CommonProperty.MCandleTimeType.H4:
|
||||||
timespan_add = new System.TimeSpan(4, 0, 0);
|
timespan_add = new System.TimeSpan(4, 0, 0);
|
||||||
break;
|
break;
|
||||||
@@ -304,7 +311,7 @@ namespace BitgetAPI.WebService
|
|||||||
using (var reader = new StreamReader(Response.GetResponseStream()))
|
using (var reader = new StreamReader(Response.GetResponseStream()))
|
||||||
{
|
{
|
||||||
var sRespBodyData = reader.ReadToEnd();
|
var sRespBodyData = reader.ReadToEnd();
|
||||||
Console.WriteLine(sRespBodyData);
|
Log.Error(webEx, sRespBodyData);
|
||||||
//return (JObject.Parse(sRespBodyData));
|
//return (JObject.Parse(sRespBodyData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user