예스스탁
예스스탁 답변
2020-10-12 16:50:55
안녕하세요
예스스탁입니다.
1
각수평선은 수평선별로 모두 추적해서 n개봉을 그리게 해드리기는 어렵습니다.
수평선은 가장 최근 고점이나 저점을 그리고 다음 고점이나 저점 발생시까지
최대 n개봉가지만 수평이 연장되게 작성해 드립니다.
2
파동선표시나 수평선표시는 1을 지정하시면 표시를 하고 0을 지정하시면 표시를 하지 않습니다.
3
Input:chngRate(0.1),파동선표시(1),수평선표시(1),nbar(20);
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),TL2(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Min(valArr[1],valArr[2]) * (1 + (chngRate/100)) < H and lastHiVal < H;
Condition2 = Max(valArr[1],valArr[2]) * (1 - (chngRate/100)) > L and (lastLoVal > L || lastLoVal == 0);
If Condition1 Then { lastHiVal = H; lastLoVal = 0; }
If Condition2 Then { lastLoVal = L; lastHiVal = 0; }
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then
{
if 파동선표시 == 1 Then
{
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
if 수평선표시 == 1 Then
{
TL2 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate,sTime,valArr[2]);
TL_SetColor(TL2,RED);
}
if turnPntArr[1][0]=="Hi" Then{
}
if turnPntArr[1][0] =="Lo" Then{
}
}
Else
{
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
if barArr[2] <= 20 Then
TL_SetEnd(TL2,sDate,sTime,valArr[2]);
}
}
}
TL_SetSize(TL1,1);
TL_SetColor(TL1,black);
즐거운 하루되세요
> 로꼬로꼬 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 안녕하세요
날씨가 쌀쌀한 요즘 감기 조심하세요..
기존에 수식에 한가지를 더 추가하고 싶어서 문의 남깁니다.
첨부한 그림처럼.. 검은색 선이 꺽이는 지점에 수평으로 선을 더 넣고 싶습니다.
수평으로 연결되는선은 계속 연결되는 것이 아니라 20봉정도 보이게 하고 싶습니다.
또한 수평으로 보이는 선을 변수에서 조종할수 있었으면 좋겠습니다.
그리고 차트표시에서 검은색선과 새로이 만들어 달라는 선을 표시하거나 안표시 할수 있게 해주시면 감사하겠습니다.
기존 수식입니다.
Input:chngRate(0.1);
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Min(valArr[1],valArr[2]) * (1 + (chngRate/100)) < H and lastHiVal < H;
Condition2 = Max(valArr[1],valArr[2]) * (1 - (chngRate/100)) > L and (lastLoVal > L || lastLoVal == 0);
If Condition1 Then { lastHiVal = H; lastLoVal = 0; }
If Condition2 Then { lastLoVal = L; lastHiVal = 0; }
turnPntBit = "";
If Condition1 and Condition2 Then
{
If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then
turnPntBit = "HiLo";
Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi";
Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo";
}
Else If Condition1 Then turnPntBit = "Hi";
Else If Condition2 Then turnPntBit = "Lo";
If turnPntBit <> "" Then
{
If turnPntBit == "HiLo" Then
{
valArr[1] = IFF(turnPntArr[1] == "Hi",H,L);
barArr[1] = 0;
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
If turnPntArr[1] == "Hi" Then
turnPntBit = "Lo";
Else
turnPntBit = "Hi";
}
If turnPntBit <> turnPntArr[1] Then
{
for j = 8 downto 1
{
valArr[j+1] = valArr[j];
barArr[j+1] = barArr[j];
turnPntArr[j+1] = turnPntArr[j];
}
}
If turnPntBit <> turnPntArr[1] or
(turnPntBit == turnPntArr[1] and
((turnPntBit == "Hi" and valArr[1] < H) or
(turnPntBit == "Lo" and valArr[1] > L))) Then
{
valArr[1] = IFF(turnPntBit == "Hi",H,L);
barArr[1] = 0;
turnPntArr[1] = turnPntBit;
If turnPntArr[1][1] <> turnPntArr[1][0] Then{
TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
if turnPntArr[1][0]=="Hi" Then{
}
if turnPntArr[1][0] =="Lo" Then{
}
}
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
TL_SetSize(TL1,1);
TL_SetColor(TL1,black);