커뮤니티
수식부탁드립니다
2018-03-09 12:10:21
237
글번호 117271
*매번 미안합니다* 아래수식에서
파동마다 각각의 TL2,TL4 수평선들이 넘 짧아서요
1.각각의 TL2수평선들을 상승봉이나올때 까지 선연장
2.각각의 TL4수평선들을 하락봉이나올때 까지 선연장
부탁드립니다 (수고하세요)
Input:length(6);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),처리구분("");
var : TL2(0),TL3(0),TL4(0),TL5(0),T(0),B(0),S(0),cnt(0),TL6(0),TL7(0),TL8(0),TL9(0);
Array:고점[10,2](0),저점[10,2](0); //가격,위치
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and
Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then
처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then
처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
#Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],
#NumToStr(고점[1,1],2));
#Text_SetStyle(Text1, 2, 1);
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
#Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],
# NumToStr(저점[1,1],2));
#Text_SetStyle(Text1, 2, 0);
}
}
TL_SetSize(TL1,3);
TL_SetColor(TL1,CYAN);
if T == -1 and T[1] != -1 Then{
TL2 = TL_New(sdate[index-고점[2,2]],stime[index-고점[2,2]],고점[2,1],
sdate[index-고점[1,2]],stime[index-고점[1,2]],고점[2,1]);
TL_SetSize(TL2,3);
TL_SetColor(TL2,BLACK);
TL_Delete(TL3);
TL3 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],고점[1,1],sdate,stime,고점[1,1]);
TL_SetExtRight(TL3,true);
TL_SetSize(TL3,3);
TL_SetColor(TL3,BLACK);
B = 0;
for cnt = index-고점[1,2] downto 0
{
if B == 0 and C[cnt] < O[cnt] Then
{
B = 1;
S = cnt;
if H[cnt] >= 고점[1,1] Then
B = 2;
}
}
TL_Delete(TL8);
TL_Delete(TL9);
if B >= 1 Then{
TL8 = TL_New(sdate[S+1],stime[S+1],O[S],Sdate,stime,O[S]);
TL_SetExtRight(TL8,true);
TL_SetColor(TL8,BLUE);
}
if B == 2 Then{
TL9 = TL_New(sdate[S+1],stime[S+1],O[S],Sdate,stime,O[S]);
TL_SetExtRight(TL9,true);
TL_SetColor(TL9,BLUE);
}
}
if T == 1 and T[1] != 1 Then{
TL4 = TL_New(sdate[index-저점[2,2]],STime[index-저점[2,2]],저점[2,1],
sdate[index-저점[1,2]],stime[index-저점[1,2]],저점[2,1]);
TL_SetSize(TL4,3);
TL_SetColor(TL4,BLACK);
TL_Delete(TL5);
TL5= TL_New(sdate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1],sdate,stime,저점[1,1]);
TL_SetExtRight(TL5,true);
TL_SetSize(TL5,3);
TL_SetColor(TL5,BLACK);
B = 0;
for cnt = index-저점[1,2] downto 0
{
if B == 0 and C[cnt] > O[cnt] Then
{
B = 1;
S = cnt;
if L[cnt] <= 저점[1,1] Then
B = 2;
}
}
TL_Delete(TL6);
TL_Delete(TL7);
if B >= 1 Then{
TL6 = TL_New(sdate[S+1],stime[S+1],O[S],Sdate,stime,O[S]);
TL_SetExtRight(TL6,true);
TL_SetColor(TL6,RED);
}
if B == 2 Then{
TL7 = TL_New(sdate[S+1],stime[S+1],L[S],Sdate,stime,L[S]);
TL_SetExtRight(TL7,true);
TL_SetColor(TL7,RED);
}
}
if T == 1 and B == 0 and C > O Then{
B = 1;
TL6 = TL_New(sdate[1],stime[1],O,Sdate,stime,O);
TL_SetExtRight(TL6,true);
TL_SetColor(TL6,RED);
if L <= 저점[1,1] Then{
TL7 = TL_New(sdate[S+1],stime[S+1],L[S],Sdate,stime,L[S]);
TL_SetExtRight(TL7,true);
TL_SetColor(TL7,RED);
}
}
if T == -1 and B == 0 and C < O Then{
B = 1;
TL8 = TL_New(sdate[1],stime[1],O,Sdate,stime,O);
TL_SetExtRight(TL8,true);
TL_SetColor(TL8,blue);
if H >= 고점[1,1] Then{
TL9 = TL_New(sdate[1],stime[1],H,Sdate,stime,L);
TL_SetExtRight(TL9,true);
TL_SetColor(TL9,RED);
}
}
답변 1
예스스탁 예스스탁 답변
2018-03-12 09:56:23
안녕하세요
예스스탁입니다.
문의하신 내용은 수식작성을 해보는데 시간이 많이 걸리는 내용입니다.
업무상 많은 시간이 요구되는 부분은 작성을 해드릴수 없습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> 파생돌이 님이 쓴 글입니다.
> 제목 : 수식부탁드립니다
> *매번 미안합니다* 아래수식에서
파동마다 각각의 TL2,TL4 수평선들이 넘 짧아서요
1.각각의 TL2수평선들을 상승봉이나올때 까지 선연장
2.각각의 TL4수평선들을 하락봉이나올때 까지 선연장
부탁드립니다 (수고하세요)
Input:length(6);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),처리구분("");
var : TL2(0),TL3(0),TL4(0),TL5(0),T(0),B(0),S(0),cnt(0),TL6(0),TL7(0),TL8(0),TL9(0);
Array:고점[10,2](0),저점[10,2](0); //가격,위치
처리구분 = "";
If Highest(H,length) == H and lastHiVal <> H and
Lowest(L,length) == L and lastLoVal <> L Then
{
If 저점[1,1] > L Then 처리구분 = "저점처리";
If 고점[1,1] < H Then 처리구분 = "고점처리";
}
Else If Highest(H,length) == H and lastHiVal <> H Then
처리구분 = "고점처리";
Else If Lowest(L,length) == L and lastLoVal <> L Then
처리구분 = "저점처리";
If 처리구분 == "고점처리" Then
{
T = 1;
lastHiVal = H;
If 고점[1,2] < 저점[1,2] Then
{
For j = 10 DownTo 2
{
고점[j,1] = 고점[j-1,1];
고점[j,2] = 고점[j-1,2];
}
}
If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then
{
고점[1,1] = H;
고점[1,2] = Index;
sBar = Index - 저점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
#Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],
#NumToStr(고점[1,1],2));
#Text_SetStyle(Text1, 2, 1);
}
}
If 처리구분 == "저점처리" Then
{
T = -1;
lastLoVal = L;
If 저점[1,2] < 고점[1,2] then
{
For j = 10 DownTo 2
{
저점[j,1] = 저점[j-1,1];
저점[j,2] = 저점[j-1,2];
}
}
If 저점[1,2] < 고점[1,2] or 저점[1,1] > L then
{
저점[1,1] = L;
저점[1,2] = Index;
sBar = Index - 고점[1,2];
eBar = 0;
If TL_GetBeginDate(TL1) == sDate[sBar] and
TL_GetBeginTime(TL1) == sTime[sBar] Then
{
TL_Delete(TL1);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],
sDate[eBar],sTime[eBar],저점[1,1]);
#Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],
# NumToStr(저점[1,1],2));
#Text_SetStyle(Text1, 2, 0);
}
}
TL_SetSize(TL1,3);
TL_SetColor(TL1,CYAN);
if T == -1 and T[1] != -1 Then{
TL2 = TL_New(sdate[index-고점[2,2]],stime[index-고점[2,2]],고점[2,1],
sdate[index-고점[1,2]],stime[index-고점[1,2]],고점[2,1]);
TL_SetSize(TL2,3);
TL_SetColor(TL2,BLACK);
TL_Delete(TL3);
TL3 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],고점[1,1],sdate,stime,고점[1,1]);
TL_SetExtRight(TL3,true);
TL_SetSize(TL3,3);
TL_SetColor(TL3,BLACK);
B = 0;
for cnt = index-고점[1,2] downto 0
{
if B == 0 and C[cnt] < O[cnt] Then
{
B = 1;
S = cnt;
if H[cnt] >= 고점[1,1] Then
B = 2;
}
}
TL_Delete(TL8);
TL_Delete(TL9);
if B >= 1 Then{
TL8 = TL_New(sdate[S+1],stime[S+1],O[S],Sdate,stime,O[S]);
TL_SetExtRight(TL8,true);
TL_SetColor(TL8,BLUE);
}
if B == 2 Then{
TL9 = TL_New(sdate[S+1],stime[S+1],O[S],Sdate,stime,O[S]);
TL_SetExtRight(TL9,true);
TL_SetColor(TL9,BLUE);
}
}
if T == 1 and T[1] != 1 Then{
TL4 = TL_New(sdate[index-저점[2,2]],STime[index-저점[2,2]],저점[2,1],
sdate[index-저점[1,2]],stime[index-저점[1,2]],저점[2,1]);
TL_SetSize(TL4,3);
TL_SetColor(TL4,BLACK);
TL_Delete(TL5);
TL5= TL_New(sdate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1],sdate,stime,저점[1,1]);
TL_SetExtRight(TL5,true);
TL_SetSize(TL5,3);
TL_SetColor(TL5,BLACK);
B = 0;
for cnt = index-저점[1,2] downto 0
{
if B == 0 and C[cnt] > O[cnt] Then
{
B = 1;
S = cnt;
if L[cnt] <= 저점[1,1] Then
B = 2;
}
}
TL_Delete(TL6);
TL_Delete(TL7);
if B >= 1 Then{
TL6 = TL_New(sdate[S+1],stime[S+1],O[S],Sdate,stime,O[S]);
TL_SetExtRight(TL6,true);
TL_SetColor(TL6,RED);
}
if B == 2 Then{
TL7 = TL_New(sdate[S+1],stime[S+1],L[S],Sdate,stime,L[S]);
TL_SetExtRight(TL7,true);
TL_SetColor(TL7,RED);
}
}
if T == 1 and B == 0 and C > O Then{
B = 1;
TL6 = TL_New(sdate[1],stime[1],O,Sdate,stime,O);
TL_SetExtRight(TL6,true);
TL_SetColor(TL6,RED);
if L <= 저점[1,1] Then{
TL7 = TL_New(sdate[S+1],stime[S+1],L[S],Sdate,stime,L[S]);
TL_SetExtRight(TL7,true);
TL_SetColor(TL7,RED);
}
}
if T == -1 and B == 0 and C < O Then{
B = 1;
TL8 = TL_New(sdate[1],stime[1],O,Sdate,stime,O);
TL_SetExtRight(TL8,true);
TL_SetColor(TL8,blue);
if H >= 고점[1,1] Then{
TL9 = TL_New(sdate[1],stime[1],H,Sdate,stime,L);
TL_SetExtRight(TL9,true);
TL_SetColor(TL9,RED);
}
}
다음글
이전글