임시처리

This commit is contained in:
kyh
2024-10-31 10:26:13 +09:00
parent 509e8bf2a5
commit bfa898df2f

View File

@@ -268,7 +268,7 @@ namespace BitgetAPI.IndicatorConditionSetup
// 없으면 생성
if (signalData == null)
{
{
var price = candleData.Close;
var rate = (candleData.Close / candleData.Open) * 100 - 100;
@@ -711,9 +711,9 @@ namespace BitgetAPI.IndicatorConditionSetup
전고점Data["clearFlag"] = false;
if (LongCount < 3)
{
double size = 50 / price;
if (LongCount < 2)
{
double size = ((double)((double)90) / price);
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyLong, OrderType.limit, 10);
var orderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(orderData["data"]));
@@ -781,15 +781,16 @@ namespace BitgetAPI.IndicatorConditionSetup
if (orderDic != null)
{
double.TryParse(orderDic["Size"].ToString(), out var size);
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
var sellOrder = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.SellLong, OrderType.market, 10, orderDic["orderId"].ToString());
var sellOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(sellOrder["data"]));
var detail = GetFutureOrderDetail(market, sellOrderDic["orderId"]);
var detailOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(detail["data"]));
//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);
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
var resultRateData = ((sellPriceValue - buyPriceValue) / buyPriceValue) * 100;
//double.TryParse(detailOrderDic["price"].ToString(), out var sellPriceValue);
var resultRateData = ((price - buyPriceValue) / buyPriceValue) * 100;
var orderResult = new Dictionary<string, object>()
{
@@ -800,7 +801,7 @@ namespace BitgetAPI.IndicatorConditionSetup
{ "MCandleTimeType", (int)interval },
{ "BuyCandle", buyItem["Candle"] },
{ "SellDate", nowTime},
{ "SellPrice", detailOrderDic["price"] },
{ "SellPrice", price},
{ "SellCandle", candleData },
{ "Rate", resultRateData }
};
@@ -1014,9 +1015,9 @@ namespace BitgetAPI.IndicatorConditionSetup
전저점Data["flag"] = false;
전저점Data["clearFlag"] = false;
if(ShortCount < 3)
if(ShortCount < 2)
{
double size = 50 / price;
double size = ((double)((double)90) / price);
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyShort, OrderType.limit, 10);
var orderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(orderData["data"]));
@@ -1084,15 +1085,16 @@ namespace BitgetAPI.IndicatorConditionSetup
if (orderDic != null)
{
double.TryParse(orderDic["Size"].ToString(), out var size);
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
var sellOrder = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.SellShort, OrderType.market, 10, orderDic["orderId"].ToString());
var sellOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(sellOrder["data"]));
var detail = GetFutureOrderDetail(market, sellOrderDic["orderId"]);
var detailOrderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(detail["data"]));
//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);
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
var resultRateData = ((sellPriceValue - buyPriceValue) / buyPriceValue) * 100;
//double.TryParse(detailOrderDic["price"].ToString(), out var sellPriceValue);
var resultRateData = ((price - buyPriceValue) / buyPriceValue) * 100;
var orderResult = new Dictionary<string, object>()
{
@@ -1103,7 +1105,7 @@ namespace BitgetAPI.IndicatorConditionSetup
{ "MCandleTimeType", (int)interval },
{ "BuyCandle", buyItem["Candle"] },
{ "SellDate", nowTime},
{ "SellPrice", detailOrderDic["price"] },
{ "SellPrice", price },
{ "SellCandle", candleData },
{ "Rate", resultRateData }
};