1. overlap value는 계산된 저가와 고가 사이 데이터로 지정(돌파한 순간의 candle 데이터, 단순 비교 시 참이된 순간의 데이터, 크로스의 경우 크로스 된 시점 순간의 데이터등등)
2. value는 단순 계산된 값(bol, ichmok 3% 등등)
This commit is contained in:
@@ -655,10 +655,12 @@ namespace Million
|
||||
}
|
||||
|
||||
var recentlyData = DataManager.GetRecentlyData(standardData, MCandleTimeType.M1, true);
|
||||
if (recentlyData == null) {
|
||||
mDataList.CandleDataLists_Im.RemoveAt(0);
|
||||
if (recentlyData == null)
|
||||
{
|
||||
if (mDataList.CandleDataLists_Im.Count != 0)
|
||||
mDataList.CandleDataLists_Im.RemoveAt(0);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
//before 데이터 가져오는 함수 -> 사는 케이스만
|
||||
var beforeData = standardData[smallCandleType][standardData[smallCandleType].Count - 2];
|
||||
@@ -667,11 +669,12 @@ namespace Million
|
||||
|
||||
if (!buyList.Any(t => t.ConGoodsData.CoinFullName == item))
|
||||
{
|
||||
if(beforeData.DateTime == new DateTime(2024, 1, 4, 0, 0, 0))
|
||||
if(beforeData.DateTime > new DateTime(2024, 1, 1, 7, 0, 0))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
var flag = buyScript.DicExcuteScript(recentlyData.CalculateFlag);
|
||||
if (flag && FirstTimeBuyFlag[item])
|
||||
{
|
||||
|
||||
@@ -536,6 +536,7 @@ namespace Million.Manager
|
||||
itemValue = rateVal;
|
||||
|
||||
item.IndicatorDic[key].value = itemValue;
|
||||
item.IndicatorDic[key].overlapValue = itemValue;
|
||||
foreach (var child in childrenCandleDataList)
|
||||
{
|
||||
itemValue = GetValue(child, setUp);
|
||||
@@ -546,6 +547,7 @@ namespace Million.Manager
|
||||
if (CommonProperty.RealtimeHunterMode)
|
||||
itemValue = rateVal;
|
||||
|
||||
child.IndicatorDic[key].overlapValue = itemValue;
|
||||
child.IndicatorDic[key].value = itemValue;
|
||||
}
|
||||
}
|
||||
@@ -577,23 +579,27 @@ namespace Million.Manager
|
||||
if (parent.IndicatorDic.ContainsKey(key))
|
||||
{
|
||||
parent.IndicatorDic[key].overlapValue = parent.EndValue;
|
||||
parent.IndicatorDic[key].value = parent.EndValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.IndicatorDic[key] = new IndicatorData();
|
||||
parent.IndicatorDic[key] = parent.IndicatorDic[key];
|
||||
parent.IndicatorDic[key].overlapValue = parent.EndValue;
|
||||
parent.IndicatorDic[key].value = parent.EndValue;
|
||||
}
|
||||
|
||||
if (child.IndicatorDic.ContainsKey(key))
|
||||
{
|
||||
child.IndicatorDic[key].overlapValue = parent.EndValue;
|
||||
child.IndicatorDic[key].value = parent.EndValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
child.IndicatorDic[key] = new IndicatorData();
|
||||
child.IndicatorDic[key] = parent.IndicatorDic[key];
|
||||
child.IndicatorDic[key].overlapValue = parent.EndValue;
|
||||
child.IndicatorDic[key].value = parent.EndValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1138,14 +1144,14 @@ namespace Million.Manager
|
||||
if (child.IndicatorDic.ContainsKey(key))
|
||||
{
|
||||
child.IndicatorDic[key].overlapValue = mainVal;
|
||||
child.IndicatorDic[key].value = mainVal;
|
||||
//child.IndicatorDic[key].value = mainVal;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
child.IndicatorDic[key] = new IndicatorData();
|
||||
child.IndicatorDic[key] = item.IndicatorDic[key];
|
||||
child.IndicatorDic[key].value = mainVal;
|
||||
//child.IndicatorDic[key].value = mainVal;
|
||||
child.IndicatorDic[key].overlapValue = mainVal;
|
||||
}
|
||||
}
|
||||
@@ -1222,12 +1228,12 @@ namespace Million.Manager
|
||||
{
|
||||
parent.IndicatorDic[key] = new IndicatorData();
|
||||
parent.IndicatorDic[key].overlapValue = overlapVal;
|
||||
parent.IndicatorDic[key].value = overlapVal;
|
||||
//parent.IndicatorDic[key].value = overlapVal;
|
||||
}
|
||||
else
|
||||
{
|
||||
parent.IndicatorDic[key].overlapValue = overlapVal;
|
||||
parent.IndicatorDic[key].value = overlapVal;
|
||||
//parent.IndicatorDic[key].value = overlapVal;
|
||||
}
|
||||
foreach (var item in childs)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static Humanizer.In;
|
||||
using static Million.CommonProperty;
|
||||
|
||||
namespace Million.Manager
|
||||
@@ -33,7 +34,7 @@ namespace Million.Manager
|
||||
{
|
||||
var candleTypeList = totalIndicator.Select(t => t.MCandleTimeType).ToList();
|
||||
|
||||
if (candleTypes != null)
|
||||
if (candleTypes != null)
|
||||
{
|
||||
candleTypeList = candleTypes;
|
||||
}
|
||||
@@ -78,7 +79,7 @@ namespace Million.Manager
|
||||
/// <param name="totalIndicatorList"></param>
|
||||
/// <param name="coinFullName"></param>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<MCandleTimeType, List<CandleData>> GetExecuteData(Dictionary<MCandleTimeType, List<CandleDataList>> dataList, List<IndicatorCoditionSetup> totalIndicatorList, string coinFullName)
|
||||
public static Dictionary<MCandleTimeType, List<CandleData>> GetExecuteData(Dictionary<MCandleTimeType, List<CandleDataList>> dataList, List<IndicatorCoditionSetup> totalIndicatorList, string coinFullName)
|
||||
{
|
||||
var dic = new Dictionary<MCandleTimeType, List<CandleData>>();
|
||||
var distinctIndicator = IndicatorSetupManager.Distinct(totalIndicatorList);
|
||||
@@ -105,7 +106,7 @@ namespace Million.Manager
|
||||
/// <param name="totalIndicatorList"></param>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<MCandleTimeType, List<CandleData>> GetExecuteData(Dictionary<MCandleTimeType, List<CandleData>> dataList, List<IndicatorCoditionSetup> totalIndicatorList)
|
||||
{
|
||||
{
|
||||
var distinctIndicator = IndicatorSetupManager.Distinct(totalIndicatorList);
|
||||
|
||||
foreach (var key in dataList.Keys)
|
||||
@@ -140,7 +141,7 @@ namespace Million.Manager
|
||||
{
|
||||
subRegExpression = ((CompareConditionSetup)item).Origin + "," + ((CompareConditionSetup)item).Compare;
|
||||
}
|
||||
else if (item.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스)
|
||||
else if (item.SubIndicatorSetupType == CommonProperty.SubIndicatorSetupType.크로스)
|
||||
{
|
||||
subRegExpression = item.CrossSubRegExpression;
|
||||
}
|
||||
@@ -224,7 +225,7 @@ namespace Million.Manager
|
||||
return result;
|
||||
}
|
||||
|
||||
private static CandleData CreateCandleData( CandleData candle,int timeFlagValue, string timeFlag)
|
||||
private static CandleData CreateCandleData(CandleData candle, int timeFlagValue, string timeFlag)
|
||||
{
|
||||
var firstData = candle;
|
||||
if (timeFlag == "minute")
|
||||
@@ -268,13 +269,13 @@ namespace Million.Manager
|
||||
{
|
||||
DateTime = new DateTime(firstData.DateTime.Year, firstData.DateTime.Month, firstData.DateTime.Day, 0, 0, 0),
|
||||
HighValue = firstData.HighValue,
|
||||
StartValue = firstData.StartValue,
|
||||
StartValue = firstData.StartValue,
|
||||
LowValue = firstData.LowValue,
|
||||
RecentlyDataFlag = true,
|
||||
EndValue = firstData.EndValue,
|
||||
MoneyVolume = firstData.MoneyVolume
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,22 +286,23 @@ namespace Million.Manager
|
||||
/// <param name="currentCandleList"></param>
|
||||
/// <param name="mCandleTimeType"></param>
|
||||
/// <returns></returns>
|
||||
public static List<CandleData> GetConvertCandleDataList(List<CandleData> currentCandleList, MCandleTimeType mCandleTimeType) {
|
||||
public static List<CandleData> GetConvertCandleDataList(List<CandleData> currentCandleList, MCandleTimeType mCandleTimeType)
|
||||
{
|
||||
|
||||
var returnData = new List<CandleData>();
|
||||
|
||||
var timeFlag = "minute";
|
||||
var timeFlagValue = 0;
|
||||
if(mCandleTimeType < MCandleTimeType.H1)
|
||||
if (mCandleTimeType < MCandleTimeType.H1)
|
||||
{
|
||||
timeFlagValue = (int)mCandleTimeType;
|
||||
}
|
||||
else if(mCandleTimeType < MCandleTimeType.D1)
|
||||
else if (mCandleTimeType < MCandleTimeType.D1)
|
||||
{
|
||||
timeFlag = "hour";
|
||||
timeFlagValue = ((int) mCandleTimeType) / 60;
|
||||
timeFlagValue = ((int)mCandleTimeType) / 60;
|
||||
}
|
||||
else if(mCandleTimeType < MCandleTimeType.W1)
|
||||
else if (mCandleTimeType < MCandleTimeType.W1)
|
||||
{
|
||||
timeFlag = "day";
|
||||
timeFlagValue = 1;
|
||||
@@ -313,11 +315,11 @@ namespace Million.Manager
|
||||
foreach (var item in currentCandleList)
|
||||
{
|
||||
var recentlyData = returnData.LastOrDefault();
|
||||
if(recentlyData == null)
|
||||
if (recentlyData == null)
|
||||
{
|
||||
returnData.Add(CreateCandleData(item, timeFlagValue, timeFlag));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var coverTime = recentlyData.DateTime;
|
||||
if (timeFlag == "minute")
|
||||
@@ -334,7 +336,7 @@ namespace Million.Manager
|
||||
}
|
||||
|
||||
if (!(recentlyData.DateTime < item.DateTime && item.DateTime < coverTime))
|
||||
{
|
||||
{
|
||||
returnData.Add(CreateCandleData(item, timeFlagValue, timeFlag));
|
||||
continue;
|
||||
}
|
||||
@@ -372,7 +374,7 @@ namespace Million.Manager
|
||||
timeFlag = "hour";
|
||||
timeFlagValue = ((int)mCandleTimeType) / 60;
|
||||
}
|
||||
else if(mCandleTimeType < MCandleTimeType.W1)
|
||||
else if (mCandleTimeType < MCandleTimeType.W1)
|
||||
{
|
||||
timeFlag = "day";
|
||||
timeFlagValue = 1;
|
||||
@@ -384,7 +386,8 @@ namespace Million.Manager
|
||||
{
|
||||
if (timeFlag == "minute")
|
||||
{
|
||||
if (candleData.DateTime.Minute % timeFlagValue == 0)
|
||||
if (candleData.DateTime.Minute % timeFlagValue == 0
|
||||
|| recentlyData.DateTime.AddMinutes((int)mCandleTimeType) < candleData.DateTime)
|
||||
{
|
||||
if (recentlyData.DateTime != candleData.DateTime)
|
||||
flag = true;
|
||||
@@ -395,15 +398,16 @@ namespace Million.Manager
|
||||
var hour = candleData.DateTime.Hour;
|
||||
if (hour == 0) hour += 24;
|
||||
|
||||
if ((hour - (int)CommonProperty.ExchangeTime.UpbitorBithumb) % timeFlagValue == 0)
|
||||
if ((hour - (int)CommonProperty.ExchangeTime.UpbitorBithumb) % timeFlagValue == 0
|
||||
|| recentlyData.DateTime.AddHours((int)mCandleTimeType / 60) < candleData.DateTime)
|
||||
{
|
||||
if (recentlyData.DateTime.Hour != candleData.DateTime.Hour)
|
||||
if (recentlyData.DateTime != candleData.DateTime)
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
else if(timeFlag == "day")
|
||||
else if (timeFlag == "day")
|
||||
{
|
||||
if (recentlyData.DateTime.Day != candleData.DateTime.Day)
|
||||
if (recentlyData.DateTime != candleData.DateTime)
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
@@ -419,21 +423,38 @@ namespace Million.Manager
|
||||
candle.RecentlyDataFlag = true;
|
||||
candle.EndValue = candleData.EndValue;
|
||||
candle.MoneyVolume = candleData.MoneyVolume;
|
||||
|
||||
|
||||
if (timeFlag == "minute")
|
||||
{
|
||||
var date = recentlyData.DateTime.AddMinutes((int)mCandleTimeType);
|
||||
|
||||
if (recentlyData.DateTime.AddMinutes((int)mCandleTimeType) < candleData.DateTime)
|
||||
{
|
||||
var temp = candleData.DateTime.Minute % timeFlagValue;
|
||||
date = candleData.DateTime.AddMinutes(-1 * temp);
|
||||
}
|
||||
|
||||
date = date.AddSeconds(-1 * date.Second);
|
||||
candle.DateTime = date;
|
||||
}
|
||||
else if (timeFlag == "hour")
|
||||
{
|
||||
var date = recentlyData.DateTime.AddHours((int)mCandleTimeType / 60);
|
||||
|
||||
if(recentlyData.DateTime.AddHours((int)mCandleTimeType / 60) < candleData.DateTime)
|
||||
{
|
||||
var hour = candleData.DateTime.Hour;
|
||||
if (hour == 0) hour += 24;
|
||||
|
||||
var temp = (hour - (int)CommonProperty.ExchangeTime.UpbitorBithumb) % timeFlagValue;
|
||||
date = candleData.DateTime.AddHours(-1 * temp);
|
||||
}
|
||||
|
||||
date = date.AddMinutes(-1 * date.Minute);
|
||||
date = date.AddSeconds(-1 * date.Second);
|
||||
candle.DateTime = date;
|
||||
}
|
||||
else if (timeFlag == "day")
|
||||
else if (timeFlag == "day")
|
||||
{
|
||||
var date = recentlyData.DateTime.AddDays(1);
|
||||
date = date.AddHours(-1 * date.Hour);
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Million.Manager
|
||||
}
|
||||
else
|
||||
{
|
||||
valDic.Add(key.Key, item.IndicatorDic[keyData].value);
|
||||
valDic.Add(key.Key, item.IndicatorDic[keyData].overlapValue);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user