커뮤니티
부탁 드립니다.
2018-06-14 07:19:08
175
글번호 119707
1)수식을 함수로 변환시켜 실행 시키고 싶습니다.
예)TL1=함수명(length);
2)예를 들어
length(100)을 입력 하려면 Array:valArr[100](0)등과 같이 수정 해야 하는곳이 있는지요?
3)함수식을 배포버전으로 저장 하고 싶습니다.
미리 감사 드립니다.
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]);
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}}
TL_SetSize(TL1,0);
TL_SetColor(TL1,green);
답변 1
예스스탁 예스스탁 답변
2018-06-14 13:06:23
안녕하세요
예스스탁입니다.
1
해당 내용은 함수로 처리가 되지 않습니다
2
배열변수 arr는 이전 고저점갯수이므로 length와는 관계없습니다.
length는 최고가와 최저가를 계산할때 봉수 지정하는 변수입니다.
3
사용자함수는 배포버전 처리가 되지 않습니다.
지표,시스템,강조,검색식에 사용자함수가 있으면
배포버전으로 만들때 같이 포함되서 처리가 됩니다.
4
배포버전은 수식안에서 지정이 되지 않습니다.
예스랭귀지 편집기에서 직접 처리하셔야 합니다.
배포버전을 만들 수식을 여신 후에
예스랭귀지 상단의 메뉴 중 파일에서 배포버전 저장 선택해서
처리하시면 됩니다.
즐거운 하루되세요
> yes 님이 쓴 글입니다.
> 제목 : 부탁 드립니다.
> 1)수식을 함수로 변환시켜 실행 시키고 싶습니다.
예)TL1=함수명(length);
2)예를 들어
length(100)을 입력 하려면 Array:valArr[100](0)등과 같이 수정 해야 하는곳이 있는지요?
3)함수식을 배포버전으로 저장 하고 싶습니다.
미리 감사 드립니다.
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]);
Else
TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]);
}}
TL_SetSize(TL1,0);
TL_SetColor(TL1,green);
이전글