커뮤니티

3연속봉 박스

프로필 이미지
고성
2025-12-02 07:32:39
85
글번호 228551
답변완료

1. 지표  

연속봉이 3개보다 많아질 때  박스의 끝이, 음봉은 끝까지 연장되는데 양봉은 3개에서 멈춤. 양봉도 끝까지 연장.  

 2.시스템 

음봉 박스가 생성되면 (3음봉) 매수, 다음봉에  매수청산. 

양봉 박스 생성되면 매도, 다음봉에 매도청산.       감사합니다. 


Inputs:

N(3), // 연속 봉 개수 기준

BullishColor(Red), // 양봉 선 색상

BearishColor(Blue); // 음봉 선 색상

Vars:

bullishCount(0),bearishCount(0),

FirstDate(0),FirstTime(0),LineTop(0),bullishBox(0),

LastDate(0),LastTime(0),lineBottom(0),BearishBox(0);

If Close > Open Then

Begin

bullishCount = bullishCount + 1;

If bullishCount == 1 Then

Begin

firstDate = sDate;

firstTime = sTime;

lineBottom = L;

End;

lastDate = sDate;

lastTime = sTime;

lineTop= high;

// 상단 선: 첫봉 시간 ~ 현재 시간, 가격 = 마지막 봉 고가

if bullishCount >= N Then

Begin

if bullishCount == N Then

Begin

bullishBox = Box_New(firstDate, firstTime, lineTop, lastDate, lastTime, lineBottom);

box_SetColor(bullishBox, BullishColor);

Box_SetFill(bullishBox,true);

end;

Box_SetEnd(bullishBox,lastDate, lastTime, lineBottom);

end;

End

Else

Begin

bullishCount = 0;

#Box_Delete(bullishBox);

End;

If Close < Open Then

Begin

BearishCount = BearishCount + 1;

If BearishCount == 1 Then

Begin

firstDate = sDate;

firstTime = sTime;

lineTop = H;

End;

lastDate = sDate;

lastTime = sTime;

lineBottom = Low;

// 상단 선: 첫봉 시간 ~ 현재 시간, 가격 = 마지막 봉 고가

if BearishCount >= N Then

Begin

if BearishCount == N Then

Begin

BearishBox = Box_New(firstDate, firstTime, lineTop, lastDate, lastTime, lineBottom);

box_SetColor(BearishBox, BearishColor);

Box_SetFill(BearishBox,true);

end;

Box_SetEnd(BearishBox,lastDate, lastTime, lineBottom);

end;

End

Else

Begin

BearishCount = 0;

#Box_Delete(BearishBox);

End;


지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-12-02 13:26:57

안녕하세요 예스스탁입니다. Inputs: N(3), // 연속 봉 개수 기준 BullishColor(Red), // 양봉 선 색상 BearishColor(Blue); // 음봉 선 색상 Vars: bullishCount(0),bearishCount(0), FirstDate(0),FirstTime(0),LineTop(0),bullishBox(0), LastDate(0),LastTime(0),lineBottom(0),BearishBox(0); If Close > Open Then Begin bullishCount = bullishCount + 1; If bullishCount == 1 Then Begin firstDate = sDate; firstTime = sTime; lineBottom = L; End; lastDate = sDate; lastTime = sTime; lineTop = high; // 상단 선: 첫봉 시간 ~ 현재 시간, 가격 = 마지막 봉 고가 if bullishCount >= N Then Begin if bullishCount == N Then Begin bullishBox = Box_New(firstDate, firstTime, lineBottom, lastDate, lastTime, lineTop); box_SetColor(bullishBox, BullishColor); Box_SetFill(bullishBox,true); Sell("S"); end; Box_SetEnd(bullishBox,lastDate, lastTime, lineTop); end; End Else Begin bullishCount = 0; #Box_Delete(bullishBox); End; If Close < Open Then Begin BearishCount = BearishCount + 1; If BearishCount == 1 Then Begin firstDate = sDate; firstTime = sTime; lineTop = H; End; lastDate = sDate; lastTime = sTime; lineBottom = Low; // 상단 선: 첫봉 시간 ~ 현재 시간, 가격 = 마지막 봉 고가 if BearishCount >= N Then Begin if BearishCount == N Then Begin BearishBox = Box_New(firstDate, firstTime, lineTop, lastDate, lastTime, lineBottom); box_SetColor(BearishBox, BearishColor); Box_SetFill(BearishBox,true); Buy("B"); end; Box_SetEnd(BearishBox,lastDate, lastTime, lineBottom); end; End Else Begin BearishCount = 0; #Box_Delete(BearishBox); End; if MarketPosition == 1 and BarsSinceEntry == 1 Then ExitLong("bx"); if MarketPosition == -1 and BarsSinceEntry == 1 Then ExitShort("sx"); 즐거운 하루되세요