답변완료
문의드립니다.
davas 박스 영웅문 수식을 아래와 같이 변수를 확정해놓은 수식이 있습니다.
LL = Lowest(L, 5);
if( L == Lowest(L,5), L,
if(L(1) == Lowest(L,5), L(1)
if(L(2) == Lowest(L,5), L(2)
if(L(3) == Lowest(L,5), L(3), L(4)))));
NH = ValueWhen(1, H > Highest(H, 5, 1), H);
조건 = Highest(H,3) < Highest(H, 4);
Top = ValueWhen(1, BarsSince(H > Highest(H, 5,1)) == 3 && 조건, NH);
Und = ValueWhen(1, BarsSince(H > Highest(H, 5,1)) == 3 && 조건, LL);
여기서 기간 5, 3에 대한 변수를 조정해주기 위해
영웅문 통해 davas 박스를 아래와 같이 구현했습니다.
수식1 상단
LL= Lowest(L, 기간);
NH=ValueWhen(1, H> Highest(H, 기간, 1), H);
// 조건=Highest(H, 기간-2) < Highest(H,기간-1);
Top = ValueWhen(1, BarsSince(H > Highest(H, 기간,1)) == p , NH);
수식2 하단
LL= Lowest(L, 기간);
NH=ValueWhen(1, H> Highest(H, 기간, 1), H);
// 조건=Highest(H, 기간-2) < Highest(H,기간-1);
Und = ValueWhen(1, BarsSince(H > Highest(H, 기간, 1)) == p , LL);
예스트레이더로 동일하게 차트를 구현할수 있는 수식이 궁금합니다.
2023-04-11
1055
글번호 168079
지표
답변완료
수정 문의
아래 지표식을 사용 중인데요
이 지표에서 빨강선이랑 파랑선을 지우고
빨간동그라미와 파란동그라미만 표시되도록
검색식으로 수정해 주실수 있나요?
부탁드려요(__)
inputs: ATRLength(15), Strength(20), 폭(0.25);
input : 쌍바닥상1(2),쌍바닥상2(0),쌍바닥하1(1),쌍바닥하2(2);
input : 쌍봉상1(2),쌍봉상2(1),쌍봉하1(0),쌍봉하2(2);
var : STrend(0),ATRv(0), avgv(0), dnv(0), upv(0), trend(1), flag(0), flagh(0), ST(0),hl(0);
var : idx(0),hh(0),ll(0),EP1(0),EP2(0);
var : ema1(0),ema2(0),ema3(0),h1(0),h2(0),h3(0),h4(0),L1(0),l2(0),l3(0),l4(0);
var :tx(0),tl(0),tx1(0),tx2(0),tx11(0),tx12(0),tx3(0);
Ep1 = 2/(ATRLength+1);
Ep2 = 2/(Strength+1);
idx = idx+1;
if idx < ATRLength Then
{
hh = DayHigh;
ll = daylow;
}
Else
{
hh = Highest(High, ATRLength);
ll = Lowest(Low, ATRLength);
}
if idx < Strength Then
{
h1 = DayHigh;
l1 = daylow;
}
Else
{
h1 = Highest(High, Strength);
l1 = Lowest(Low, Strength);
}
hl = hh-ll;
if idx == 1 Then
{
ema1 = hl;
ema2 = h;
ema3 = l;
}
Else
{
ema1 = hl * EP1 + ema1 * (1-EP1);
ema2 = h * EP2 + ema2 * (1-EP2);
ema3 = l * EP2 + ema3 * (1-EP2);
}
atrv = ema1;
avgv = (ema2+ema3)/2;
upv = avgv + ATRv;
dnv = avgv - ATRv;
if idx >= 2 then
{
if c > upv[1] and c > h1[1] then trend = 1;
else if c < dnv[1] and c < l1[1] then trend = -1;
if trend < 0 and trend[1] > 0 then flag=1; else flag=0;
if trend > 0 and trend[1] < 0 then flagh = 1; else flagh = 0;
if trend > 0 and dnv < dnv[1] then dnv=dnv[1];
if trend < 0 and upv > upv[1] then upv=upv[1];
if flag == 1 then upv = avgv + ATRv;
if flagh == 1 then dnv = avgv - ATRv;
if trend == 1 then ST = dnv; else ST = upv;
STrend = trend;
}
Plot1(st,"SuperTrend",iff(strend == 1,Red,blue));
if Trend != Trend[1] Then
{
if Trend == 1 Then
{
var1 = h;
var2 = var1[1];
TL = TL_New_Self(sDate,sTime,var1,sDate,sTime,99999999);
TL_SetColor(TL,Red);
TL_SetSize(TL,0.5);
TL_Delete(TL);
tx = Text_New_Self(sDate,sTime, st-PriceScale*0,"▲");
Text_SetColor(tx,Yellow);
Text_SetSize(tx,11);
Text_SetStyle(tx,2,2);
if Var4 > 0 and var3 <= Var4+PriceScale*쌍바닥상1 and var3 >= Var4+PriceScale*쌍바닥상2 Then
{
tx11 = Text_New_Self(sDate,sTime, st-PriceScale*0,"●");
Text_SetColor(tx11,Magenta);
Text_SetSize(tx11,10);
Text_SetStyle(tx11,2,2);
}
if Var4 > 0 and var3 <= Var4-PriceScale*쌍바닥하1 and var3 >= Var4-PriceScale*쌍바닥하2 Then
{
tx11 = Text_New_Self(sDate,sTime, st-PriceScale*0,"●");
Text_SetColor(tx11,Lime);
Text_SetSize(tx11,10);
Text_SetStyle(tx11,2,2);
}
}
Else
{
Var3 = l;
Var4 = Var3[1];
tx = Text_New_Self(sDate,sTime, st+PriceScale*0,"*");
Text_SetColor(tx,Blue);
Text_SetSize(tx,12);
Text_SetStyle(tx,2,2);
if Var2 > 0 and var1 <= Var2+PriceScale*쌍봉상1 and var1 >= Var2+PriceScale*쌍봉상2 Then
{
tx12 = Text_New_Self(sDate,sTime, st+PriceScale*0,"●");
Text_SetColor(tx12,Cyan);
Text_SetSize(tx12,10);
Text_SetStyle(tx12,2,2);
}
if Var2 > 0 and var1 <= Var2-PriceScale*쌍봉하1 and var1 >= Var2-PriceScale*쌍봉하2 Then
{
tx12 = Text_New_Self(sDate,sTime, st+PriceScale*0,"●");
Text_SetColor(tx12,Green);
Text_SetSize(tx12,10);
Text_SetStyle(tx12,2,2);
}
}
}
Else
{
if Trend == 1 Then
{
if h > var1 Then
var1 = h;
}
if Trend == -1 Then
{
if l < var3 Then
var3 = l;
}
}
if Trend != Trend[1] Then
{
if Trend == 1 Then
{
h2 = h;
h3 = h2[1];
h4 = h3[1];
if L4 > 0 and
max(L2,l3,l4) <= min(L2,l3,l4)+폭 Then
{
tx1 = Text_New_Self(sDate,sTime, st-PriceScale*0,"●");
Text_SetColor(tx1,Black);
Text_SetSize(tx1,10);
Text_SetStyle(tx1,2,2);
}
if Condition1 == true Then
Text_Delete(tx3);
}
Else #음전환
{
L2 = l;
l3 = l2[1];
l4 = l3[1];
Condition1 = False;
if L4 > 0 and max(l3,l4) <= min(L3,L4)+폭 Then
{
tx3 = Text_New_Self(sDate,sTime, st+PriceScale*2,"●");
Text_SetColor(tx3,Red);
Text_SetSize(tx3,10);
Text_SetStyle(tx3,2,2);
Condition1 = true;
}
if Condition1 == true and l2 < max(l3,l4)-폭 Then
{
Condition1 = False;
Text_Delete(tx3);
}
}
}
Else
{
if Trend == 1 Then
{
if h > h2 Then
h2 = h;
}
if Trend == -1 Then
{
if l < L2 Then
{
L2 = l;
if Condition1 == true and l2 < max(l3,l4)-폭 Then
{
Condition1 = False;
Text_Delete(tx3);
}
}
}
}
2023-04-11
755
글번호 168078
검색