커뮤니티
문의 드립니다.
2017-04-05 23:02:44
318
글번호 108518
안녕하세요
아래 파동 수식에서
지나간 고점과 고점, 저점과 저점들은 계속
연결되고 오른쪽 연장은 되지 않고
현재고점과 전고점 추세선과 전고점과 전전고점 추세선 2개
현재 저점과 전저점 추세선, 전저점과 전전저점 추세선 2개만
오른쪽으로 연장되게 부탁드립니다.
미리 감사 드립니다
==========================
Input:length(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),처리구분(""),
TL_Val1(0),TL_Val2(0);
var : T(0),LTL1(0);
var : HTL1(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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
if T[1] != 1 Then{
TL_SetExtRight(LTL1,False);
LTL1 = TL_New(sDate[index-저점[2,2]],sTime[index-저점[2,2]],저점[2,1],sDate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1]);
TL_SetExtRight(LTL1,true);
}
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
if T[1] != -1 then{
TL_SetExtRight(HTL1,false);
HTL1 = TL_New(sDate[index-고점[2,2]],sTime[index-고점[2,2]],고점[2,1],sDate[index-고점[1,2]],sTime[index-고점[1,2]],고점[1,1]);
TL_SetExtRight(HTL1,true);
}
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,0.5);
TL_SetColor(TL1,white);
TL_SetColor(LTL1,green);
TL_SetColor(HTL1,yellow);
TL_SetSize(LTL1,1);
TL_SetSize(HTL1,1);
=================================
- 1. 파동_추세선.JPG (0.06 MB)
답변 1
예스스탁 예스스탁 답변
2017-04-07 09:32:21
안녕하세요
예스스탁입니다.
Input:length(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),처리구분(""),
TL_Val1(0),TL_Val2(0);
var : T(0),LTL1(0),ltl2(0),ltl3(0);
var : HTL1(0),htl2(0),htl3(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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
if T[1] != 1 Then{
LTL1 = TL_New(sDate[index-저점[2,2]],sTime[index-저점[2,2]],저점[2,1],sDate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1]);
LTL2 = LTL1[1];
LTL3 = LTL2[1];
TL_SetExtRight(LTL1,true);
TL_SetExtRight(LTL3,False);
}
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
if T[1] != -1 then{
HTL1 = TL_New(sDate[index-고점[2,2]],sTime[index-고점[2,2]],고점[2,1],sDate[index-고점[1,2]],sTime[index-고점[1,2]],고점[1,1]);
HTL2 = HTL1[1];
HTL3 = HTL2[1];
TL_SetExtRight(HTL1,true);
TL_SetExtRight(HTL3,false);
}
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,0.5);
TL_SetColor(TL1,white);
TL_SetColor(LTL1,green);
TL_SetColor(HTL1,yellow);
TL_SetSize(LTL1,1);
TL_SetSize(HTL1,1);
즐거운 하루되세요
> 동해바다01 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 안녕하세요
아래 파동 수식에서
지나간 고점과 고점, 저점과 저점들은 계속
연결되고 오른쪽 연장은 되지 않고
현재고점과 전고점 추세선과 전고점과 전전고점 추세선 2개
현재 저점과 전저점 추세선, 전저점과 전전저점 추세선 2개만
오른쪽으로 연장되게 부탁드립니다.
미리 감사 드립니다
==========================
Input:length(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),처리구분(""),
TL_Val1(0),TL_Val2(0);
var : T(0),LTL1(0);
var : HTL1(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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
if T[1] != 1 Then{
TL_SetExtRight(LTL1,False);
LTL1 = TL_New(sDate[index-저점[2,2]],sTime[index-저점[2,2]],저점[2,1],sDate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1]);
TL_SetExtRight(LTL1,true);
}
If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then
{
sBar = Index - 저점[2,2];
eBar = Index - 저점[1,2];
}
}
}
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);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
if T[1] != -1 then{
TL_SetExtRight(HTL1,false);
HTL1 = TL_New(sDate[index-고점[2,2]],sTime[index-고점[2,2]],고점[2,1],sDate[index-고점[1,2]],sTime[index-고점[1,2]],고점[1,1]);
TL_SetExtRight(HTL1,true);
}
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
TL_SetSize(TL1,0.5);
TL_SetColor(TL1,white);
TL_SetColor(LTL1,green);
TL_SetColor(HTL1,yellow);
TL_SetSize(LTL1,1);
TL_SetSize(HTL1,1);
=================================