Short 관련 수정
This commit is contained in:
@@ -383,8 +383,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
// }
|
||||
//}
|
||||
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongBuy, true) &&
|
||||
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongSell, true)
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.LongBuy, true)
|
||||
//&& FirstFlag[market + strInterval + "Long"]
|
||||
|
||||
//&& 저고점["전저가"] > 저고점["전전저가"]
|
||||
@@ -432,7 +431,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
if (LongCount < 5)
|
||||
{
|
||||
double size = YHKIM_OrderAmount / price * YHKIM_Leverage;
|
||||
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.BuyLong, OrderType.limit, YHKIM_Leverage);
|
||||
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, 0, FutureSide.BuyLong, OrderType.market, YHKIM_Leverage);
|
||||
if (orderData != null)
|
||||
{
|
||||
var orderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(orderData["data"]));
|
||||
@@ -459,7 +458,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{
|
||||
|
||||
var buyItem = UpBuyList[market];
|
||||
var flag = (bool)buyItem["Flag"];
|
||||
|
||||
if (interval < MCandleTimeType.H1)
|
||||
{
|
||||
var buyTime = ((DateTime)buyItem["BuyDate"]).AddMinutes(30);
|
||||
@@ -579,11 +578,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{
|
||||
|
||||
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortBuy, true) &&
|
||||
!sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortSell, true) &&
|
||||
FirstFlag[market + strInterval + "Short"]
|
||||
//&& 저고점["전고가"] < 저고점["전전고가"])
|
||||
)
|
||||
if (sMABandConditionSetup.Calculate(candleDatas_30_TempList, SMABandType.ShortBuy, true))
|
||||
{
|
||||
//BuyShortStep[market] = 0;
|
||||
// 없으면 생성
|
||||
@@ -605,8 +600,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
{
|
||||
{ "MarketName", market },
|
||||
{ "BuyDate", nowTime },
|
||||
{ "Price", price },
|
||||
//{ "Flag", 저고점["전고가"] < 저고점["전전고가"] },
|
||||
{ "Price", price },
|
||||
{ "MCandleTimeType", (int)interval },
|
||||
{ "CandleTime", candleData_30.Argument },
|
||||
{ "Candle", candleData_30 }
|
||||
@@ -626,7 +620,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
if (ShortCount < 5)
|
||||
{
|
||||
double size = YHKIM_OrderAmount / price * YHKIM_Leverage;
|
||||
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyShort, OrderType.limit, YHKIM_Leverage);
|
||||
var orderData = FutureOrder(market, FutureMarginMode.isolated, size, price, FutureSide.BuyShort, OrderType.market, YHKIM_Leverage);
|
||||
if (orderData != null)
|
||||
{
|
||||
var orderDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(orderData["data"]));
|
||||
@@ -653,7 +647,7 @@ namespace BitgetAPI.IndicatorConditionSetup
|
||||
else
|
||||
{
|
||||
var buyItem = DownBuyList[market];
|
||||
var flag = (bool)buyItem["Flag"];
|
||||
|
||||
if (interval < MCandleTimeType.H1)
|
||||
{
|
||||
var buyTime = ((DateTime)buyItem["BuyDate"]).AddMinutes(30);
|
||||
|
||||
@@ -111,6 +111,9 @@ namespace BitgetApi.IndicatorConditionSetup
|
||||
var cloudTopNow = Math.Max(ichmok.SenkouSpanA, ichmok.SenkouSpanB);
|
||||
var cloudBottomNow = Math.Min(ichmok.SenkouSpanA, ichmok.SenkouSpanB);
|
||||
|
||||
var cloudTopAfter = Math.Max(ichmokCurrent.SenkouSpanA, ichmokCurrent.SenkouSpanB);
|
||||
var cloudBottomAfter = Math.Min(ichmokCurrent.SenkouSpanA, ichmokCurrent.SenkouSpanB);
|
||||
|
||||
bool isSma4BelowCloud = low[i] < cloudBottomNow;
|
||||
bool isSma4AboveCloud = high[i] > cloudTopNow;
|
||||
|
||||
@@ -133,7 +136,7 @@ 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 rawLongSell = (sma4Middle < sma72 && prevSma4Middle > prevSma72) || (sma4 == sma4Low);
|
||||
|
||||
bool rawNewShort = sma72 > sma4 && sma4High > cloudTopNow && sma4 == sma4Low && IsSideways(high, low, i, true, rangeThresholdShortPercent) && redCandle && sma4 < cloudTopNow;
|
||||
bool rawNewShort = (sma72 < cloudTopAfter && sma72 < cloudTopNow) && sma72 > sma4 && sma4High > cloudTopNow && sma4 == sma4Low && IsSideways(high, low, i, true, rangeThresholdShortPercent) && redCandle && sma4 < cloudTopNow;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user