예스스탁
예스스탁 답변
2024-07-25 14:38:48
안녕하세요
예스스탁입니다.
수식에 변수를 추가할 때
기존에 동일이름의 변수가 사용중인지 확인하시기 바랍니다.
올리신 식에서 var1이 중복으로 사용이 됩니다.
파라볼릭은 cSarv로 통일해 사용하게 수정해 드립니다.
Input : af(0.02), maxAF(0.2);
var :cSarv(0), T(0),B(0),S(0),tx(0),HH(0),LL(0),box(0),TL(0);
var : Z(0),dd(0),tt(0);
cSarv = csar(af,maxAF);
plot1(cSarv, "CSAR",IFF(c>cSarv,Red,Blue));
If crossup(c,cSarv) Then
{
var1 = cSarv;
Var2 = var1[1];
if var1 <= var2+PriceScale*2 and var1 >= var2-PriceScale*2 and var2 > 0 and C <= highest(H,100)-0.8 Then
{
Tx = Text_New(sDate,sTime,var1-0.05,"●");
Text_SetColor(Tx,Magenta);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
If CrossDown(c,cSarv) Then
{
var3 = csarv;
Var4 = var3[1];
if var3 <= var4+PriceScale*1 and var3 >= var4-PriceScale*1 and var4 > 0 and C >= lowest(L,100)+0.8 Then
{
Tx = Text_New(sDate,sTime,var3+0.05,"●");
Text_SetColor(Tx,Blue);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
if CrossUp(C,cSarv) Then
{
T = 1;
B = cSarv;
HH = H;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,B,NextBarSdate,NextBarStime,HH);
}
if CrossDown(C,cSarv) Then
{
T = -1;
S = cSarv;
LL = L;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,S,NextBarSdate,NextBarStime,LL);
}
if T == 1 Then
{
if cSarv < B Then
{
B = cSarv;
box_SetBegin(box,dd,tt,S);
}
if H > HH Then
HH = H;
Box_SetEnd(box,NextBarSdate,NextBarStime,hh);
if HH < B+0.6 Then
{
Box_SetColor(box,Orange);
Box_SetFill(box,true,120);
}
Else if HH >= B+0.6 and HH < B+0.8 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,80);
}
Else if HH >= B+0.8 and HH < B+1.3 Then
{
Box_SetColor(box,Magenta);
Box_SetFill(box,true,60);
}
Else if HH >= B+1.3 and HH < B+1.9 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,60);
}
Else
{
Box_SetColor(box,Pink);
Box_SetFill(box,true,90);
}
}
if T == -1 Then
{
if cSarv > S Then
{
S = cSarv;
box_SetBegin(box,dd,tt,S);
}
if L < LL Then
LL = L;
Box_SetEnd(box,NextBarSdate,NextBarStime,LL);
if LL > S-0.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.6 and ll > S-0.8 Then
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.8 and ll > S-1.3 Then
{
Box_SetColor(box,Lime);
Box_SetFill(box,true,120);
}
Else if LL <= S-1.3 and ll > S-1.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,90);
}
Else if LL <= S-1.6 and ll > S-1.9 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,30);
}
Else
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,120);
}
}
즐거운 하루되세요
> 고성 님이 쓴 글입니다.
> 제목 : 파라볼릭 쌍바닥 조건
> Input : af(0.02), maxAF(0.2);
var :cSarv(0), T(0),B(0),S(0),tx(0),HH(0),LL(0),box(0),TL(0);
var : Z(0),dd(0),tt(0);
var1 = CSar(af,maxAF);
plot1(var1, "CSAR",IFF(c>var1,Red,Blue));
cSarv = csar(af,maxAF);
If crossup(c,cSarv) Then
{
var1 = cSarv;
Var2 = var1[1];
if var1 <= var2+PriceScale*2 and var1 >= var2-PriceScale*2 and var2 > 0 Then
{
Tx = Text_New(sDate,sTime,var1-0.05,"●");
Text_SetColor(Tx,Magenta);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
If CrossDown(c,cSarv) Then
{
var3 = csarv;
Var4 = var3[1];
if var3 <= var4+PriceScale*1 and var3 >= var4-PriceScale*1 and var4 > 0 Then
{
Tx = Text_New(sDate,sTime,var3+0.05,"●");
Text_SetColor(Tx,Blue);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
var5 = CSar(af,maxAF);
if CrossUp(C,var5) Then
{
T = 1;
B = var5;
HH = H;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,B,NextBarSdate,NextBarStime,HH);
}
if CrossDown(C,var5) Then
{
T = -1;
S = var5;
LL = L;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,S,NextBarSdate,NextBarStime,LL);
}
if T == 1 Then
{
if var5 < B Then
{
B = var5;
box_SetBegin(box,dd,tt,S);
}
if H > HH Then
HH = H;
Box_SetEnd(box,NextBarSdate,NextBarStime,hh);
if HH < B+0.6 Then
{
Box_SetColor(box,Orange);
Box_SetFill(box,true,120);
}
Else if HH >= B+0.6 and HH < B+0.8 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,80);
}
Else if HH >= B+0.8 and HH < B+1.3 Then
{
Box_SetColor(box,Magenta);
Box_SetFill(box,true,60);
}
Else if HH >= B+1.3 and HH < B+1.9 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,60);
}
Else
{
Box_SetColor(box,Pink);
Box_SetFill(box,true,90);
}
}
if T == -1 Then
{
if var5 > S Then
{
S = var5;
box_SetBegin(box,dd,tt,S);
}
if L < LL Then
LL = L;
Box_SetEnd(box,NextBarSdate,NextBarStime,LL);
if LL > S-0.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.6 and ll > S-0.8 Then
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.8 and ll > S-1.3 Then
{
Box_SetColor(box,Lime);
Box_SetFill(box,true,120);
}
Else if LL <= S-1.3 and ll > S-1.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,90);
}
Else if LL <= S-1.6 and ll > S-1.9 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,30);
}
Else
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,120);
}
}
쌍바닥 쌍봉 수식에 단순하게 박스 수식을 더했더니, 쌍바닥에 오류가 많이 나옵니다.
수정 부탁 드립니다.
추가로 쌍바닥 쌍봉 조건을,
직전 100개 봉의 최고가에서, 0.8 아래에서만 동그라미 표시로 수정. (H100-0.8)
쌍봉은 반대로 직전 100개 봉의 최저가에서, 0.8 위에서만 쌍봉일 때 표시. 감사합니다.