실식가 rate 처리 반영
Short 개선 반영
This commit is contained in:
@@ -375,14 +375,14 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
{
|
{
|
||||||
if(!FirstFlag[market + strInterval + "Long"])
|
if(!FirstFlag[market + strInterval + "Long"])
|
||||||
{
|
{
|
||||||
if(sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, market, true))
|
if(sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true))
|
||||||
{
|
{
|
||||||
FirstFlag[market + strInterval + "Long"] = true;
|
FirstFlag[market + strInterval + "Long"] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongBuy, market, true) &&
|
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongBuy, true) &&
|
||||||
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, market, true) &&
|
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true) &&
|
||||||
FirstFlag[market + strInterval + "Long"]
|
FirstFlag[market + strInterval + "Long"]
|
||||||
//&& 저고점["전저가"] > 저고점["전전저가"]
|
//&& 저고점["전저가"] > 저고점["전전저가"]
|
||||||
)
|
)
|
||||||
@@ -485,7 +485,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
sellFlag = true;
|
sellFlag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, market, true) || sellFlag)
|
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true) || sellFlag)
|
||||||
{
|
{
|
||||||
double.TryParse(buyItem["Price"].ToString(), out var buyPrice);
|
double.TryParse(buyItem["Price"].ToString(), out var buyPrice);
|
||||||
var resultRate = ((price - buyPrice) / buyPrice) * 100;
|
var resultRate = ((price - buyPrice) / buyPrice) * 100;
|
||||||
@@ -576,15 +576,15 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
{
|
{
|
||||||
if (!FirstFlag[market + strInterval + "Short"])
|
if (!FirstFlag[market + strInterval + "Short"])
|
||||||
{
|
{
|
||||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, market, true))
|
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, true))
|
||||||
{
|
{
|
||||||
FirstFlag[market + strInterval + "Short"] = true;
|
FirstFlag[market + strInterval + "Short"] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortBuy, market, true) &&
|
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortBuy, true) &&
|
||||||
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, market, true) &&
|
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, true) &&
|
||||||
FirstFlag[market + strInterval + "Short"]
|
FirstFlag[market + strInterval + "Short"]
|
||||||
//&& 저고점["전고가"] < 저고점["전전고가"])
|
//&& 저고점["전고가"] < 저고점["전전고가"])
|
||||||
)
|
)
|
||||||
@@ -689,7 +689,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
|||||||
sellFlag = true;
|
sellFlag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, market, true) || sellFlag)
|
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, true) || sellFlag)
|
||||||
{
|
{
|
||||||
BuyShortStep[market] = 0;
|
BuyShortStep[market] = 0;
|
||||||
double.TryParse(buyItem["Price"].ToString(), out var buyPrice);
|
double.TryParse(buyItem["Price"].ToString(), out var buyPrice);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace BitgetApi.IndicatorConditionSetup
|
|||||||
private bool firstCloudFlag = true;
|
private bool firstCloudFlag = true;
|
||||||
|
|
||||||
|
|
||||||
public bool Calculate(List<CandleData> candles, SMABandType type, string market, bool flag = false)
|
public bool Calculate(List<CandleData> candles, SMABandType type, bool flag = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
var close = candles.Select(t => t.Close).ToList();
|
var close = candles.Select(t => t.Close).ToList();
|
||||||
@@ -133,8 +133,8 @@ namespace BitgetApi.IndicatorConditionSetup
|
|||||||
bool rawNewLong = isLongRecentTouch && greenCandle && IsSideways(high, low, i, true, rangeThresholdLongPercent) && prevSma4 <= sma4 && sma4High == sma4 && prevSma4High >= prevSma4 && (prev2Sma4Middle - prevSma4Middle) > (prevSma4Middle - sma4Middle) && sma4Middle > sma72 && sma4 > cloudTopNow;
|
bool rawNewLong = isLongRecentTouch && greenCandle && IsSideways(high, low, i, true, rangeThresholdLongPercent) && prevSma4 <= sma4 && sma4High == sma4 && prevSma4High >= prevSma4 && (prev2Sma4Middle - prevSma4Middle) > (prevSma4Middle - sma4Middle) && sma4Middle > sma72 && sma4 > cloudTopNow;
|
||||||
bool rawLongSell = (sma4Middle < sma72 && prevSma4Middle > prevSma72) || (sma4 == sma4Low);
|
bool rawLongSell = (sma4Middle < sma72 && prevSma4Middle > prevSma72) || (sma4 == sma4Low);
|
||||||
|
|
||||||
bool rawNewShort = sma4High < cloudBottomNow && sma4 == sma4Low && IsSideways(high, low, i, false, rangeThresholdShortPercent) && redCandle;
|
bool rawNewShort = sma72 > sma4 && sma4High > cloudTopNow && sma4 == sma4Low && IsSideways(high, low, i, true, rangeThresholdShortPercent) && redCandle && sma4 < cloudTopNow;
|
||||||
bool rawShortSell = sma4 > cloudBottomNow;
|
bool rawShortSell = sma4High < close[i] || sma4 > sma72;
|
||||||
|
|
||||||
//bool rawNewLong = greenCandle && sma4Low < sma72 && IsSideways(high, low, i, true) && sma4 > cloudTopNow && prevSma4 <= prevSma4High && sma4 == sma4High && prevSma4 < sma4 && sma4Middle > sma72 && sma4 > cloudTopNow && ichmok.SenkouSpanA >= ichmok.SenkouSpanB && ichmokCurrent.SenkouSpanA >= ichmokCurrent.SenkouSpanB;
|
//bool rawNewLong = greenCandle && sma4Low < sma72 && IsSideways(high, low, i, true) && sma4 > cloudTopNow && prevSma4 <= prevSma4High && sma4 == sma4High && prevSma4 < sma4 && sma4Middle > sma72 && sma4 > cloudTopNow && ichmok.SenkouSpanA >= ichmok.SenkouSpanB && ichmokCurrent.SenkouSpanA >= ichmokCurrent.SenkouSpanB;
|
||||||
//sma4 == sma4High && prevSma4 < sma4High && sma4Middle > sma72 && sma4 > cloudTopNow && ichmokCurrent.SenkouSpanA > ichmokCurrent.SenkouSpanB && ichmok.SenkouSpanA >= ichmok.SenkouSpanB; // sma4 > cloudBottomNow && IsSideways(high, low, i, true) && isSma4AboveCloud && (sma4 == sma4High && prevSma4 <= prevSma4High && prev2Sma4 <= prev2Sma4High) && (sma4 >= prevSma4 && prevSma4 >= prev2Sma4 && prev2Sma4 >= prev3Sma4);
|
//sma4 == sma4High && prevSma4 < sma4High && sma4Middle > sma72 && sma4 > cloudTopNow && ichmokCurrent.SenkouSpanA > ichmokCurrent.SenkouSpanB && ichmok.SenkouSpanA >= ichmok.SenkouSpanB; // sma4 > cloudBottomNow && IsSideways(high, low, i, true) && isSma4AboveCloud && (sma4 == sma4High && prevSma4 <= prevSma4High && prev2Sma4 <= prev2Sma4High) && (sma4 >= prevSma4 && prevSma4 >= prev2Sma4 && prev2Sma4 >= prev3Sma4);
|
||||||
|
|||||||
@@ -1056,7 +1056,7 @@ namespace BitgetAPI.WebService
|
|||||||
candleDataList.Add(candleData);
|
candleDataList.Add(candleData);
|
||||||
|
|
||||||
// 기존 데이터 삭제
|
// 기존 데이터 삭제
|
||||||
if (candleDataList.Count > 500)
|
if (candleDataList.Count > 1000)
|
||||||
{
|
{
|
||||||
// 가장 오래된 데이터 삭제
|
// 가장 오래된 데이터 삭제
|
||||||
candleDataList.Remove(j => j.Argument == candleDataList.Min(i => i.Argument));
|
candleDataList.Remove(j => j.Argument == candleDataList.Min(i => i.Argument));
|
||||||
|
|||||||
Reference in New Issue
Block a user