커뮤니티

문의

프로필 이미지
레전드
2020-06-08 12:36:47
2154
글번호 139630
답변완료
항상 친절한 답변 감사드립니다. 아래식을 데이타2에 적용하게 부탁드립니다 Input:length(12); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0), Text1(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 { 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) +NewLine+"진폭"+NumToStr((고점[1,1]-저점[1,1]),2)); Text_SetStyle(Text1, 2, 1); } } If 처리구분 == "저점처리" Then { 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) +NewLine+"진폭"+NumToStr((고점[1,1]-저점[1,1]),2)); Text_SetStyle(Text1, 2, 0); } } TL_SetSize(TL1,2); TL_SetColor(TL1,BLACK);
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-06-09 09:57:25

안녕하세요 예스스탁입니다. 차트에 적용후에 마우스로 끌어서 data2위에 올리셔야 합니다. 추세선만 있는 지표는 마우스로 잡을 plot이 없어 시초가를 추가했습니다. Input:length(12); Var:j(0,data2),lastHiVal(0,data2),lastLoVal(0,data2),sBar(0,data2),eBar(0,data2),TL1(0,data2),Text1(0,data2),처리구분("",data2); Array:고점[10,2](0,data2),저점[10,2](0,data2); //가격,위치 처리구분 = ""; If data2(Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L) Then { If data2(저점[1,1] > L) Then 처리구분 = "저점처리"; If data2(고점[1,1] < H) Then 처리구분 = "고점처리"; } Else If data2(Highest(H,length) == H and lastHiVal <> H) Then 처리구분 = "고점처리"; Else If data2(Lowest(L,length) == L and lastLoVal <> L) Then 처리구분 = "저점처리"; If 처리구분 == "고점처리" Then { lastHiVal = data2(H); If data2(고점[1,2] < 저점[1,2]) Then { For j = 10 DownTo 2 { 고점[j,1] = 고점[j-1,1]; 고점[j,2] = 고점[j-1,2]; } } If data2(고점[1,2] < 저점[1,2] or 고점[1,1] < H) Then { 고점[1,1] = data2(H); 고점[1,2] = data2(Index); sBar = data2(Index - 저점[1,2]); eBar = 0; If data2(TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar]) Then { TL_Delete(TL1); Text_Delete(Text1); } TL1 = TL_New_self(data2(sDate[sBar]),data2(sTime[sBar]),저점[1,1],data2(sDate[eBar]),data2(sTime[eBar]),고점[1,1]); Text1 = Text_New_self(data2(sDate[eBar]),data2(sTime[eBar]),고점[1,1],NumToStr(고점[1,1],2)+NewLine+"진폭"+NumToStr((고점[1,1]-저점[1,1]),2)); Text_SetStyle(Text1, 2, 1); } } If 처리구분 == "저점처리" Then { lastLoVal = data2(L); If data2(저점[1,2] < 고점[1,2]) then { For j = 10 DownTo 2 { 저점[j,1] = 저점[j-1,1]; 저점[j,2] = 저점[j-1,2]; } } If data2(저점[1,2] < 고점[1,2] or 저점[1,1] > L) then { 저점[1,1] = data2(L); 저점[1,2] = data2(Index); sBar = data2(Index - 고점[1,2]); eBar = 0; If data2(TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar]) Then { TL_Delete(TL1); Text_Delete(Text1); } TL1 = TL_New_Self(data2(sDate[sBar]),data2(sTime[sBar]),고점[1,1],data2(sDate[eBar]),data2(sTime[eBar]),저점[1,1]); Text1 = Text_New_Self(data2(sDate[eBar]),data2(sTime[eBar]),저점[1,1],NumToStr(저점[1,1],2)+NewLine+"진폭"+NumToStr((고점[1,1]-저점[1,1]),2)); Text_SetStyle(Text1, 2, 0); } } TL_SetSize(TL1,2); TL_SetColor(TL1,BLACK); plot1(data2(openD(0))); 즐거운 하루되세요 > 레전드 님이 쓴 글입니다. > 제목 : 문의 > 항상 친절한 답변 감사드립니다. 아래식을 데이타2에 적용하게 부탁드립니다 Input:length(12); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0), Text1(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 { 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) +NewLine+"진폭"+NumToStr((고점[1,1]-저점[1,1]),2)); Text_SetStyle(Text1, 2, 1); } } If 처리구분 == "저점처리" Then { 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) +NewLine+"진폭"+NumToStr((고점[1,1]-저점[1,1]),2)); Text_SetStyle(Text1, 2, 0); } } TL_SetSize(TL1,2); TL_SetColor(TL1,BLACK);