커뮤니티

수식부탁드림니다=================

프로필 이미지
leekss1
2017-03-16 05:54:43
138
글번호 107859
답변완료
추세선이그어질때 소리나게할순없나요?부탁드립니다 Input:length(12),X(2); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); // 봉이 새로 생겼으므로 봉개수 관리하는 변수들의 봉개수 값 1씩 증가 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; // 전환점구분 null값으로 초기화; turnPntBit = ""; // if 고점조건, 저점조건 동시 만족시 then // if 이전 고점,저점 범위를 모두 벗어났을 때 // 전환점구분 = 고저점; // else if 이전 고점을 갱신했다면 전환점구분 = 고점; // else if 이전 저점을 갱신했다면 전환점구분 = 저점; // else if 고점조건 만족하면 전환점구분 = 고점; // else if 저점조건 만족하면 전환점구분 = 저점; 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 전환점구분에 값이 있을 때만 then 아래 실행, 없으면 통과 If turnPntBit <> "" Then { // if 전환점구분이 고저점이면 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 신규 전환점구분이 현재(전환점배열 1번째)와 다르면 then // 배열값들을 이전값으로 Move; 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 전환점구분이 바뀌었거나 또는 // (전환점구분은 안바뀌었는데 // (이전 고점보다 높은 고점이 발생했거나 또는 // 이전 저점보다 낮은 저점이 발생했으면)) then If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { // 값 배열에는 고점 또는 저점을 대입; // 봉개수 배열에는 0값 대입; // 전환점 배열에 전환점구분값을 대입; valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; // if 이전봉대비 전환점구분이 바뀌었다면 추세선 새로 그리고; // else 전환점구분이 안바뀌었으면 값만 바뀐거므로 추세선 연장; 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#저점 tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2]-PriceScale*X,NumToStr(valArr[2],2)); if turnPntArr[1][0] == "Lo" then #고점 tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2]+PriceScale*X,NumToStr(valArr[2],2)); Text_SetStyle(tx,2,2); } Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,BLUE);
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-03-16 14:19:59

안녕하세요 예스스탁입니다. 소리출력함수는 사용자분이 지정한 경로의 wav파일이 구동됩니다. 아래는 예스트레이더에 기본으로 제공되는 wav파일을 지정했습니다. 원하시는 wav파일의 경로와 이름을 지정하시기 바랍니다. 게시판에서 식을 복사할 경우 경로명 중 ₩의 폰트가 깨질수 있으므로 ₩는 다시 타이핑하시기 바랍니다. Input:length(12),X(2); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); // 봉이 새로 생겼으므로 봉개수 관리하는 변수들의 봉개수 값 1씩 증가 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; // 전환점구분 null값으로 초기화; turnPntBit = ""; // if 고점조건, 저점조건 동시 만족시 then // if 이전 고점,저점 범위를 모두 벗어났을 때 // 전환점구분 = 고저점; // else if 이전 고점을 갱신했다면 전환점구분 = 고점; // else if 이전 저점을 갱신했다면 전환점구분 = 저점; // else if 고점조건 만족하면 전환점구분 = 고점; // else if 저점조건 만족하면 전환점구분 = 저점; 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 전환점구분에 값이 있을 때만 then 아래 실행, 없으면 통과 If turnPntBit <> "" Then { // if 전환점구분이 고저점이면 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 신규 전환점구분이 현재(전환점배열 1번째)와 다르면 then // 배열값들을 이전값으로 Move; 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 전환점구분이 바뀌었거나 또는 // (전환점구분은 안바뀌었는데 // (이전 고점보다 높은 고점이 발생했거나 또는 // 이전 저점보다 낮은 저점이 발생했으면)) then If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { // 값 배열에는 고점 또는 저점을 대입; // 봉개수 배열에는 0값 대입; // 전환점 배열에 전환점구분값을 대입; valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; // if 이전봉대비 전환점구분이 바뀌었다면 추세선 새로 그리고; // else 전환점구분이 안바뀌었으면 값만 바뀐거므로 추세선 연장; 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]); PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav"); #텍스트 출력 if turnPntArr[1][0] == "Hi" then#저점 tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2]-PriceScale*X,NumToStr(valArr[2],2)); if turnPntArr[1][0] == "Lo" then #고점 tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2]+PriceScale*X,NumToStr(valArr[2],2)); Text_SetStyle(tx,2,2); } Else { TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); PlaySound("C:₩예스트레이더₩data₩Sound₩alert.wav"); } } } TL_SetSize(TL1,1); TL_SetColor(TL1,BLUE); 즐거운 하루되세요 > leekss1 님이 쓴 글입니다. > 제목 : 수식부탁드림니다================= > 추세선이그어질때 소리나게할순없나요?부탁드립니다 Input:length(12),X(2); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),tx(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); // 봉이 새로 생겼으므로 봉개수 관리하는 변수들의 봉개수 값 1씩 증가 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; // 전환점구분 null값으로 초기화; turnPntBit = ""; // if 고점조건, 저점조건 동시 만족시 then // if 이전 고점,저점 범위를 모두 벗어났을 때 // 전환점구분 = 고저점; // else if 이전 고점을 갱신했다면 전환점구분 = 고점; // else if 이전 저점을 갱신했다면 전환점구분 = 저점; // else if 고점조건 만족하면 전환점구분 = 고점; // else if 저점조건 만족하면 전환점구분 = 저점; 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 전환점구분에 값이 있을 때만 then 아래 실행, 없으면 통과 If turnPntBit <> "" Then { // if 전환점구분이 고저점이면 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 신규 전환점구분이 현재(전환점배열 1번째)와 다르면 then // 배열값들을 이전값으로 Move; 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 전환점구분이 바뀌었거나 또는 // (전환점구분은 안바뀌었는데 // (이전 고점보다 높은 고점이 발생했거나 또는 // 이전 저점보다 낮은 저점이 발생했으면)) then If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { // 값 배열에는 고점 또는 저점을 대입; // 봉개수 배열에는 0값 대입; // 전환점 배열에 전환점구분값을 대입; valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; // if 이전봉대비 전환점구분이 바뀌었다면 추세선 새로 그리고; // else 전환점구분이 안바뀌었으면 값만 바뀐거므로 추세선 연장; 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#저점 tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2]-PriceScale*X,NumToStr(valArr[2],2)); if turnPntArr[1][0] == "Lo" then #고점 tx = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2]+PriceScale*X,NumToStr(valArr[2],2)); Text_SetStyle(tx,2,2); } Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,BLUE);