커뮤니티

전환추세 쌍바닥

프로필 이미지
고성
2026-02-20 10:55:34
79
글번호 230641
답변완료

두 양선이 모두 0.2 이상이면 쌍바닥 되는 조건을,

직전 양선은 그대로 0.2 이상이면 되는데  나중 양선은 0.25 이상일 때 쌍바닥으로 수정.

나중 양선은 전환될 때 0.25 이상일 수도 있고, 0.2에 전환된 후 +1틱일 때 0.25 조건 만족일 수 있습니다.

and 저[1,1] <= 고[1,1]-0.25 추가 해보니 오류가 납니다.

쌍봉은 반대.   감사합니다.

Input : 전환(0.2);

Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL(0),TX(0);

Array:고[10,4](0),저[10,4](0);

HH = H;

LL = L;

If Index == 0 Then

{

고[1,1] = HH;

고[1,2] = 0;

고[1,3] = sDate;

고[1,4] = sTime;

저[1,1] = LL;

저[1,2] = 0;

저[1,3] = sDate;

저[1,4] = sTime;

}

If Index > 0 Then

{

hiBar = hiBar + 1;

loBar = loBar + 1;

}

If HH[hiBar] < HH Then hiBar = 0;

If LL[loBar] > LL Then loBar = 0;

Condition1 = 저[1,1]+전환 <= HH and hiBar == 0;

Condition2 = 고[1,1]-전환 >= LL and loBar == 0;

처리구분 = "";

If Condition1 and Condition2 Then

{

If 최종꼭지점 == "저점" Then

{

If 저[1,1] > LL Then 처리구분 = "저점처리";

Else 처리구분 = "고점처리";

}

Else If 최종꼭지점 == "고점" Then

{

If 고[1,1] < HH Then 처리구분 = "고점처리";

Else 처리구분 = "저점처리";

}

}

Else If Condition1 Then 처리구분 = "고점처리";

Else If Condition2 Then 처리구분 = "저점처리";

If 처리구분 == "고점처리" Then

{

If 최종꼭지점 == "저점" Then

{

For j = 10 DownTo 2

{

For jj = 1 To 4

{

고[j,jj] = 고[j-1,jj];

}

}

고[1,1] = HH[hiBar];

고[1,2] = Index - hiBar;

고[1,3] = sDate[hiBar];

고[1,4] = sTime[hiBar];

hiBar = -1;

loBar = -1;

TL = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]);

TL_SetSize(TL,1);

TL_SetColor(TL,Red);

if 저[1,1] <= 저[2,1] + PriceScale* 1 and 저[1,1] >= 저[2,1] - PriceScale* 1

and 저[1,1]<= highest(H,400)-2.5 and 저[1,1]<= lowest(L,200)+0.1 Then

{

tx = Text_New(저[1,3],저[1,4],저[1,1]-0.3,"●");

Text_SetStyle(tx,2,2);

Text_SetColor(tx,Red);

Text_SetSize(tx,12);

}

}

Else If 고[1,1] < HH[hiBar] Then

{

고[1,1] = HH[hiBar];

고[1,2] = Index - hiBar;

고[1,3] = sDate[hiBar];

고[1,4] = sTime[hiBar];

hiBar = -1;

loBar = -1;

TL_SetEnd(TL,고[1,3],고[1,4],고[1,1]);

}

최종꼭지점 = "고점";

}

If 처리구분 == "저점처리" Then

{

If 최종꼭지점 == "고점" Then

{

For j = 10 DownTo 2

{

For jj = 1 To 4

{

저[j,jj] = 저[j-1,jj];

}

}

저[1,1] = LL[loBar];

저[1,2] = Index - loBar;

저[1,3] = sDate[loBar];

저[1,4] = sTime[loBar];

hiBar = -1;

loBar = -1;

TL = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]);

TL_SetSize(TL,1);

TL_SetColor(TL,Blue);

if max(고[1,1],고[2,1]) <= min(고[1,1],고[2,1])+PriceScale*1

and 고[1,1] >= lowest(L,400)+2.5 and 고[1,1] >= highest(H,200)-0.1 Then

{

tx = Text_New(고[1,3],고[1,4],고[1,1]+0.3,"●");

Text_SetStyle(tx,2,2);

Text_SetColor(tx,Blue);

Text_SetSize(tx,12);

}

}

Else If 저[1,1] > LL[loBar] Then

{

저[1,1] = LL[loBar];

저[1,2] = Index - loBar;

저[1,3] = sDate[loBar];

저[1,4] = sTime[loBar];

hiBar = -1;

loBar = -1;

TL_SetEnd(TL,저[1,3],저[1,4],저[1,1]);

}

최종꼭지점 = "저점";

Plot2(저[1,1]);

NoPlot(1);

}



지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2026-02-20 15:51:00

안녕하세요 예스스탁입니다. Input : 전환(0.2); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL(0),TX(0); Array:고[10,4](0),저[10,4](0); HH = H; LL = L; If Index == 0 Then { 고[1,1] = HH; 고[1,2] = 0; 고[1,3] = sDate; 고[1,4] = sTime; 저[1,1] = LL; 저[1,2] = 0; 저[1,3] = sDate; 저[1,4] = sTime; } If Index > 0 Then { hiBar = hiBar + 1; loBar = loBar + 1; } If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = 저[1,1]+전환 <= HH and hiBar == 0; Condition2 = 고[1,1]-전환 >= LL and loBar == 0; 처리구분 = ""; If Condition1 and Condition2 Then { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; If 처리구분 == "고점처리" Then { If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); TL_SetSize(TL,1); TL_SetColor(TL,Red); if 저[1,1] <= 저[2,1] + PriceScale* 1 and 저[1,1] >= 저[2,1] - PriceScale* 1 and 저[1,1]<= highest(H,400)-2.5 and 저[1,1]<= lowest(L,200)+0.1 and 고[2,1] >= 저[1,1]+0.25 Then { tx = Text_New(저[1,3],저[1,4],저[1,1]-0.3,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Red); Text_SetSize(tx,12); } } Else If 고[1,1] < HH[hiBar] Then { 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL,고[1,3],고[1,4],고[1,1]); } 최종꼭지점 = "고점"; } If 처리구분 == "저점처리" Then { If 최종꼭지점 == "고점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); TL_SetSize(TL,1); TL_SetColor(TL,Blue); if max(고[1,1],고[2,1]) <= min(고[1,1],고[2,1])+PriceScale*1 and 고[1,1] >= lowest(L,400)+2.5 and 고[1,1] >= highest(H,200)-0.1 and 저[2,1] <= 고[1,1]-0.25 Then { tx = Text_New(고[1,3],고[1,4],고[1,1]+0.3,"●"); Text_SetStyle(tx,2,2); Text_SetColor(tx,Blue); Text_SetSize(tx,12); } } Else If 저[1,1] > LL[loBar] Then { 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL,저[1,3],저[1,4],저[1,1]); } 최종꼭지점 = "저점"; Plot2(저[1,1]); NoPlot(1); } 즐거운 하루되세요