예스스탁
예스스탁 답변
2024-12-24 15:41:32
안녕하세요
예스스탁입니다.
2번은 어떤 내용인지 파악이 어렵습니다.
1번과 같은 내용이시면 수식 하단에 추가된 1번 내용 참고하셔서 직접 추가하시기 바랍니다.
Input : AF(0.02), AFMAX(0.2);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0);
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = low;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = High;
}
}
CSarv = SAR_Value;
}
else
{
if SAR_Value != 0 && EP == 0 then
{
if Direction == 1 then
{
EP = HighValue;
AF_Value = AF;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
else
{
EP = LowValue;
AF_Value = Af;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
CSarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if Close > Close[1] then Direction = 1;
else
if Close < Close[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if Close < Close[1] then
{
Direction = -1;
SAR_Value = HighValue;
CSarv = SAR_Value;
}
}
if Direction == -1 then
{
if Close > Close[1] then
{
Direction = 1;
SAR_Value = LowValue;
CSarv = SAR_Value;
}
}
}
LowValue = min(Low, LowValue);
HighValue = max(High, HighValue);
}
}
var : t(0),hh(0),hl(0),lh(0),ll(0);
var : hh1(0),hl1(0),lh1(0),ll1(0);
var : hh2(0),hl2(0),lh2(0),ll2(0);
if CrossUp(C,CSarv) Then
{
t = 1;
hh = h;
hl = l;
hh1 = hh[1];
hl1 = hl[1];
var1 = hh1*2-ll;
Var2 = hh1;
Var3 = ll;
Var7 = ll*2-hh1;
Var9 = CSarv;
}
if CrossDown(C,CSarv) Then
{
t = -1;
lh = h;
ll = l;
lh1 = lh[1];
ll1 = ll[1];
var4 = ll1*2-hh;
Var5 = ll1;
Var6 = hh;
Var8 = hh*2-ll1;
Var10= CSarv;
}
if t == 1 Then
{
if h > hh Then
hh = h;
if l < hl Then
hl = h;
}
if t == -1 Then
{
if h > lh Then
lh = h;
if l < ll Then
ll = l;
}
Plot1(var1,"상승목표");
/*Plot2(var2,"HH1");
Plot3(var3,"LL");
Plot4(var4,"하락목표"); #녹밴 하락대칭
Plot5(var5,"LL1");
Plot6(var6,"HH");
Plot7(var7,"하락목표1");
Plot8(var8,"상승목표1");
Plot9(var1+PriceScale,"상승목표+");
Plot10(var8+PriceScale,"상승목표1+");
Plot11(var4-PriceScale,"하락목표-");
Plot12(var7-PriceScale,"하락목표1-");*/
var : tx1(0),tx2(0),tx3(0),tx4(0);
var : tx5(0),tx6(0),tx7(0),tx8(0);
var : tx9(0),tx10(0),tx11(0),tx12(0);
if var1 != var1[1] Then
{
tx1 = text_new(sDate,sTime,var1,"상승목표");
Text_SetStyle(tx1,0,0);
Text_SetColor(tx1,Black);
Text_SetSize(tx1,12);
}
Else
Text_SetLocation(tx1,sDate,sTime,var1);
if var2 != var2[1] Then
{
tx2 = text_new(sDate,NextBarStime,var2,"HH1");
Text_SetStyle(tx2,0,0);
Text_SetColor(tx2,Black);
Text_SetSize(tx2,12);
}
Else
Text_SetLocation(tx2,sDate,sTime,var2);
if var3 != var3[1] Then
{
tx3 = text_new(sDate,NextBarStime,var3,"LL");
Text_SetStyle(tx3,0,0);
Text_SetColor(tx3,Black);
Text_SetSize(tx3,12);
}
Else
Text_SetLocation(tx3,sDate,sTime,var3);
if var4 != var4[1] Then
{
tx4 = text_new(sDate,NextBarStime,var4,"하락목표");
Text_SetStyle(tx4,0,0);
Text_SetColor(tx4,Black);
Text_SetSize(tx4,12);
}
Else
Text_SetLocation(tx4,sDate,sTime,var4);
if var5 != var5[1] Then
{
tx5 = text_new(sDate,NextBarStime,var5,"LL1");
Text_SetStyle(tx5,0,0);
Text_SetColor(tx5,Black);
Text_SetSize(tx5,12);
}
Else
Text_SetLocation(tx5,sDate,sTime,var5);
if var6 != var6[1] Then
{
tx6 = text_new(sDate,NextBarStime,var6,"HH");
Text_SetStyle(tx6,0,0);
Text_SetColor(tx6,Black);
Text_SetSize(tx6,12);
}
Else
Text_SetLocation(tx6,sDate,sTime,var6);
if var7 != var7[1] Then
{
tx7 = text_new(sDate,NextBarStime,var7,"하락목표1");
Text_SetStyle(tx7,0,0);
Text_SetColor(tx7,Black);
Text_SetSize(tx7,12);
}
Else
Text_SetLocation(tx7,sDate,sTime,var7);
if var8 != var8[1] Then
{
tx8 = text_new(sDate,NextBarStime,var8,"상승목표1");
Text_SetStyle(tx8,0,0);
Text_SetColor(tx8,Black);
Text_SetSize(tx8,12);
}
Else
Text_SetLocation(tx8,sDate,sTime,var8);
if var1 != var1[1] Then
{
tx9 = text_new(sDate,NextBarStime,var1+PriceScale,"상승목표+");
Text_SetStyle(tx9,0,2);
Text_SetColor(tx9,Black);
Text_SetSize(tx9,12);
}
Else
Text_SetLocation(tx9,sDate,sTime,var1+PriceScale);
if var8 != var8[1] Then
{
tx10 = text_new(sDate,NextBarStime,var8+PriceScale,"상승목표1+");
Text_SetStyle(tx10,0,0);
Text_SetColor(tx10,Black);
Text_SetSize(tx10,12);
}
Else
Text_SetLocation(tx10,sDate,sTime,var8+PriceScale);
if var4 != var4[1] Then
{
tx11 = text_new(sDate,NextBarStime,var4-PriceScale,"하락목표-");
Text_SetStyle(tx11,0,1);
Text_SetColor(tx11,Black);
Text_SetSize(tx11,12);
}
Else
Text_SetLocation(tx11,sDate,sTime,var4-PriceScale);
if var7 != var7[1] Then
{
tx12 = text_new(sDate,NextBarStime,var7-PriceScale,"하락목표1-");
Text_SetStyle(tx12,0,4);
Text_SetColor(tx12,Black);
Text_SetSize(tx12,12);
}
Else
Text_SetLocation(tx12,sDate,sTime,var7-PriceScale);
var : d1(0),t1(0),v1(0),d11(0),t11(0),v11(0),tl1(0);
var :txx(0);
if CrossUp(c,var1) Then
{
d1 = sDate;
t1 = sTime;
v1 = c;
d11 = d1[1];
t11 = t1[1];
v11 = v1[1];
if v11 > 0 Then
{
tl1 = TL_New(d11,t11,v11,d1,t1,v1);
TL_SetColor(tl1,Red);
TL_SetSize(tl1,1);
}
txx = Text_New(sDate,sTime,L,"▲");
Text_SetStyle(txx,2,0);
Text_SetColor(txx,Red);
Text_SetSize(txx,12);
}
if CrossDown(c,var1) Then
{
d1 = sDate;
t1 = sTime;
v1 = c;
d11 = d1[1];
t11 = t1[1];
v11 = v1[1];
if v11 > 0 Then
{
tl1 = TL_New(d11,t11,v11,d1,t1,v1);
TL_SetColor(tl1,blue);
TL_SetSize(tl1,1);
}
txx = Text_New(sDate,sTime,H,"▼");
Text_SetStyle(txx,2,1);
Text_SetColor(txx,Blue);
Text_SetSize(txx,12);
}
즐거운 크리스마스 보내세요
> 아이덜 님이 쓴 글입니다.
> 제목 : 도와주세요
> 1.plot1목표에 닿거나 도달했을때마다, 추세선연결 및 꼭지점도형모양
2. plot1 ~6 소추세 , 7~12 대추세
//////////////////////////////////////////////////////////////
Plot1(var1,"상승목표"); ---------
Plot2(var2,"HH1"); ]]
Plot3(var3,"LL"); ]]
Plot4(var4,"하락목표"); #녹밴 하락대칭 ]]
Plot5(var5,"LL1"); ]]
Plot6(var6,"HH"); ---------
Plot7(var7,"하락목표1"); ---------
Plot8(var8,"상승목표1"); ]]
Plot9(var1+PriceScale,"상승목표+"); ]]
Plot10(var8+PriceScale,"상승목표1+"); ]]
Plot11(var4-PriceScale,"하락목표-"); ]]
Plot12(var7-PriceScale,"하락목표1-"); ---------
///////////////////////////////////////////////////////////////////////////////////
Input : AF(0.02), AFMAX(0.2);
Var : Direction(0), SAR_Value(Close), AF_Value(.02), HighValue(High), LowValue(Low), EP(0),CSarv(0);
if EP != 0 Then
{
if Direction == 1 then
{
EP = HighValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close < SAR_Value then
{
Direction = -1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
LowValue = low;
}
}
else
{
EP = LowValue;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + Af;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
if Close > SAR_Value then
{
Direction = 1;
SAR_Value = EP;
AF_Value = 0;
EP = 0;
HighValue = High;
}
}
CSarv = SAR_Value;
}
else
{
if SAR_Value != 0 && EP == 0 then
{
if Direction == 1 then
{
EP = HighValue;
AF_Value = AF;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if High > HighValue then
{
HighValue = High;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
else
{
EP = LowValue;
AF_Value = Af;
SAR_Value = SAR_Value + AF_Value * (EP - SAR_Value);
if Low < LowValue then
{
LowValue = Low;
AF_Value = AF_Value + AF;
if AF_Value >= AFMAX then AF_Value = AFMAX;
}
}
CSarv = SAR_Value;
}
else
{
if Direction == 0 then
{
if Close > Close[1] then Direction = 1;
else
if Close < Close[1] then Direction = -1;
}
else
{
if Direction == 1 then
{
if Close < Close[1] then
{
Direction = -1;
SAR_Value = HighValue;
CSarv = SAR_Value;
}
}
if Direction == -1 then
{
if Close > Close[1] then
{
Direction = 1;
SAR_Value = LowValue;
CSarv = SAR_Value;
}
}
}
LowValue = min(Low, LowValue);
HighValue = max(High, HighValue);
}
}
var : t(0),hh(0),hl(0),lh(0),ll(0);
var : hh1(0),hl1(0),lh1(0),ll1(0);
var : hh2(0),hl2(0),lh2(0),ll2(0);
if CrossUp(C,CSarv) Then
{
t = 1;
hh = h;
hl = l;
hh1 = hh[1];
hl1 = hl[1];
var1 = hh1*2-ll;
Var2 = hh1;
Var3 = ll;
Var7 = ll*2-hh1;
Var9 = CSarv;
}
if CrossDown(C,CSarv) Then
{
t = -1;
lh = h;
ll = l;
lh1 = lh[1];
ll1 = ll[1];
var4 = ll1*2-hh;
Var5 = ll1;
Var6 = hh;
Var8 = hh*2-ll1;
Var10= CSarv;
}
if t == 1 Then
{
if h > hh Then
hh = h;
if l < hl Then
hl = h;
}
if t == -1 Then
{
if h > lh Then
lh = h;
if l < ll Then
ll = l;
}
Plot1(var1,"상승목표");
Plot2(var2,"HH1");
Plot3(var3,"LL");
Plot4(var4,"하락목표"); #녹밴 하락대칭
Plot5(var5,"LL1");
Plot6(var6,"HH");
Plot7(var7,"하락목표1");
Plot8(var8,"상승목표1");
Plot9(var1+PriceScale,"상승목표+");
Plot10(var8+PriceScale,"상승목표1+");
Plot11(var4-PriceScale,"하락목표-");
Plot12(var7-PriceScale,"하락목표1-");
var : tx1(0),tx2(0),tx3(0),tx4(0);
var : tx5(0),tx6(0),tx7(0),tx8(0);
var : tx9(0),tx10(0),tx11(0),tx12(0);
if var1 != var1[1] Then
{
tx1 = text_new(sDate,sTime,var1,"상승목표");
Text_SetStyle(tx1,0,0);
Text_SetColor(tx1,Black);
Text_SetSize(tx1,12);
}
Else
Text_SetLocation(tx1,sDate,sTime,var1);
if var2 != var2[1] Then
{
tx2 = text_new(sDate,NextBarStime,var2,"HH1");
Text_SetStyle(tx2,0,0);
Text_SetColor(tx2,Black);
Text_SetSize(tx2,12);
}
Else
Text_SetLocation(tx2,sDate,sTime,var2);
if var3 != var3[1] Then
{
tx3 = text_new(sDate,NextBarStime,var3,"LL");
Text_SetStyle(tx3,0,0);
Text_SetColor(tx3,Black);
Text_SetSize(tx3,12);
}
Else
Text_SetLocation(tx3,sDate,sTime,var3);
if var4 != var4[1] Then
{
tx4 = text_new(sDate,NextBarStime,var4,"하락목표");
Text_SetStyle(tx4,0,0);
Text_SetColor(tx4,Black);
Text_SetSize(tx4,12);
}
Else
Text_SetLocation(tx4,sDate,sTime,var4);
if var5 != var5[1] Then
{
tx5 = text_new(sDate,NextBarStime,var5,"LL1");
Text_SetStyle(tx5,0,0);
Text_SetColor(tx5,Black);
Text_SetSize(tx5,12);
}
Else
Text_SetLocation(tx5,sDate,sTime,var5);
if var6 != var6[1] Then
{
tx6 = text_new(sDate,NextBarStime,var6,"HH");
Text_SetStyle(tx6,0,0);
Text_SetColor(tx6,Black);
Text_SetSize(tx6,12);
}
Else
Text_SetLocation(tx6,sDate,sTime,var6);
if var7 != var7[1] Then
{
tx7 = text_new(sDate,NextBarStime,var7,"하락목표1");
Text_SetStyle(tx7,0,0);
Text_SetColor(tx7,Black);
Text_SetSize(tx7,12);
}
Else
Text_SetLocation(tx7,sDate,sTime,var7);
if var8 != var8[1] Then
{
tx8 = text_new(sDate,NextBarStime,var8,"상승목표1");
Text_SetStyle(tx8,0,0);
Text_SetColor(tx8,Black);
Text_SetSize(tx8,12);
}
Else
Text_SetLocation(tx8,sDate,sTime,var8);
if var1 != var1[1] Then
{
tx9 = text_new(sDate,NextBarStime,var1+PriceScale,"상승목표+");
Text_SetStyle(tx9,0,2);
Text_SetColor(tx9,Black);
Text_SetSize(tx9,12);
}
Else
Text_SetLocation(tx9,sDate,sTime,var1+PriceScale);
if var8 != var8[1] Then
{
tx10 = text_new(sDate,NextBarStime,var8+PriceScale,"상승목표1+");
Text_SetStyle(tx10,0,0);
Text_SetColor(tx10,Black);
Text_SetSize(tx10,12);
}
Else
Text_SetLocation(tx10,sDate,sTime,var8+PriceScale);
if var4 != var4[1] Then
{
tx11 = text_new(sDate,NextBarStime,var4-PriceScale,"하락목표-");
Text_SetStyle(tx11,0,1);
Text_SetColor(tx11,Black);
Text_SetSize(tx11,12);
}
Else
Text_SetLocation(tx11,sDate,sTime,var4-PriceScale);
if var7 != var7[1] Then
{
tx12 = text_new(sDate,NextBarStime,var7-PriceScale,"하락목표1-");
Text_SetStyle(tx12,0,4);
Text_SetColor(tx12,Black);
Text_SetSize(tx12,12);
}
Else
Text_SetLocation(tx12,sDate,sTime,var7-PriceScale);