This commit is contained in:
kyh
2024-10-31 10:28:47 +09:00
103 changed files with 492 additions and 91050 deletions

View File

@@ -23,12 +23,46 @@ namespace BitgetAPI.IndicatorConditionSetup
{
public class IndicatorProcess
{
GlobalOptions options = GlobalOptions.Instance;
CommonProperty commonProperty = CommonProperty.Instance;
//영호 Key
private string YHKIM_AccessKey = "bg_f93aa530288b6ec9d62095994c51972a";
private string YHKIM_SecreteKey = "2fce18bcd12ca23a7920c48295a58da031443ea383af8114ed599c1b14ac678e";
private string YHKIM_PassphraseKey = "dudgh0505";
private string YHKIM_AccessKey { get
{
return options.SelectAPI.AccessKey;
}
}
// = "bg_f93aa530288b6ec9d62095994c51972a";
private string YHKIM_SecreteKey
{
get {
return options.SelectAPI.SecretKey;
}
}// = "2fce18bcd12ca23a7920c48295a58da031443ea383af8114ed599c1b14ac678e";
private string YHKIM_PassphraseKey
{
get
{
return options.SelectAPI.PassphraseKey;
}
}// = "dudgh0505";
private double YHKIM_Leverage
{
get
{
return options.Leverage;
}
}
private double YHKIM_OrderAmount
{
get
{
return options.OrderAmount;
}
}
// 스레드 시작/종료 플래그
public bool Is_th_SignalInfo;
@@ -711,10 +745,10 @@ namespace BitgetAPI.IndicatorConditionSetup
전고점Data["clearFlag"] = false;
if (LongCount < 2)
{
double size = ((double)((double)90) / price);
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyLong, OrderType.limit, 10);
if (LongCount < 3)
{
double size = YHKIM_OrderAmount / price;
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyLong, OrderType.limit, YHKIM_Leverage);
var orderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(orderData["data"]));
var orderDataDic = new Dictionary<string, object>
@@ -781,15 +815,14 @@ 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 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"]));
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
//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>()
@@ -1017,8 +1050,8 @@ namespace BitgetAPI.IndicatorConditionSetup
if(ShortCount < 2)
{
double size = ((double)((double)90) / price);
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyShort, OrderType.limit, 10);
double size = YHKIM_OrderAmount / price;
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyShort, OrderType.limit, YHKIM_Leverage);
var orderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(orderData["data"]));
var orderDataDic = new Dictionary<string, object>
@@ -1085,15 +1118,14 @@ 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 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"]));
double.TryParse(orderDic["Price"].ToString(), out var buyPriceValue);
//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>()