test
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using BitgetAPI.Data;
|
||||
using BitgetAPI.IndicatorConditionSetup;
|
||||
using BitgetAPI.WebService;
|
||||
using DevExpress.Internal.WinApi.Windows.UI.Notifications;
|
||||
using DevExpress.Utils.IoC;
|
||||
using DevExpress.XtraPrinting.Native;
|
||||
using Newtonsoft.Json;
|
||||
@@ -92,9 +93,9 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
|
||||
//시작시 한번만 하면됨(양방향)
|
||||
ChangeFuturePositionMode(FuturePositionMode.hedge_mode);
|
||||
GetFutureAccountList();
|
||||
//GetFutureAccountList();
|
||||
//order 로직
|
||||
//var orderData = FutureOrder("XRPUSDT", FutureMarginMode.isolated, 10, (double)0.541, FutureSide.BuyShort, OrderType.limit, 10);
|
||||
//var orderDatas = FutureOrder("XRPUSDT", FutureMarginMode.isolated, 10, (double)0.549, FutureSide.BuyShort, OrderType.limit, 10);
|
||||
|
||||
//var orderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(orderData["data"]));
|
||||
//var orderValue = new Dictionary<string, object>();
|
||||
@@ -1115,7 +1116,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1124,7 +1125,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1218,7 +1219,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{"ACCESS-TIMESTAMP",timestamp}
|
||||
};
|
||||
|
||||
return (Dictionary<string, object>)WebConnection.SendWebServer(ExchangeWebReqType.BitgetOrderDetail_Future, BitgetURL_OrderDetail_Future + "?symbol=" + symbol.ToString() + "&orderId=" + id.ToString() + "&productType=USDT-FUTURES", null, MCandleTimeType.M1, "", "", orderDetailnvc);
|
||||
return (Dictionary<string, object>)WebConnection.SendWebServer(ExchangeWebReqType.BitgetOrderDetail_Future, BitgetURL_OrderDetail_Future + "?symbol=" + symbol.ToString() + "&orderId=" + orderId.ToString() + "&productType=USDT-FUTURES", null, MCandleTimeType.M1, "", "", orderDetailnvc);
|
||||
|
||||
}
|
||||
|
||||
@@ -1245,7 +1246,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
side = "sell";
|
||||
tradeSide = "close";
|
||||
}
|
||||
else if (futureSide == FutureSide.SellShort)
|
||||
else if (futureSide == FutureSide.SellLong)
|
||||
{
|
||||
side = "buy";
|
||||
tradeSide = "close";
|
||||
@@ -1272,7 +1273,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{"ACCESS-TIMESTAMP", timestamp}
|
||||
};
|
||||
var result = (Dictionary<string, object>)WebConnection.SendWebServer(ExchangeWebReqType.BitgetChangeMarginMode_Future, BitgetURL_ChangeMarginMode_Future, null, MCandleTimeType.M1, changeMarginModeStr, "", nvcMargin);
|
||||
if (result["msg"]?.ToString() != "success")
|
||||
if (result == null || result["msg"]?.ToString() != "success")
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -1286,11 +1287,18 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{"ACCESS-TIMESTAMP", timestamp}
|
||||
};
|
||||
result = (Dictionary<string, object>)WebConnection.SendWebServer(ExchangeWebReqType.BitgetChangeLeverage_Future, BitgetURL_ChangeLeverage_Future, null, MCandleTimeType.M1, leverageStr, "", nvcLeverage);
|
||||
if (result["msg"]?.ToString() != "success")
|
||||
if (result == null ||result["msg"]?.ToString() != "success")
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
var result = CancelFutureOrder(symbol, id);
|
||||
if (result == null || result["msg"]?.ToString() != "success")
|
||||
{
|
||||
Console.WriteLine("Sell에서 Cancel관련 Error");
|
||||
}
|
||||
}
|
||||
|
||||
var postStr = "{\"symbol\": \"" + symbol + "\", \"productType\": \"usdt-futures\", \"marginMode\": \"" + Utils.Convertor.GetEnumDescription((Enum)marginMode) + "\", \"marginCoin\": \"USDT\", \"size\": \""
|
||||
+ size.ToString() + "\", \"price\": \"" + price.ToString() + "\", \"side\": \"" + side + "\", " + "\"tradeSide\": \"" + tradeSide + "\", \"orderType\": \"" + Utils.Convertor.GetEnumDescription((Enum)orderType)
|
||||
|
||||
Reference in New Issue
Block a user