재수정
This commit is contained in:
@@ -115,11 +115,11 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
public Dictionary<string, Dictionary<int, bool>> SellShortStep = new Dictionary<string, Dictionary<int, bool>>();
|
||||
public Dictionary<string, Dictionary<int, bool>> SellLongStep = new Dictionary<string, Dictionary<int, bool>>();
|
||||
|
||||
public Dictionary<string, int> BuyShortStep = new Dictionary<string, int>();
|
||||
public Dictionary<string, int> BuyLongStep = new Dictionary<string, int>();
|
||||
//public Dictionary<string, int> BuyShortStep = new Dictionary<string, int>();
|
||||
//public Dictionary<string, int> BuyLongStep = new Dictionary<string, int>();
|
||||
|
||||
public Dictionary<string, double> BuyShortStepStampData = new Dictionary<string, double>();
|
||||
public Dictionary<string, double> BuyLongStepStampData = new Dictionary<string, double>();
|
||||
//public Dictionary<string, double> BuyShortStepStampData = new Dictionary<string, double>();
|
||||
//public Dictionary<string, double> BuyLongStepStampData = new Dictionary<string, double>();
|
||||
|
||||
public Dictionary<string, bool> FirstFlag = new Dictionary<string, bool>();
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
//var sellData = FutureOrder("XRPUSDT", FutureMarginMode.isolated, 10, 0, FutureSide.SellShort, OrderType.market, 10, orderDic["orderId"]);
|
||||
var totalImperseMACDData = new Dictionary<string, Dictionary<DateTime, ImpulseMacdData>>();
|
||||
|
||||
var 전저고점Flag = true;
|
||||
|
||||
// 추후 공통화 및 소스정리 필요
|
||||
while (true)
|
||||
{
|
||||
@@ -230,7 +230,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
// Description
|
||||
var strInterval = Utils.Convertor.GetEnumDescription((Enum)interval);
|
||||
if (!intervalList.Contains(strInterval)) continue;
|
||||
|
||||
/*
|
||||
if (nowTime.Minute == 0 && nowTime.Hour == 24 && 전저고점Flag)
|
||||
{
|
||||
전저고점.Clear();
|
||||
@@ -311,8 +311,8 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
}
|
||||
if (!(전저고점.ContainsKey(market + "30m")))
|
||||
continue;
|
||||
|
||||
#region 5분봉 처리
|
||||
*/
|
||||
#region 30분봉 처리
|
||||
|
||||
var candleDatas_30 = findedMarket.candleDataList[MCandleTimeType.M30];
|
||||
var candleDatas_30_정렬 = candleDatas_30.OrderBy(i => i.Argument).ToList();
|
||||
@@ -353,7 +353,9 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
ichimokuConditionSetup.calIchimokuData(candleDatas_30_정렬, candleData_30_전전전전봉);
|
||||
movingAverageConditionSetup.Cal_YHK_Downpublic(candleDatas_30_정렬, candleData_30_전전전전봉);
|
||||
#endregion
|
||||
var 저고점 = 전저고점[market + strInterval];
|
||||
//var 저고점 = 전저고점[market + strInterval];
|
||||
|
||||
|
||||
if (영호조건식_상향돌파 || 영호조건식_하향돌파)
|
||||
{
|
||||
if (영호조건식_상향돌파)
|
||||
@@ -373,21 +375,22 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
//사는 시점
|
||||
if (!UpBuyList.ContainsKey(market))
|
||||
{
|
||||
if(!FirstFlag[market + strInterval + "Long"])
|
||||
{
|
||||
if(sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true))
|
||||
{
|
||||
FirstFlag[market + strInterval + "Long"] = true;
|
||||
}
|
||||
}
|
||||
//if(!FirstFlag[market + strInterval + "Long"])
|
||||
//{
|
||||
// if(sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true))
|
||||
// {
|
||||
// FirstFlag[market + strInterval + "Long"] = true;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongBuy, true) &&
|
||||
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true) &&
|
||||
FirstFlag[market + strInterval + "Long"]
|
||||
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true)
|
||||
//&& FirstFlag[market + strInterval + "Long"]
|
||||
|
||||
//&& 저고점["전저가"] > 저고점["전전저가"]
|
||||
)
|
||||
{
|
||||
BuyLongStep[market] = 0;
|
||||
//BuyLongStep[market] = 0;
|
||||
// 없으면 생성
|
||||
if (signalData == null)
|
||||
{
|
||||
@@ -409,7 +412,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{ "MarketName", market },
|
||||
{ "BuyDate", nowTime },
|
||||
{ "Price", price },
|
||||
{ "Flag", 저고점["전저가"] > 저고점["전전저가"] },
|
||||
//{ "Flag", 저고점["전저가"] > 저고점["전전저가"] },
|
||||
{ "MCandleTimeType", (int)interval },
|
||||
{ "CandleTime", candleData_30.Argument },
|
||||
{ "Candle", candleData_30 }
|
||||
@@ -474,22 +477,22 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
|
||||
var sellFlag = false;
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
if (저고점["전저가"] > 저고점["전전저가"])
|
||||
buyItem["Flag"] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (저고점["전저가"] < 저고점["전전저가"] || 저고점["전저가"] > candleData_30_전봉.Close)
|
||||
sellFlag = true;
|
||||
}
|
||||
//if (!flag)
|
||||
//{
|
||||
// if (저고점["전저가"] > 저고점["전전저가"])
|
||||
// buyItem["Flag"] = true;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (저고점["전저가"] < 저고점["전전저가"] || 저고점["전저가"] > candleData_30_전봉.Close)
|
||||
// sellFlag = true;
|
||||
//}
|
||||
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true) || sellFlag)
|
||||
{
|
||||
double.TryParse(buyItem["Price"].ToString(), out var buyPrice);
|
||||
var resultRate = ((price - buyPrice) / buyPrice) * 100;
|
||||
BuyLongStep[market] = 0;
|
||||
//BuyLongStep[market] = 0;
|
||||
var result = new Dictionary<string, object>()
|
||||
{
|
||||
{ "MarketName", market },
|
||||
@@ -573,14 +576,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{
|
||||
//사는 시점
|
||||
if (!DownBuyList.ContainsKey(market))
|
||||
{
|
||||
if (!FirstFlag[market + strInterval + "Short"])
|
||||
{
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, true))
|
||||
{
|
||||
FirstFlag[market + strInterval + "Short"] = true;
|
||||
}
|
||||
}
|
||||
{
|
||||
|
||||
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortBuy, true) &&
|
||||
@@ -589,7 +585,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
//&& 저고점["전고가"] < 저고점["전전고가"])
|
||||
)
|
||||
{
|
||||
BuyShortStep[market] = 0;
|
||||
//BuyShortStep[market] = 0;
|
||||
// 없으면 생성
|
||||
if (signalData == null)
|
||||
{
|
||||
@@ -610,7 +606,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{ "MarketName", market },
|
||||
{ "BuyDate", nowTime },
|
||||
{ "Price", price },
|
||||
{ "Flag", 저고점["전고가"] < 저고점["전전고가"] },
|
||||
//{ "Flag", 저고점["전고가"] < 저고점["전전고가"] },
|
||||
{ "MCandleTimeType", (int)interval },
|
||||
{ "CandleTime", candleData_30.Argument },
|
||||
{ "Candle", candleData_30 }
|
||||
@@ -678,20 +674,20 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
|
||||
var sellFlag = false;
|
||||
|
||||
if (!flag)
|
||||
{
|
||||
if (저고점["전고가"] < 저고점["전전고가"])
|
||||
buyItem["Flag"] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (저고점["전고가"] > 저고점["전전고가"] || 저고점["전고가"] < candleData_30_전봉.Close)
|
||||
sellFlag = true;
|
||||
}
|
||||
//if (!flag)
|
||||
//{
|
||||
// if (저고점["전고가"] < 저고점["전전고가"])
|
||||
// buyItem["Flag"] = true;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (저고점["전고가"] > 저고점["전전고가"] || 저고점["전고가"] < candleData_30_전봉.Close)
|
||||
// sellFlag = true;
|
||||
//}
|
||||
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, true) || sellFlag)
|
||||
{
|
||||
BuyShortStep[market] = 0;
|
||||
//BuyShortStep[market] = 0;
|
||||
double.TryParse(buyItem["Price"].ToString(), out var buyPrice);
|
||||
var resultRate = ((price - buyPrice) / buyPrice) * 100;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user