커뮤니티
질문 드립니다.
2017-09-22 17:56:38
228
글번호 113021
아래의 추세선 식은 별첨그림처럼 나타나는데 현재봉은 추세선 상향흐름에 있습니다.
상향하향 여부를 변수Tr 로 설정해서 현재봉까지 상향흐름이면 1 하향흐름이면 -1로 받아서 시스템식에서 적용하고 싶은데 도움을 좀 부탁드립니다.
Input:length(12);
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 = Highest(H,length) == H and lastHiVal <> H;
Condition2 = Lowest(L,length) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
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{
PlaySound("C:WWRFuturesYesGlobalProdataSoundaa.wav");
}
if turnPntArr[1][0] == "Lo"
Then{
PlaySound("C:WWRFuturesYesGlobalProdataSoundbb.wav");
}
}
Else{
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
}
TL_SetSize(TL1,0);
TL_SetColor(TL1,RGB(18,124,94));
- 1. 20170922_175134.png (0.02 MB)
답변 1
예스스탁 예스스탁 답변
2017-09-25 13:30:01
안녕하세요
예스스탁입니다.
Input:length(12);
Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tr(0);
Array:valArr[10](0),barArr[10](0),turnPntArr[10]("");
For j = 0 To 9
{
barArr[j] = barArr[j] + 1;
}
Condition1 = Highest(H,length) == H and lastHiVal <> H;
Condition2 = Lowest(L,length) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
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{
tr = 1;
PlaySound("C:WWRFuturesYesGlobalProdataSoundaa.wav");
}
if turnPntArr[1][0] == "Lo"
Then{
tr = -1;
PlaySound("C:WWRFuturesYesGlobalProdataSoundbb.wav");
}
}
Else{
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
}
TL_SetSize(TL1,0);
TL_SetColor(TL1,RGB(18,124,94));
즐거운 하루되세요
> 이심전심 님이 쓴 글입니다.
> 제목 : 질문 드립니다.
> 아래의 추세선 식은 별첨그림처럼 나타나는데 현재봉은 추세선 상향흐름에 있습니다.
상향하향 여부를 변수Tr 로 설정해서 현재봉까지 상향흐름이면 1 하향흐름이면 -1로 받아서 시스템식에서 적용하고 싶은데 도움을 좀 부탁드립니다.
Input:length(12);
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 = Highest(H,length) == H and lastHiVal <> H;
Condition2 = Lowest(L,length) == L and lastLoVal <> L;
If Condition1 Then lastHiVal = H;
If Condition2 Then lastLoVal = L;
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{
PlaySound("C:WWRFuturesYesGlobalProdataSoundaa.wav");
}
if turnPntArr[1][0] == "Lo"
Then{
PlaySound("C:WWRFuturesYesGlobalProdataSoundbb.wav");
}
}
Else{
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}
}
}
TL_SetSize(TL1,0);
TL_SetColor(TL1,RGB(18,124,94));
다음글
이전글