예스스탁
예스스탁 답변
2025-06-23 14:31:52
안녕하세요
예스스탁입니다.
1
올리신 강세1,약세1 조건에 t에 의해 번갈아 가면서 나오게 되어 있고
BB > BB[1], BB < BB[1]와 같은 조건이 추가로 있습니다.
돌파할때는 BB도 상승, 이탈할때는 BB가 하락해야 하는데
해당 조건이 맞지 않아 색상이 변경되지 않습니다.
해당 내용은 모두 삭제합니다.
2
강세2, 약세2와 같은 경우
고가가 HDEMA돌파 후 이평이 HDEMA 위에 올라오기 전 첫번째 이평 하락전환,
저가가 LDEMA이탈 후 이평이 LDEMA 아래에 내려오기 전 첫번째 이평 상승전환시에 색상이 변경됩니다.
해당 부분은 어느 부분을 수정해야 할지 모르겠습니다.
위 내용이 아니시면 정확한 조건을 올려주시기 바랍니다.
3
var : Atime(30),Period(200);
var : EP(0),Idx(0),TF(0);
Var : Cjisu(0), Cjisu1(0);
Var : Hjisu(0), Hjisu1(0);
Var : Ljisu(0), Ljisu1(0);
Var : aCjisu(0), aCjisu1(0);
Var : aHjisu(0), aHjisu1(0);
Var : aLjisu(0), aLjisu1(0);
var : CDEMA(0),HDEMA(0),LDEMA(0),HH(0),LL(0);
Ep = 2/(Period+1);
TF = TimeToMinutes(stime)%Atime;
if dayindex() == 0 or (TF < TF[1] and stime > stime[1]) Then{
idx = idx+1;
HH = H;
LL = L;
Cjisu1 = Cjisu[1];
Hjisu1 = Hjisu[1];
Ljisu1 = Ljisu[1];
aCjisu1 = aCjisu[1];
aHjisu1 = aHjisu[1];
aLjisu1 = aLjisu[1];
}
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if idx <= 1 then {
Cjisu = C;
Hjisu = HH;
Ljisu = LL;
}
else{
Cjisu = C * EP + Cjisu1 * (1-EP);
Hjisu = HH * EP + Hjisu1 * (1-EP);
Ljisu = LL * EP + Ljisu1 * (1-EP);
}
if idx <= 2 then {
aCjisu = Cjisu;
aHjisu = Hjisu;
aLjisu = Ljisu;
}
else{
aCjisu = Cjisu * EP + aCjisu1 * (1-EP);
aHjisu = Hjisu * EP + aHjisu1 * (1-EP);
aLjisu = Ljisu * EP + aLjisu1 * (1-EP);
}
CDEMA = Cjisu * 2 - aCjisu;
HDEMA = Hjisu * 2 - aHjisu;
LDEMA = Ljisu * 2 - aLjisu;
plot1(HDEMA,"고가");
plot2(LDEMA,"저가");
var : BB(0),t(0),box(0),s(0),z(0),tt(0);
BB = ma(C,20);
if BB >= BB[1]+0.02 Then
tt = 1;
if BB <= BB[1]-0.02 Then
tt = -1;
plot3(BB, "이평", iff(tt == 1,Magenta,Lime));
if Box_GetColor(box) != Red and (crossup(BB,HDEMA) or crossup(BB,LDEMA)) Then
{
t = 1;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Red);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
if Box_GetColor(box) != Blue and (CrossDown(BB,HDEMA) or CrossDown(BB,LDEMA)) Then
{
t = -1;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Blue);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
if CrossUp(H,HDEMA) Then
S = 1;
if CrossDown(L,LDEMA) Then
S = -1;
if BB > BB[1] Then
Z = 1;
if BB < BB[1] Then
Z = -1;
if S == 1 and BB > HDEMA Then
S = 0;
if S == -1 and BB < LDEMA Then
S = 0;
if S == 1 and Z == -1 and Z != Z[1] Then
{
S = 2;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Cyan);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
if S == -1 and Z == 1 and Z != Z[1] Then
{
S = -2;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Yellow);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
Box_SetEnd(box,NextBarSdate,NextBarStime,l);
즐거운 하루되세요
> 와우리 님이 쓴 글입니다.
> 제목 : 부탁드립니다
> var : Atime(30),Period(200);
var : EP(0),Idx(0),TF(0);
Var : Cjisu(0), Cjisu1(0);
Var : Hjisu(0), Hjisu1(0);
Var : Ljisu(0), Ljisu1(0);
Var : aCjisu(0), aCjisu1(0);
Var : aHjisu(0), aHjisu1(0);
Var : aLjisu(0), aLjisu1(0);
var : CDEMA(0),HDEMA(0),LDEMA(0),HH(0),LL(0);
Ep = 2/(Period+1);
TF = TimeToMinutes(stime)%Atime;
if dayindex() == 0 or (TF < TF[1] and stime > stime[1]) Then{
idx = idx+1;
HH = H;
LL = L;
Cjisu1 = Cjisu[1];
Hjisu1 = Hjisu[1];
Ljisu1 = Ljisu[1];
aCjisu1 = aCjisu[1];
aHjisu1 = aHjisu[1];
aLjisu1 = aLjisu[1];
}
if H > HH Then
HH = H;
if L < LL Then
LL = L;
if idx <= 1 then {
Cjisu = C;
Hjisu = HH;
Ljisu = LL;
}
else{
Cjisu = C * EP + Cjisu1 * (1-EP);
Hjisu = HH * EP + Hjisu1 * (1-EP);
Ljisu = LL * EP + Ljisu1 * (1-EP);
}
if idx <= 2 then {
aCjisu = Cjisu;
aHjisu = Hjisu;
aLjisu = Ljisu;
}
else{
aCjisu = Cjisu * EP + aCjisu1 * (1-EP);
aHjisu = Hjisu * EP + aHjisu1 * (1-EP);
aLjisu = Ljisu * EP + aLjisu1 * (1-EP);
}
CDEMA = Cjisu * 2 - aCjisu;
HDEMA = Hjisu * 2 - aHjisu;
LDEMA = Ljisu * 2 - aLjisu;
plot1(HDEMA,"고가");
plot2(LDEMA,"저가");
var : BB(0),t(0),box(0),s(0),z(0),tt(0);
BB = ma(C,20);
if BB >= BB[1]+0.2 Then
tt = 1;
if BB <= BB[1]-0.2 Then
tt = -1;
plot3(BB, "이평", iff(tt == 1,Magenta,Lime));
if t <= 0 and (crossup(BB,HDEMA) or crossup(BB,LDEMA)) and BB > BB[1] Then
{
t = 1;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Red);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
if t >= 0 and (CrossDown(BB,HDEMA) or CrossDown(BB,LDEMA)) and BB < BB[1] Then
{
t = -1;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Blue);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
if CrossUp(H,HDEMA) Then
S = 1;
if CrossDown(L,LDEMA) Then
S = -1;
if BB > BB[1] Then
Z = 1;
if BB < BB[1] Then
Z = -1;
if S == 1 and BB > HDEMA Then
S = 0;
if S == -1 and BB < LDEMA Then
S = 0;
if S == 1 and Z == -1 and Z != Z[1] Then
{
S = 2;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Cyan);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
if S == -1 and Z == 1 and Z != Z[1] Then
{
S = -2;
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Yellow);
Box_SetFill(box,true);
Box_SetExtFill(box,true);
}
Box_SetEnd(box,NextBarSdate,NextBarStime,l);
만들어 주신 수식을 적용 캔들 1만개를 돌려보니 오류가 제법나는데요
전체적으로 한번 살펴봐 주십시요
기본 개념은 아래와 같습니다
1) 강세1(핑크) : 상승중인 이평이 HDEMA or LDEMA를 돌파 할때 (2가지 경우)
2) 약세1(남색) : 하락중인 이평이 HDEMA or LDEMA를 이탈 할때 (2가지 경우)
3) 강세2(노랑) : 캔들만 HDEMA를 돌파, 이평은 HDEMA 아래서 하락 전환 할때 (1가지 경우)
4) 약세2(하늘색) : 캔들만 LDEMA를 이탈, 이평은 LDEMA 위에서 상승 전환 할때 (1가지 경우)