예스스탁
예스스탁 답변
2022-12-09 09:25:01
안녕하세요
예스스탁입니다.
input: ATRLength3(90), ATRMult3(2.7),상승색a(Red),하락색a(Blue),색상두께(30);
vars: ATR3(0), avg3(0), dn3(0), up3(0), trend3(1), flag3(0), flagh3(0), qqq3(0),dbox(0);
var : d1(0),t1(0),hh(0),ll(0);
ATR3 = ATR(ATRLength3) * ATRMult3;
avg3 = (High + Low)/2;
up3 = avg3 + ATR3;
dn3 = avg3 - ATR3;
if close > up3[1] then trend3 = 1;
else if close < dn3[1] then trend3 = -1;
if trend3 < 0 and trend3[1] > 0 then flag3 = 1; else flag3 = 0;
if trend3 > 0 and trend3[1] < 0 then flagh3 = 1; else flagh3 = 0;
if trend3 > 0 and dn3 < dn3[1] then dn3 = dn3[1];
if trend3 < 0 and up3 > up3[1] then up3 = up3[1];
if flag3 == 1 then up3 = avg3 + ATR3;
if flagh3 == 1 then dn3 = avg3 - ATR3;
if trend3 == 1 then qqq3 = dn3; else qqq3 = up3;
Plot3(qqq3,"qqq3",iff(trend3 == 1, Magenta, Blue));
if trend3 != trend3[1] Then
{
if trend3 == 1 then
{
qqq3 = up3;
d1 = sdate;
t1 = sTime;
hh = h;
ll = l;
dbox = box_new(sDate,sTime,H,NextBarSdate,NextBarStime,L);
Box_SetColor(dbox,상승색a);
Box_SetFill(dbox,true,색상두께);
}
if trend3 == -1 then
{
qqq3 = dn3;
d1 = sdate;
t1 = sTime;
hh = h;
ll = l;
dbox = box_new(sDate,sTime,H,NextBarSdate,NextBarStime,L);
Box_SetColor(dbox,하락색a);
Box_SetFill(dbox,true,색상두께);
}
}
Else
{
if h > hh Then
hh = h;
if l < ll Then
ll = l;
Box_SetBegin(dbox,d1,t1,hh);
Box_SetEnd(dbox,NextBarSdate,NextBarStime,ll);
}
즐거운 하루되세요
> 외국인 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다
>
박스가 나타나지 안는것 수정 부탁 드립니다 Y 축 높이 동일하게 박스높이 조정가능하게 부탁드립니다
input: ATRLength3(90), ATRMult3(2.7),상승색a(Red),하락색a(Blue),색상두께(30);
vars: ATR3(0), avg3(0), dn3(0), up3(0), trend3(1), flag3(0), flagh3(0), qqq3(0),dbox(0);
ATR3 = ATR(ATRLength3) * ATRMult3;
avg3 = (High + Low)/2;
up3 = avg3 + ATR3;
dn3 = avg3 - ATR3;
if close > up3[1] then trend3 = 1;
else if close < dn3[1] then trend3 = -1;
if trend3 < 0 and trend3[1] > 0 then flag3 = 1; else flag3 = 0;
if trend3 > 0 and trend3[1] < 0 then flagh3 = 1; else flagh3 = 0;
if trend3 > 0 and dn3 < dn3[1] then dn3 = dn3[1];
if trend3 < 0 and up3 > up3[1] then up3 = up3[1];
if flag3 == 1 then up3 = avg3 + ATR3;
if flagh3 == 1 then dn3 = avg3 - ATR3;
if trend3 == 1 then qqq3 = dn3; else qqq3 = up3;
Plot3(qqq3,"qqq3",iff(trend3 == 1, Magenta, Blue));
if trend3 == 1 then qqq3 = up3;
dbox = box_new(sDate,sTime,H,NextBarSdate,NextBarStime,L);
Box_SetColor(dbox,상승색a);
Box_SetFill(dbox,true,색상두께);
Box_SetEnd(dbox,NextBarSdate,NextBarStime,L);
if trend3 == 1 then qqq3 = dn3;
dbox = box_new(sDate,sTime,H,NextBarSdate,NextBarStime,L);
Box_SetColor(dbox,하락색a);
Box_SetFill(dbox,true,색상두께);
Box_SetEnd(dbox,NextBarSdate,NextBarStime,L);