커뮤니티

wave 다이버전스

프로필 이미지
고성
2026-11-21 11:20:42
20
글번호 234273

첨부 이미지

-60 이하에서 양전환되면 매도에서 추가로,  (다이버전스)

직전저점이 -60 이하이고, 현 저점이 -60이상 -50 이하에서 양전환되면 매도 추가. 다음봉에 매도청산.

60 이상에서 음전환되면 매도에서 추가로,  직전고점이 60 이상이고

현 고점이 60이하 50 이상에서 음전환되면 매도. (양전 음전 모두 매도 신호)

맨아래 추가부분, 매도신호 안나옵니다.   수정 부탁드립니다.     


input : n1(10);

input : n2(21);

input : obLevel2(60);

input : osLevel2(-60);

var : ap(0),esa(0),d(0),ci(0),tci(0),wt(0),S(0);

var : t(0),tx(0),TL(0),box(0);


ap = (h+l+c)/3;

esa = ema(ap, n1);

d = ema(abs(ap - esa), n1);

ci = (ap - esa) / (0.015 * d);

tci = ema(ci, n2);

wt = tci;


if wt > wt[1] Then

t = 1;

Else

t = -1;

if CrossUp(wt,wt[1]) and wt[1] < osLevel2 Then

{

tx = Text_New(sDate,sTime,L-1,"●");

Text_SetColor(tx,Red);

Text_SetStyle(tx,2,2);

Text_SetSize(tx,15);

}

if CrossDown(wt,wt[1]) and wt[1] > obLevel2 Then

{

tx = Text_New(sDate,sTime,H+1,"●");

Text_SetColor(tx,Blue);

Text_SetStyle(tx,2,2);

Text_SetSize(tx,15);

}


if CrossDown(wt,osLevel2) Then

{

box = Box_New(sDate,sTime,H+1,NextBarSdate,NextBarStime,1999);

Box_SetColor(box,Red);

Box_SetFill(box,true,70);

TL = TL_New(sDate,sTime,H+1,sDate,sTime,1999);

TL_SetColor(TL,Red);

TL_SetSize(TL,1);

}

Else

{

if wt < osLevel2 Then

{

if t == -1 and t != t[1] Then

{

box = Box_New(sDate,sTime,H+1,NextBarSdate,NextBarStime,1999);

Box_SetColor(box,Red);

Box_SetFill(box,true,70);

TL = TL_New(sDate,sTime,H+1,sDate,sTime,1999);

TL_SetColor(TL,Red);

TL_SetSize(TL,1);

}

if t == -1 Then

{

Box_SetEnd(box,sDate,Stime,1999);

}

}

}

if CrossUp(wt,obLevel2) Then

{

box = Box_New(sDate,sTime,L-1,NextBarSdate,NextBarStime,-1999);

Box_SetColor(box,Blue);

Box_SetFill(box,true,70);

TL = TL_New(sDate,sTime,L-1,sDate,sTime,-1999);

TL_SetColor(TL,Blue);

TL_SetSize(TL,1);

}

Else

{

if wt > obLevel2 Then

{

if t == 1 and t != t[1] Then

{

box = Box_New(sDate,sTime,L-1,NextBarSdate,NextBarStime,-1999);

Box_SetColor(box,Blue);

Box_SetFill(box,true,70);

TL = TL_New(sDate,sTime,L-1,sDate,sTime,-1999);

TL_SetColor(TL,Blue);

TL_SetSize(TL,1);

}

if t == 1 Then

{

Box_SetEnd(box,sDate,Stime,-1999);

}

}

}


if wt > wt[1] Then

S = 1;

Else

S = -1;

if wt < osLevel2 and S == -1 Then

{

if wt[1] > osLevel2 or S[1] != -1 Then

{

if MarketPosition <= 0 Then

Buy();

}

}

if wt > obLevel2 and S == 1 Then

{

if wt[1] < obLevel2 or S[1] != 1 Then

{

if MarketPosition >= 0 Then

Buy();

}

}


if CrossUp(wt,wt[1]) and wt[1] < osLevel2 Then

{

Sell();

}

if CrossDown(wt,wt[1]) and wt[1] > obLevel2 Then

{

Sell();

}


//추가부분

if CrossUp(wt,wt[1]) and wt[2] < osLevel2 and wt[1] >= -60 and wt[1] < -50 Then

{

Sell();

}

if CrossDown(wt,wt[1]) and wt[2] > obLevel2 and wt[1] <= 60 and wt[1] > 50 Then

{

Sell();

}

//


if MarketPosition == 1 and BarsSinceEntry == 1 Then ExitLong();

if MarketPosition == -1 and BarsSinceEntry == 1 Then ExitShort();






시스템
답변 0