코드 최신화 처리 완료
This commit is contained in:
@@ -76,6 +76,11 @@ namespace Million_Buyer
|
||||
{
|
||||
InitManager.InitFunc("Upbit", PaymentType.KRW);
|
||||
|
||||
cb_BigMoneyVolType.Properties.Items.Clear();
|
||||
cb_BigMoneyVolType.Properties.Items.AddRange(InitManager.GetCandleTimeTypes());
|
||||
cb_BuyBigthanHighType.Properties.Items.Clear();
|
||||
cb_BuyBigthanHighType.Properties.Items.AddRange(InitManager.GetCandleTimeTypes());
|
||||
|
||||
_saveResultData = new SavedResultData
|
||||
{
|
||||
BuySetupList = new List<object>(),
|
||||
@@ -161,10 +166,10 @@ namespace Million_Buyer
|
||||
|
||||
int.TryParse(tb_BigMoneyVolCnt.Text, out BigMoneyVolCnt);
|
||||
BigMoneyVolFlag = ck_BigMoneyVol.Checked;
|
||||
BigMoneyVolType = (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BigMoneyVolType.ToString());
|
||||
BigMoneyVolType = (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BigMoneyVolType.Text.ToString());
|
||||
|
||||
BuyBigthanHighValFlag = ck_BuyBigthanHighVal.Checked;
|
||||
BuyBigthanHighValType = (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), BuyBigthanHighValType.ToString());
|
||||
BuyBigthanHighValType = (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BigMoneyVolType.Text.ToString());
|
||||
|
||||
bt_BuyStart_Click(null, null);
|
||||
|
||||
@@ -508,15 +513,6 @@ namespace Million_Buyer
|
||||
{
|
||||
if (overlapBuyManagementList[item])
|
||||
{
|
||||
InsertLog("Insert Buy Logic");
|
||||
if (programMode == BuyerMode.Buyer)
|
||||
{
|
||||
LogManager.WriteLog("Buy CoinFullName : " + item + "\r\nCandleData : " + JsonConvert.SerializeObject(recentlyData), "BuySell");
|
||||
InsertLog("Buy Coin Name : " + item + ", DateTime : " + recentlyData.DateTime.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
if (buyCycleCount >= cycleCount)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (StarValueLowBuyValueUp)
|
||||
{
|
||||
//if (recentlyData.StartValue < beforeData.HighValue)
|
||||
@@ -561,11 +557,11 @@ namespace Million_Buyer
|
||||
}
|
||||
else if ((int)BigMoneyVolType < 1440)
|
||||
{
|
||||
date = date.AddHours(((int)BigMoneyVolType * BigMoneyVolCnt) * -1);
|
||||
date = date.AddHours((((int)BigMoneyVolType / 60) * BigMoneyVolCnt) * -1);
|
||||
}
|
||||
|
||||
//임시 5개 비교
|
||||
var tempList = compareList.Where(t => t.DateTime >= date).ToList();
|
||||
var tempList = compareList.Where(t => t.DateTime > date).ToList();
|
||||
tempList.Remove(recentlyCompareData);
|
||||
var maxVol = tempList.Max(t => t.MoneyVolume);
|
||||
if (maxVol > recentlyCompareData.MoneyVolume)
|
||||
@@ -575,8 +571,14 @@ namespace Million_Buyer
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
InsertLog("Insert Buy Logic");
|
||||
if (programMode == BuyerMode.Buyer)
|
||||
{
|
||||
LogManager.WriteLog("Buy CoinFullName : " + item + "\r\nCandleData : " + JsonConvert.SerializeObject(recentlyData), "BuySell");
|
||||
InsertLog("Buy Coin Name : " + item + ", DateTime : " + recentlyData.DateTime.ToString("yyyy-MM-dd HH:mm:ss"));
|
||||
if (buyCycleCount >= cycleCount)
|
||||
continue;
|
||||
}
|
||||
sw.Restart();
|
||||
//if (resultDataList.Select(t => t.MarketData).ToList().Any(t => t.CoinFullName == item)) continue;
|
||||
var time = DateTime.Now;
|
||||
|
||||
@@ -285,8 +285,8 @@ namespace Million
|
||||
CommonProperty.InsertLogFlag = false;
|
||||
int.TryParse(tb_BigMoneyVolCnt.Text, out int val);
|
||||
CalculateDatas(_saveResultData, cb_UpperMainIndi.Checked, cb_IncludeClearIndicator.Checked, cb_DownBeforeValueFlag.Checked, rd_Hunter.Checked,
|
||||
ck_BigMoneyVol.Checked, (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BigMoneyVolType.ToString()),
|
||||
ck_BuyBigthanHighVal.Checked, (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BuyBigthanHighType.ToString()), val);
|
||||
ck_BigMoneyVol.Checked, (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BigMoneyVolType.Text.ToString()),
|
||||
ck_BuyBigthanHighVal.Checked, (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BuyBigthanHighType.Text.ToString()), val);
|
||||
|
||||
// 3. 자동으로 저장하기
|
||||
if (DBConnection.QueryInsertExecuter_SavedResultData(_saveResultData))
|
||||
@@ -657,15 +657,15 @@ namespace Million
|
||||
|
||||
if((int)bigMoneyVolType < 60)
|
||||
{
|
||||
date = date.AddMinutes(((int)bigMoneyVolType * bigMoneyVolCnt)*-1);
|
||||
date = date.AddMinutes(((int)bigMoneyVolType * bigMoneyVolCnt) * -1);
|
||||
}
|
||||
else if((int)bigMoneyVolType < 1440)
|
||||
{
|
||||
date = date.AddHours(((int)bigMoneyVolType * bigMoneyVolCnt) * -1);
|
||||
date = date.AddHours((((int)bigMoneyVolType /60) * bigMoneyVolCnt) * -1);
|
||||
}
|
||||
|
||||
//임시 5개 비교
|
||||
var tempList = compareList.Where(t => t.DateTime >= date).ToList();
|
||||
var tempList = compareList.Where(t => t.DateTime > date).ToList();
|
||||
tempList.Remove(recentlyCompareData);
|
||||
var maxVol = tempList.Max(t => t.MoneyVolume);
|
||||
if (maxVol > recentlyCompareData.MoneyVolume)
|
||||
@@ -1136,7 +1136,7 @@ namespace Million
|
||||
|
||||
if (data.BigMoneyVolFlag)
|
||||
{
|
||||
data.BigMoneyVolType = (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BigMoneyVolType.ToString());
|
||||
data.BigMoneyVolType = (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BigMoneyVolType.Text.ToString());
|
||||
int.TryParse(tb_BigMoneyVolCnt.Text, out int val);
|
||||
if (val == 0) val = 1;
|
||||
data.BigMoneyVolCnt = val;
|
||||
@@ -1146,7 +1146,7 @@ namespace Million
|
||||
|
||||
if (data.BuyBigthanHighValFlag)
|
||||
{
|
||||
data.BuyBigthanHighValType= (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BuyBigthanHighType.ToString());
|
||||
data.BuyBigthanHighValType= (MCandleTimeType)Enum.Parse(typeof(MCandleTimeType), cb_BuyBigthanHighType.Text.ToString());
|
||||
}
|
||||
|
||||
multiSavedResultDatas.Add(data);
|
||||
|
||||
@@ -316,7 +316,7 @@ namespace Million
|
||||
|
||||
//TODO 추후 관리 방안 고려
|
||||
#region # 데이터 베이스 정보 #
|
||||
public const string DbServerIp = "220.123.49.58";
|
||||
public const string DbServerIp = "59.26.54.110";
|
||||
public const string DbServerUserId = "million";
|
||||
public const string DbServerUserPassword = "million!";
|
||||
public static string DbConnectionStr = $"Data Source={DbServerIp};uid={DbServerUserId};pwd={DbServerUserPassword};Database=";
|
||||
|
||||
@@ -833,6 +833,7 @@ namespace Million.DbManagement
|
||||
/// <returns></returns>
|
||||
public static List<SavedResultData> QueryGetExecuter_SavedResultData(List<int> idList = null, bool includeFolder = true)
|
||||
{
|
||||
//,[SellExceptionRegularExpression]
|
||||
var returnData = new List<SavedResultData>();
|
||||
var sqlQuery = @"SELECT [Id]
|
||||
,[ParentId]
|
||||
@@ -915,7 +916,7 @@ namespace Million.DbManagement
|
||||
|
||||
int.TryParse(rdr["ResultDataCount"]?.ToString(), out var resultDataCount);
|
||||
data.ResultDataCount = resultDataCount;
|
||||
|
||||
|
||||
double.TryParse(rdr["WinRate"]?.ToString(), out var winRate);
|
||||
data.WinRate = winRate;
|
||||
double.TryParse(rdr["ProfitRate"]?.ToString(), out var profitRate);
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace Million.DbManagement
|
||||
SellSetupList varbinary(MAX) NULL,
|
||||
BuyRegularExpression varchar(100) NOT NULL,
|
||||
SellRegularExpression varchar(100) NOT NULL,
|
||||
SellExceptionRegularExpression varchar(100) NULL,
|
||||
SearchResultList varbinary(MAX) NULL,
|
||||
ResultDataCount int NOT NULL,
|
||||
WinRate float NOT NULL,
|
||||
@@ -537,7 +538,7 @@ namespace Million.DbManagement
|
||||
/// <returns></returns>
|
||||
public static string InsertRealTimeIndicatorQuery(SavedResultData item, string name)
|
||||
{
|
||||
|
||||
|
||||
var str = string.Format(@"INSERT INTO [ResultData].[dbo].[RealTimeIndicator]
|
||||
(
|
||||
[Name]
|
||||
@@ -572,7 +573,7 @@ namespace Million.DbManagement
|
||||
/// <returns></returns>
|
||||
public static string InsertSavedResultDataQuery(SavedResultData item)
|
||||
{
|
||||
|
||||
//,[SellExceptionRegularExpression]
|
||||
var str = string.Format(@"INSERT INTO [ResultData].[dbo].[SavedResultData]
|
||||
(
|
||||
[ParentId]
|
||||
@@ -594,6 +595,7 @@ namespace Million.DbManagement
|
||||
,[Type]
|
||||
,[SaveResultType]
|
||||
,[Description]
|
||||
,[SellExceptionRegularExpression]
|
||||
)VALUES(
|
||||
'{0}',
|
||||
'{1}',
|
||||
@@ -613,7 +615,8 @@ namespace Million.DbManagement
|
||||
'{12}',
|
||||
'{13}',
|
||||
'{14}',
|
||||
'{15}'
|
||||
'{15}',
|
||||
'{16}
|
||||
);",
|
||||
item.ParentId,
|
||||
item.Name,
|
||||
@@ -630,8 +633,11 @@ namespace Million.DbManagement
|
||||
item.ExchangePlace,
|
||||
item.Type,
|
||||
item.SaveResultType,
|
||||
item.Description
|
||||
item.Description,
|
||||
item.SellExceptionRegularExpression
|
||||
);
|
||||
|
||||
//,
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ namespace Million.WebMangement.Upbit
|
||||
if (nvc != null) url += "?" + ToQueryString(nvc, true);
|
||||
|
||||
var requestMessage = new HttpRequestMessage(httpMethod, new Uri(url));
|
||||
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", CreateJwt(nvc));
|
||||
if(nvc != null)
|
||||
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", CreateJwt(nvc));
|
||||
var response = httpClient.SendAsync(requestMessage).Result;
|
||||
|
||||
if (response.Headers.Contains("Date"))
|
||||
|
||||
Reference in New Issue
Block a user