예스스탁
예스스탁 답변
2025-02-12 11:20:02
안녕하세요
예스스탁입니다.
input : P(20),n(100);
var : t(0);
var : hh(0),hd(0),ht(0),htl(0),htx(0);
var : ll(0),ld(0),lt(0),ltl(0),ltx(0);
Var : TLen1(0),mm(0),mtl(0),mtx(0);
var : tl1(0),tl2(0),tl3(0),tl4(0);
var : tx1(0),tx2(0),tx3(0),tx4(0),stx(0);
TLen1 = Ceiling((P + 1) * .5);
var1 = ma(ma(C, TLen1), TLen1);
if var1 > var1[1] Then
T = 1;
if var1 < var1[1] Then
T = -1;
Plot1(var1,"이평", iff(T==1,Magenta,Cyan));
if t == 1 Then
{
if t != t[1] Then
{
hd = sDate;
ht = sTime;
hh = h;
mm = (hh+LL)/2;
Htl = tl_new(hd,ht,hh,NextBarSdate,NextBarStime,hh);
TL_SetColor(htl,Blue);
TL_SetSize(htl,2);
htx = Text_New(NextBarSdate,NextBarStime,hh,NumToStr(hh,2));
Text_SetStyle(htx,0,1);
Text_SetColor(htx,Blue);
if LL > 0 Then
{
mtl = tl_new(hd,ht,mm,NextBarSdate,NextBarStime,mm);
TL_SetColor(mtl,Green);
TL_SetSize(mtl,2);
mtx = Text_New(NextBarSdate,NextBarStime,mm,NumToStr(mm,2));
Text_SetStyle(mtx,0,1);
Text_SetColor(mtx,Green);
}
Condition1 = False;
}
Else
{
if h > hh Then
{
hh = h;
mm = (hh+LL)/2;
}
}
TL_SetBegin(htl,hd,ht,hh);
TL_SetEnd(htl,NextBarSdate,NextBarStime,hh);
TL_SetBegin(mtl,hd,ht,mm);
TL_SetEnd(mtl,NextBarSdate,NextBarStime,mm);
Text_SetString(htx,NumToStr(hh,2));
Text_SetLocation(htx,NextBarSdate,NextBarStime,hh);
Text_SetString(mtx,NumToStr(mm,2));
Text_SetLocation(mtx,NextBarSdate,NextBarStime,mm);
if LL > 0 and abs(HH-LL) >= PriceScale*n Then
{
if Condition1 == False Then
{
Condition1 = true;
tl1 = tl_new(hd,ht,hh-(hh-LL)*0.236,NextBarSdate,NextBarStime,hh-(hh-LL)*0.236);
TL_SetColor(tl1,Magenta);
TL_SetSize(tl1,2);
tl2 = tl_new(hd,ht,hh-(hh-LL)*0.382,NextBarSdate,NextBarStime,hh-(hh-LL)*0.382);
TL_SetColor(tl2,Magenta);
TL_SetSize(tl2,2);
tl3 = tl_new(hd,ht,hh-(hh-LL)*0.618,NextBarSdate,NextBarStime,hh-(hh-LL)*0.618);
TL_SetColor(tl3,Cyan);
TL_SetSize(tl3,2);
tl4 = tl_new(hd,ht,hh-(hh-LL)*0.764,NextBarSdate,NextBarStime,hh-(hh-LL)*0.764);
TL_SetColor(tl4,Cyan);
TL_SetSize(tl4,2);
tx1 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.236,NumToStr(hh-(hh-LL)*0.236,2));
Text_SetStyle(tx1,0,1);
Text_SetColor(tx1,Magenta);
tx2 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.382,NumToStr(hh-(hh-LL)*0.382,2));
Text_SetStyle(tx2,0,1);
Text_SetColor(tx2,Magenta);
tx3 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.618,NumToStr(hh-(hh-LL)*0.618,2));
Text_SetStyle(tx3,0,1);
Text_SetColor(tx3,Cyan);
tx4 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.764,NumToStr(hh-(hh-LL)*0.764,2));
Text_SetStyle(tx4,0,1);
Text_SetColor(tx4,Cyan);
}
Else
{
TL_SetBegin(tl1,hd,ht,hh-(hh-LL)*0.236);
TL_SetBegin(tl2,hd,ht,hh-(hh-LL)*0.382);
TL_SetBegin(tl3,hd,ht,hh-(hh-LL)*0.618);
TL_SetBegin(tl4,hd,ht,hh-(hh-LL)*0.764);
TL_SetEnd(tl1,NextBarSdate,NextBarStime,hh-(hh-LL)*0.236);
TL_SetEnd(tl2,NextBarSdate,NextBarStime,hh-(hh-LL)*0.382);
TL_SetEnd(tl3,NextBarSdate,NextBarStime,hh-(hh-LL)*0.618);
TL_SetEnd(tl4,NextBarSdate,NextBarStime,hh-(hh-LL)*0.764);
Text_SetString(tx1,NumToStr(hh-(hh-LL)*0.236,2));
Text_SetString(tx2,NumToStr(hh-(hh-LL)*0.382,2));
Text_SetString(tx3,NumToStr(hh-(hh-LL)*0.618,2));
Text_SetString(tx4,NumToStr(hh-(hh-LL)*0.764,2));
Text_SetLocation(tx1,NextBarSdate,NextBarStime,hh-(hh-LL)*0.236);
Text_SetLocation(tx2,NextBarSdate,NextBarStime,hh-(hh-LL)*0.382);
Text_SetLocation(tx3,NextBarSdate,NextBarStime,hh-(hh-LL)*0.618);
Text_SetLocation(tx4,NextBarSdate,NextBarStime,hh-(hh-LL)*0.764);
}
if Crossup(c,hh-(hh-LL)*0.236) Then
{
stx = Text_New(sDate,sTime,L,"●");
Text_SetStyle(stx,2,0);
Text_SetColor(stx,Red);
}
if Crossup(c,hh-(hh-LL)*0.764) Then
{
stx = Text_New(sDate,sTime,L,"●");
Text_SetStyle(stx,2,0);
Text_SetColor(stx,Red);
}
}
}
if t == -1 Then
{
if t != t[1] Then
{
ld = sDate;
lt = sTime;
ll = l;
mm = (hh+LL)/2;
ltl = tl_new(ld,lt,ll,NextBarSdate,NextBarStime,ll);
TL_SetColor(ltl,Red);
TL_SetSize(ltl,2);
ltx = Text_New(NextBarSdate,NextBarStime,ll,NumToStr(ll,2));
Text_SetStyle(ltx,0,0);
Text_SetColor(ltx,Red);
if hh > 0 Then
{
mtl = tl_new(ld,lt,mm,NextBarSdate,NextBarStime,mm);
TL_SetColor(mtl,Green);
TL_SetSize(mtl,2);
mtx = Text_New(NextBarSdate,NextBarStime,mm,NumToStr(mm,2));
Text_SetStyle(mtx,0,1);
Text_SetColor(mtx,Green);
}
Condition1 = False;
}
Else
{
if l < ll Then
{
ll = l;
mm = (hh+LL)/2;
}
}
TL_SetBegin(ltl,ld,lt,ll);
TL_SetEnd(ltl,NextBarSdate,NextBarStime,ll);
TL_SetBegin(mtl,ld,lt,mm);
TL_SetEnd(mtl,NextBarSdate,NextBarStime,mm);
Text_SetString(ltx,NumToStr(ll,2));
Text_SetLocation(ltx,NextBarSdate,NextBarStime,ll);
Text_SetString(mtx,NumToStr(mm,2));
Text_SetLocation(mtx,NextBarSdate,NextBarStime,mm);
if HH > 0 and abs(HH-LL) >= PriceScale*n Then
{
if Condition2 == False Then
{
Condition2 = true;
tl1 = tl_new(ld,lt,hh-(hh-LL)*0.236,NextBarSdate,NextBarStime,hh-(hh-LL)*0.236);
TL_SetColor(tl1,Magenta);
TL_SetSize(tl1,2);
tl2 = tl_new(ld,lt,hh-(hh-LL)*0.382,NextBarSdate,NextBarStime,hh-(hh-LL)*0.382);
TL_SetColor(tl2,Magenta);
TL_SetSize(tl2,2);
tl3 = tl_new(ld,lt,hh-(hh-LL)*0.618,NextBarSdate,NextBarStime,hh-(hh-LL)*0.618);
TL_SetColor(tl3,Cyan);
TL_SetSize(tl3,2);
tl4 = tl_new(ld,lt,hh-(hh-LL)*0.764,NextBarSdate,NextBarStime,hh-(hh-LL)*0.764);
TL_SetColor(tl4,Cyan);
TL_SetSize(tl4,2);
tx1 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.236,NumToStr(hh-(hh-LL)*0.236,2));
Text_SetStyle(tx1,0,1);
Text_SetColor(tx1,Magenta);
tx2 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.382,NumToStr(hh-(hh-LL)*0.382,2));
Text_SetStyle(tx2,0,1);
Text_SetColor(tx2,Magenta);
tx3 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.618,NumToStr(hh-(hh-LL)*0.618,2));
Text_SetStyle(tx3,0,1);
Text_SetColor(tx3,Cyan);
tx4 = Text_New(NextBarSdate,NextBarStime,hh-(hh-LL)*0.764,NumToStr(hh-(hh-LL)*0.764,2));
Text_SetStyle(tx4,0,1);
Text_SetColor(tx4,Cyan);
}
Else
{
TL_SetBegin(tl1,ld,lt,hh-(hh-LL)*0.236);
TL_SetBegin(tl2,ld,lt,hh-(hh-LL)*0.382);
TL_SetBegin(tl3,ld,lt,hh-(hh-LL)*0.618);
TL_SetBegin(tl4,ld,lt,hh-(hh-LL)*0.764);
TL_SetEnd(tl1,NextBarSdate,NextBarStime,hh-(hh-LL)*0.236);
TL_SetEnd(tl2,NextBarSdate,NextBarStime,hh-(hh-LL)*0.382);
TL_SetEnd(tl3,NextBarSdate,NextBarStime,hh-(hh-LL)*0.618);
TL_SetEnd(tl4,NextBarSdate,NextBarStime,hh-(hh-LL)*0.764);
Text_SetString(tx1,NumToStr(hh-(hh-LL)*0.236,2));
Text_SetString(tx2,NumToStr(hh-(hh-LL)*0.382,2));
Text_SetString(tx3,NumToStr(hh-(hh-LL)*0.618,2));
Text_SetString(tx4,NumToStr(hh-(hh-LL)*0.764,2));
Text_SetLocation(tx1,NextBarSdate,NextBarStime,hh-(hh-LL)*0.236);
Text_SetLocation(tx2,NextBarSdate,NextBarStime,hh-(hh-LL)*0.382);
Text_SetLocation(tx3,NextBarSdate,NextBarStime,hh-(hh-LL)*0.618);
Text_SetLocation(tx4,NextBarSdate,NextBarStime,hh-(hh-LL)*0.764);
}
if CrossDown(c,hh-(hh-LL)*0.236) Then
{
stx = Text_New(sDate,sTime,H,"●");
Text_SetStyle(stx,2,1);
Text_SetColor(stx,Blue);
}
if CrossDown(c,hh-(hh-LL)*0.764) Then
{
stx = Text_New(sDate,sTime,H,"●");
Text_SetStyle(stx,2,1);
Text_SetColor(stx,Blue);
}
}
}
즐거운 하루되세요
> 라몬 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다.
> 안녕하세요
늘 도움주셔서 감사합니다.
아래 수식은 고,저 라인을 표시한 수식입니다.
수정드릴 내용은
1. 고,저 라인 폭이 100틱 이상일경우만 피보나치 (23.6, 38.2, 50, 61.8, 76.4) 선을 표기하
였으면 합니다.
100틱 이하는 50% 선만 표기하였으면 합니다.
2. 100틱 이상의 고,저 라인에 피보나치 선이 아닌 23.6% 와 76.4% 에 캔들이 종가로 통과할
경우 그 다음봉에 고점에서 저점은 청색. 저점에서 고점은 적색으로 원이나 점 표시가
되었으면 합니다.( 지표나 검색등 어느쪽도 좋습니다.
다시 역으로 상승하거나 하락할경우 반대 색깔로 표시되었으면 합니다.
* 라인폭 100틱은 변수 부탁드립니다.
input : P(20);
var : t(0);
var : hh(0),hd(0),ht(0),htl(0),htx(0);
var : ll(0),ld(0),lt(0),ltl(0),ltx(0);
Var : TLen1(0);
TLen1 = Ceiling((P + 1) * .5);
var1 = ma(ma(C, TLen1), TLen1);
if var1 > var1[1] Then
T = 1;
if var1 < var1[1] Then
T = -1;
Plot1(var1,"이평", iff(T==1,Magenta,Cyan));
if t == 1 Then
{
if t != t[1] Then
{
hd = sDate;
ht = sTime;
hh = h;
Htl = tl_new(hd,ht,hh,NextBarSdate,NextBarStime,hh);
TL_SetColor(htl,Blue);
TL_SetSize(htl,2);
htx = Text_New(NextBarSdate,NextBarStime,hh,NumToStr(hh,2));
Text_SetStyle(htx,0,1);
Text_SetColor(htx,Blue);
}
Else
{
if h > hh Then
{
hh = h;
}
}
TL_SetBegin(htl,hd,ht,hh);
TL_SetEnd(htl,NextBarSdate,NextBarStime,hh);
Text_SetString(htx,NumToStr(hh,2));
Text_SetLocation(htx,NextBarSdate,NextBarStime,hh);
}
if t == -1 Then
{
if t != t[1] Then
{
ld = sDate;
lt = sTime;
ll = l;
ltl = tl_new(ld,lt,ll,NextBarSdate,NextBarStime,ll);
TL_SetColor(ltl,Red);
TL_SetSize(ltl,2);
ltx = Text_New(NextBarSdate,NextBarStime,ll,NumToStr(ll,2));
Text_SetStyle(ltx,0,0);
Text_SetColor(ltx,Red);
}
Else
{
if l < ll Then
{
ll = l;
}
}
TL_SetBegin(ltl,ld,lt,ll);
TL_SetEnd(ltl,NextBarSdate,NextBarStime,ll);
Text_SetString(ltx,NumToStr(ll,2));
Text_SetLocation(ltx,NextBarSdate,NextBarStime,ll);
}