커뮤니티
안녕하세요?
2017-03-06 08:48:51
173
글번호 107476
1.되돌림선 추가 부탁드립니다.(그림1 참고)
0% , 23.6% , 38.2% , 50% , 61.8% , 76.4% ,100%
2. 테스트표시를 아래처럼 변경가능한가요?
ex) 1256.5 -> 565
앞의 두자리는 안나오게하고 뒤에3자리만 표시하고 싶습니다.
그리고 3틱 위,아래에 위치하게 해주세요.
다른상품도 변경할수 있게 간단한 설명 부탁드립니다.
감사합니다.
Input:length(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),
TL_Val1(0),TL_Val2(0);
Var:TL11(0),TL12(0),TL13(0),TL14(0),TL15(0),TL16(0),TL17(0),TL18(0),TL19(0),TL20(0);
Var:TL21(0),TL22(0),TL23(0),TL24(0),TL25(0),TL26(0),TL27(0),TL28(0),TL29(0),TL30(0),mav(0),T(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);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
#TL_SetSize(TL1,1);
TL_SetColor(TL1,YELLOW);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(고점[1,1],2)+" +"+NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 1);
Text_SetColor(Text1,RED);
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
{
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);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
#TL_SetSize(TL1,1);
TL_SetColor(TL1,YELLOW);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(저점[1,1],2)+" -"+NumToStr(abs(저점[1,1]-고점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
Text_SetColor(Text1,BLUE);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
mav = ma(C,20);
- 1. 2017-03-06_08;31;39.JPG (0.04 MB)
답변 1
예스스탁 예스스탁 답변
2017-03-06 17:21:13
안녕하세요
예스스탁입니다.
텍스트 출력부분은 사용자분이
해당 종목의 소숫점 자리에 따라 수식을 변경하셔야 합니다.
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1]+PriceScale*3,NumToStr((고점[1,1]*10)%1000,0)+" +"+NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0));
텍스트 출력부분의 위 수식을 보시면
NumToStr((고점[1,1]*10)%1000,0)
위 부분에서 소숫점 한자리는 고점[1,1]*10
소숫점 두자리 종목이면 고점[1,1]*100
으로 변경해주셔야 합니다.
Input:length(5);
input : Per1(0),Per2(23.6),Per3(38.2),Per4(50.0),Per5(61.8),Per6(76.4),Per7(100);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),처리구분(""),T(0),mav(0),diff(0);
var: TL2(0),TL3(0),TL4(0),TL5(0),TL6(0),TL7(0),TL8(0);
var: TL12(0),TL13(0),TL14(0),TL15(0),TL16(0),TL17(0),TL18(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);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL_Delete(TL8);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
TL_SetColor(TL1,YELLOW);
#TL_SetSize(TL1,1);
var1 = 고점[2,1];
var2 = 저점[1,1];
var3 = abs(var1-var2);
TL2 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per1/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per1/100));
TL3 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per2/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per2/100));
TL4 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per3/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per3/100));
TL5 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per4/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per4/100));
TL6 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per5/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per5/100));
TL7 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per6/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per6/100));
TL8 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per7/100),sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per7/100));
TL_SetColor(TL2,BLUE);
TL_SetColor(TL3,BLUE);
TL_SetColor(TL4,BLUE);
TL_SetColor(TL5,BLUE);
TL_SetColor(TL6,BLUE);
TL_SetColor(TL7,BLUE);
TL_SetColor(TL8,BLUE);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1]+PriceScale*3,NumToStr((고점[1,1]*10)%1000,0)+" +"+NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 1);
Text_SetColor(Text1,RED);
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);
TL_Delete(TL2);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL_Delete(TL8);
Text_Delete(Text1);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
#TL_SetSize(TL1,1);
TL_SetColor(TL1,YELLOW);
var1 = 고점[1,1];
var2 = 저점[2,1];
var3 = abs(var1-var2);
TL2 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per1/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per1/100));
TL3 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per2/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per2/100));
TL4 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per3/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per3/100));
TL5 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per4/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per4/100));
TL6 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per5/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per5/100));
TL7 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per6/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per6/100));
TL8 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var1-var3*(Per7/100),sdate[index-고점[1,2]],stime[index-고점[1,2]],var1-var3*(Per7/100));
TL_SetColor(TL2,red);
TL_SetColor(TL3,red);
TL_SetColor(TL4,red);
TL_SetColor(TL5,red);
TL_SetColor(TL6,red);
TL_SetColor(TL7,red);
TL_SetColor(TL8,red);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1]-PriceScale*3,NumToStr((저점[1,1]*10)%1000,0)+" -"+NumToStr(abs(저점[1,1]-고점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
Text_SetColor(Text1,BLUE);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
mav = ma(C,20);
if T == 1 Then{
TL_Delete(TL12);
TL_Delete(TL13);
TL_Delete(TL14);
TL_Delete(TL15);
TL_Delete(TL16);
TL_Delete(TL17);
TL_Delete(TL18);
var11 = 고점[1,1];
var12 = 저점[1,1];
var13 = abs(var11-var12);
TL12 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per1/100),sdate,stime,var11-var13*(Per1/100));
TL13 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per2/100),sdate,stime,var11-var13*(Per2/100));
TL14 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per3/100),sdate,stime,var11-var13*(Per3/100));
TL15 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per4/100),sdate,stime,var11-var13*(Per4/100));
TL16 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per5/100),sdate,stime,var11-var13*(Per5/100));
TL17 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per6/100),sdate,stime,var11-var13*(Per6/100));
TL18 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],var11-var13*(Per7/100),sdate,stime,var11-var13*(Per7/100));
TL_SetColor(TL12,red);
TL_SetColor(TL13,red);
TL_SetColor(TL14,red);
TL_SetColor(TL15,red);
TL_SetColor(TL16,red);
TL_SetColor(TL17,red);
TL_SetColor(TL18,red);
}
if T == -1 Then{
TL_Delete(TL12);
TL_Delete(TL13);
TL_Delete(TL14);
TL_Delete(TL15);
TL_Delete(TL16);
TL_Delete(TL17);
TL_Delete(TL18);
var11 = 고점[1,1];
var12 = 저점[1,1];
var13 = abs(var11-var12);
TL12 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per1/100),sdate,stime,var11-var13*(Per1/100));
TL13 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per2/100),sdate,stime,var11-var13*(Per2/100));
TL14 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per3/100),sdate,stime,var11-var13*(Per3/100));
TL15 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per4/100),sdate,stime,var11-var13*(Per4/100));
TL16 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per5/100),sdate,stime,var11-var13*(Per5/100));
TL17 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per6/100),sdate,stime,var11-var13*(Per6/100));
TL18 = TL_New(sdate[index-저점[1,2]],stime[index-저점[1,2]],var11-var13*(Per7/100),sdate,stime,var11-var13*(Per7/100));
TL_SetColor(TL12,red);
TL_SetColor(TL13,red);
TL_SetColor(TL14,red);
TL_SetColor(TL15,red);
TL_SetColor(TL16,red);
TL_SetColor(TL17,red);
TL_SetColor(TL18,red);
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 안녕하세요?
>
1.되돌림선 추가 부탁드립니다.(그림1 참고)
0% , 23.6% , 38.2% , 50% , 61.8% , 76.4% ,100%
2. 테스트표시를 아래처럼 변경가능한가요?
ex) 1256.5 -> 565
앞의 두자리는 안나오게하고 뒤에3자리만 표시하고 싶습니다.
그리고 3틱 위,아래에 위치하게 해주세요.
다른상품도 변경할수 있게 간단한 설명 부탁드립니다.
감사합니다.
Input:length(5);
Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),
TL_Val1(0),TL_Val2(0);
Var:TL11(0),TL12(0),TL13(0),TL14(0),TL15(0),TL16(0),TL17(0),TL18(0),TL19(0),TL20(0);
Var:TL21(0),TL22(0),TL23(0),TL24(0),TL25(0),TL26(0),TL27(0),TL28(0),TL29(0),TL30(0),mav(0),T(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);
If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then
TL_Delete(TL2);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]);
#TL_SetSize(TL1,1);
TL_SetColor(TL1,YELLOW);
Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(고점[1,1],2)+" +"+NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 1);
Text_SetColor(Text1,RED);
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
{
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);
If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then
TL_Delete(TL3);
}
TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]);
#TL_SetSize(TL1,1);
TL_SetColor(TL1,YELLOW);
Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(저점[1,1],2)+" -"+NumToStr(abs(저점[1,1]-고점[1,1])/PriceScale,0));
Text_SetStyle(Text1, 2, 0);
Text_SetColor(Text1,BLUE);
If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then
{
sBar = Index - 고점[2,2];
eBar = Index - 고점[1,2];
}
}
}
mav = ma(C,20);
다음글
이전글