커뮤니티

의뢰드립니다

프로필 이미지
qha71
2019-01-06 02:30:57
222
글번호 124997
답변완료
당일 고점과 저점을 생성하는 피보나치 수식입니다. 수열값과 가격이 자동 표시되도록 보충해 주시길 바랍니다. Input:inDate(20130415); Var:j(0),date11(0),date12(0),time11(0),time12(0),TL1(0), date21(0),date22(0),time21(0),time22(0), hiVal(0),loVal(0),hiBar(0),loBar(0); Array:r[7](0),fr[7](0),TL2[7](0); r[0] = 0; r[1] = 0.236; r[2] = 0.382; r[3] = 0.50; r[4] = 0.618; r[5] = 0.764; r[6] = 1; if DayClose(1) > DayHigh(0) then { hiVal = DayClose(1); hiBar = DayIndex + 1; } else { hiVal = DayHigh(0); hiBar = _DayHighBar(0); //사용자함수 코너에서 다운받으세요 http://yahoosir.blog.me/150166245148 } if DayClose(1) < DayLow(0) then { loVal = DayClose(1); loBar = DayIndex + 1; } else { loVal = DayLow(0); loBar = _DayLowBar(0); //사용자함수 코너에서 다운받으세요 http://yahoosir.blog.me/150166245230 } if (Date == CurrentDate and inDate == 0) || Date == inDate then { if hiBar > loBar then { date11 = date[hiBar]; time11 = stime[hiBar]; date12 = date[loBar]; time12 = stime[loBar]; TL_Delete(TL1); TL1 = TL_New(date11,time11,hiVal,date12,time12,loVal); date21 = date[hiBar]; time21 = stime[hiBar]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = hiVal - ((hiVal - loVal) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } else { date11 = date[loBar]; time11 = stime[loBar]; date12 = date[hiBar]; time12 = stime[hiBar]; TL_Delete(TL1); TL1 = TL_New(date11,time11,loVal,date12,time12,hiVal); date21 = date[loBar]; time21 = stime[loBar]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = loVal + ((hiVal - loVal) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } } TL_SetSize(TL1,1); ---------------------------------------------------------------------------- 아래 수식은 파동에 따른 피보나치 입니다. 파동선을 노랑색으로 바꿔주시고 파동이 끝나고 시작되는 선에 가격이 표시되도록 하고싶습니다. 또 피보나치 선에 수식과 가격이 나타나도록 부탁드립니다. Input:chRate(1), inDate(20130415); Var:j(0),upTr(100),dnTr(-100),upRate(0),dnRate(0),trnd(0),trnd1(0), date11(0),date12(0),time11(0),time12(0),TL1(0), date21(0),date22(0),time21(0),time22(0); Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0); Array:r[7](0),fr[7](0),TL2[7](0); r[0] = 0; r[1] = 0.236; r[2] = 0.382; r[3] = 0.50; r[4] = 0.618; r[5] = 0.764; r[6] = 1; upRate = 1 + (chRate/100); dnRate = 1 - (chRate/100); for j = 1 to 9 { loBar[j] = loBar[j] + 1; hiBar[j] = hiBar[j] + 1; } if hiVal[0] <= H or hiVal[0] == 0 then { hiVal[0] = H; hiBar[0] = 0; } else { hiBar[0] = hiBar[0] + 1; } if loVal[0] >= L or loVal[0] == 0 then { loVal[0] = L; loBar[0] = 0; } else { loBar[0] = loBar[0] + 1; } if trnd != dnTr && hiVal[0] > H && hiVal[0] * dnRate > L then trnd = dnTr; else if trnd != upTr && loVal[0] < L && loVal[0] * upRate < H then trnd = upTr; if trnd[1] == upTr and trnd == dnTr then { for j = 8 downto 1 { hiVal[j+1] = hiVal[j]; hiBar[j+1] = hiBar[j]; } hiVal[1] = hiVal[0]; hiBar[1] = hiBar[0]; hiVal[0] = H; hiBar[0] = 0; loVal[0] = L; loBar[0] = 0; date11 = date[loBar[1]]; time11 = stime[loBar[1]]; Value11 = loVal[1]; date12 = date[hiBar[1]]; time12 = stime[hiBar[1]]; Value12 = hiVal[1]; TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); } if trnd[1] == dnTr and trnd == dnTr and hiVal[1] < hiVal[0] and hiVal[0] * dnRate > L then { hiVal[1] = hiVal[0]; hiBar[1] = hiBar[0]; hiVal[0] = H; hiBar[0] = 0; loVal[0] = L; loBar[0] = 0; date12 = date[hiBar[1]]; time12 = stime[hiBar[1]]; Value12 = hiVal[1]; TL_SetEnd(TL1, date12,time12,Value12); } if trnd[1] == dnTr and trnd == upTr then { for j = 8 downto 1 { loVal[j+1] = loVal[j]; loBar[j+1] = loBar[j]; } loVal[1] = loVal[0]; loBar[1] = loBar[0]; loVal[0] = L; loBar[0] = 0; hiVal[0] = H; hiBar[0] = 0; date11 = date[hiBar[1]]; time11 = stime[hiBar[1]]; Value11 = hiVal[1]; date12 = date[loBar[1]]; time12 = stime[loBar[1]]; Value12 = loVal[1]; TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); } if trnd[1] == upTr and trnd == upTr and loVal[1] > loVal[0] and loVal[0] * upRate < H then { loVal[1] = loVal[0]; loBar[1] = loBar[0]; loVal[0] = L; loBar[0] = 0; hiVal[0] = H; hiBar[0] = 0; date12 = date[loBar[1]]; time12 = stime[loBar[1]]; Value12 = loVal[1]; TL_SetEnd(TL1, date12,time12,Value12); } if (Date == CurrentDate and inDate == 0) || Date == inDate then { trnd1 = trnd; if trnd1 == upTr then { date21 = date[hiBar[1]]; time21 = stime[hiBar[1]]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = hiVal[1] - ((hiVal[1] - loVal[1]) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } else { date21 = date[loBar[1]]; time21 = stime[loBar[1]]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = loVal[1] + ((hiVal[1] - loVal[1]) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } } TL_SetSize(TL1,1); ----------------------------------------------------------------------------- 시스템수식 의뢰드립니다 국선 데이, 추세추종형> 1. 5분차트에서 bids (매수잔량) 의 13분 이평선과 asks(매도잔량) 의 13분 이평선의 차이가 d 보다 클때, 매수 (d: 국선 1000) 2. bids 13분 이평선과 asks 13분 이평선 차이가 -d 보다 작을때 매도 (d: 국선 1000) 3. 매수한 것이 2번의 조건이 되면, 손절 / 매도한 것이 1번의 조건이 되면, 손절 4. 손절되지 않으면 장 마감 10분전 청산 5. 하루 1회 이하 진입
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-01-07 11:27:13

안녕하세요 예스스탁입니다. 1 60737번 문의에 비슷한 내용에 대해 텍스트 출력 내용 추가해 드린 내용이 있습니다. 해당 수식 참고하셔서 수정보완하시기 바랍니다. 2 수식하단에 TL_setcolor로 색 지정하게 추가해 드립니다. 텍스트는 이전 문의에 대한 답변 참고하시기 바랍니다. Input:chRate(1), inDate(20130415); Var:j(0),upTr(100),dnTr(-100),upRate(0),dnRate(0),trnd(0),trnd1(0), date11(0),date12(0),time11(0),time12(0),TL1(0), date21(0),date22(0),time21(0),time22(0); Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0); Array:r[7](0),fr[7](0),TL2[7](0); r[0] = 0; r[1] = 0.236; r[2] = 0.382; r[3] = 0.50; r[4] = 0.618; r[5] = 0.764; r[6] = 1; upRate = 1 + (chRate/100); dnRate = 1 - (chRate/100); for j = 1 to 9 { loBar[j] = loBar[j] + 1; hiBar[j] = hiBar[j] + 1; } if hiVal[0] <= H or hiVal[0] == 0 then { hiVal[0] = H; hiBar[0] = 0; } else { hiBar[0] = hiBar[0] + 1; } if loVal[0] >= L or loVal[0] == 0 then { loVal[0] = L; loBar[0] = 0; } else { loBar[0] = loBar[0] + 1; } if trnd != dnTr && hiVal[0] > H && hiVal[0] * dnRate > L then trnd = dnTr; else if trnd != upTr && loVal[0] < L && loVal[0] * upRate < H then trnd = upTr; if trnd[1] == upTr and trnd == dnTr then { for j = 8 downto 1 { hiVal[j+1] = hiVal[j]; hiBar[j+1] = hiBar[j]; } hiVal[1] = hiVal[0]; hiBar[1] = hiBar[0]; hiVal[0] = H; hiBar[0] = 0; loVal[0] = L; loBar[0] = 0; date11 = date[loBar[1]]; time11 = stime[loBar[1]]; Value11 = loVal[1]; date12 = date[hiBar[1]]; time12 = stime[hiBar[1]]; Value12 = hiVal[1]; TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); } if trnd[1] == dnTr and trnd == dnTr and hiVal[1] < hiVal[0] and hiVal[0] * dnRate > L then { hiVal[1] = hiVal[0]; hiBar[1] = hiBar[0]; hiVal[0] = H; hiBar[0] = 0; loVal[0] = L; loBar[0] = 0; date12 = date[hiBar[1]]; time12 = stime[hiBar[1]]; Value12 = hiVal[1]; TL_SetEnd(TL1, date12,time12,Value12); } if trnd[1] == dnTr and trnd == upTr then { for j = 8 downto 1 { loVal[j+1] = loVal[j]; loBar[j+1] = loBar[j]; } loVal[1] = loVal[0]; loBar[1] = loBar[0]; loVal[0] = L; loBar[0] = 0; hiVal[0] = H; hiBar[0] = 0; date11 = date[hiBar[1]]; time11 = stime[hiBar[1]]; Value11 = hiVal[1]; date12 = date[loBar[1]]; time12 = stime[loBar[1]]; Value12 = loVal[1]; TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); } if trnd[1] == upTr and trnd == upTr and loVal[1] > loVal[0] and loVal[0] * upRate < H then { loVal[1] = loVal[0]; loBar[1] = loBar[0]; loVal[0] = L; loBar[0] = 0; hiVal[0] = H; hiBar[0] = 0; date12 = date[loBar[1]]; time12 = stime[loBar[1]]; Value12 = loVal[1]; TL_SetEnd(TL1, date12,time12,Value12); } if (Date == CurrentDate and inDate == 0) || Date == inDate then { trnd1 = trnd; if trnd1 == upTr then { date21 = date[hiBar[1]]; time21 = stime[hiBar[1]]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = hiVal[1] - ((hiVal[1] - loVal[1]) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } else { date21 = date[loBar[1]]; time21 = stime[loBar[1]]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = loVal[1] + ((hiVal[1] - loVal[1]) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } } TL_SetSize(TL1,1); TL_setcolor(TL1,YELLOW); 3 input : dd(1000); var : t1(0),entry(0); if bdate != bdate[1] Then t1 = TotalTrades[1]; if MarketPosition == 0 Then entry = TotalTrades-t1; Else entry = TotalTrades-t1+1; var1 = ma(bids,13); var2 = ma(asks,13); if entry < 1 then { if var1 >= var2+dd Then buy(); if var1 <= var2-dd Then sell(); } SetStopEndofday(152500); 즐거운 하루되세요 > qha71 님이 쓴 글입니다. > 제목 : 의뢰드립니다 > 당일 고점과 저점을 생성하는 피보나치 수식입니다. 수열값과 가격이 자동 표시되도록 보충해 주시길 바랍니다. Input:inDate(20130415); Var:j(0),date11(0),date12(0),time11(0),time12(0),TL1(0), date21(0),date22(0),time21(0),time22(0), hiVal(0),loVal(0),hiBar(0),loBar(0); Array:r[7](0),fr[7](0),TL2[7](0); r[0] = 0; r[1] = 0.236; r[2] = 0.382; r[3] = 0.50; r[4] = 0.618; r[5] = 0.764; r[6] = 1; if DayClose(1) > DayHigh(0) then { hiVal = DayClose(1); hiBar = DayIndex + 1; } else { hiVal = DayHigh(0); hiBar = _DayHighBar(0); //사용자함수 코너에서 다운받으세요 http://yahoosir.blog.me/150166245148 } if DayClose(1) < DayLow(0) then { loVal = DayClose(1); loBar = DayIndex + 1; } else { loVal = DayLow(0); loBar = _DayLowBar(0); //사용자함수 코너에서 다운받으세요 http://yahoosir.blog.me/150166245230 } if (Date == CurrentDate and inDate == 0) || Date == inDate then { if hiBar > loBar then { date11 = date[hiBar]; time11 = stime[hiBar]; date12 = date[loBar]; time12 = stime[loBar]; TL_Delete(TL1); TL1 = TL_New(date11,time11,hiVal,date12,time12,loVal); date21 = date[hiBar]; time21 = stime[hiBar]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = hiVal - ((hiVal - loVal) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } else { date11 = date[loBar]; time11 = stime[loBar]; date12 = date[hiBar]; time12 = stime[hiBar]; TL_Delete(TL1); TL1 = TL_New(date11,time11,loVal,date12,time12,hiVal); date21 = date[loBar]; time21 = stime[loBar]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = loVal + ((hiVal - loVal) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } } TL_SetSize(TL1,1); ---------------------------------------------------------------------------- 아래 수식은 파동에 따른 피보나치 입니다. 파동선을 노랑색으로 바꿔주시고 파동이 끝나고 시작되는 선에 가격이 표시되도록 하고싶습니다. 또 피보나치 선에 수식과 가격이 나타나도록 부탁드립니다. Input:chRate(1), inDate(20130415); Var:j(0),upTr(100),dnTr(-100),upRate(0),dnRate(0),trnd(0),trnd1(0), date11(0),date12(0),time11(0),time12(0),TL1(0), date21(0),date22(0),time21(0),time22(0); Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0); Array:r[7](0),fr[7](0),TL2[7](0); r[0] = 0; r[1] = 0.236; r[2] = 0.382; r[3] = 0.50; r[4] = 0.618; r[5] = 0.764; r[6] = 1; upRate = 1 + (chRate/100); dnRate = 1 - (chRate/100); for j = 1 to 9 { loBar[j] = loBar[j] + 1; hiBar[j] = hiBar[j] + 1; } if hiVal[0] <= H or hiVal[0] == 0 then { hiVal[0] = H; hiBar[0] = 0; } else { hiBar[0] = hiBar[0] + 1; } if loVal[0] >= L or loVal[0] == 0 then { loVal[0] = L; loBar[0] = 0; } else { loBar[0] = loBar[0] + 1; } if trnd != dnTr && hiVal[0] > H && hiVal[0] * dnRate > L then trnd = dnTr; else if trnd != upTr && loVal[0] < L && loVal[0] * upRate < H then trnd = upTr; if trnd[1] == upTr and trnd == dnTr then { for j = 8 downto 1 { hiVal[j+1] = hiVal[j]; hiBar[j+1] = hiBar[j]; } hiVal[1] = hiVal[0]; hiBar[1] = hiBar[0]; hiVal[0] = H; hiBar[0] = 0; loVal[0] = L; loBar[0] = 0; date11 = date[loBar[1]]; time11 = stime[loBar[1]]; Value11 = loVal[1]; date12 = date[hiBar[1]]; time12 = stime[hiBar[1]]; Value12 = hiVal[1]; TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); } if trnd[1] == dnTr and trnd == dnTr and hiVal[1] < hiVal[0] and hiVal[0] * dnRate > L then { hiVal[1] = hiVal[0]; hiBar[1] = hiBar[0]; hiVal[0] = H; hiBar[0] = 0; loVal[0] = L; loBar[0] = 0; date12 = date[hiBar[1]]; time12 = stime[hiBar[1]]; Value12 = hiVal[1]; TL_SetEnd(TL1, date12,time12,Value12); } if trnd[1] == dnTr and trnd == upTr then { for j = 8 downto 1 { loVal[j+1] = loVal[j]; loBar[j+1] = loBar[j]; } loVal[1] = loVal[0]; loBar[1] = loBar[0]; loVal[0] = L; loBar[0] = 0; hiVal[0] = H; hiBar[0] = 0; date11 = date[hiBar[1]]; time11 = stime[hiBar[1]]; Value11 = hiVal[1]; date12 = date[loBar[1]]; time12 = stime[loBar[1]]; Value12 = loVal[1]; TL1 = TL_New(date11,time11,Value11,date12,time12,Value12); } if trnd[1] == upTr and trnd == upTr and loVal[1] > loVal[0] and loVal[0] * upRate < H then { loVal[1] = loVal[0]; loBar[1] = loBar[0]; loVal[0] = L; loBar[0] = 0; hiVal[0] = H; hiBar[0] = 0; date12 = date[loBar[1]]; time12 = stime[loBar[1]]; Value12 = loVal[1]; TL_SetEnd(TL1, date12,time12,Value12); } if (Date == CurrentDate and inDate == 0) || Date == inDate then { trnd1 = trnd; if trnd1 == upTr then { date21 = date[hiBar[1]]; time21 = stime[hiBar[1]]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = hiVal[1] - ((hiVal[1] - loVal[1]) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } else { date21 = date[loBar[1]]; time21 = stime[loBar[1]]; date22 = date[0]; time22 = stime[0]; for j = 0 to 6 { fr[j] = loVal[1] + ((hiVal[1] - loVal[1]) * r[j]); TL_Delete(TL2[j]); TL2[j] = TL_New(date21,time21,fr[j],date22,time22,fr[j]); } } } TL_SetSize(TL1,1); ----------------------------------------------------------------------------- 시스템수식 의뢰드립니다 국선 데이, 추세추종형> 1. 5분차트에서 bids (매수잔량) 의 13분 이평선과 asks(매도잔량) 의 13분 이평선의 차이가 d 보다 클때, 매수 (d: 국선 1000) 2. bids 13분 이평선과 asks 13분 이평선 차이가 -d 보다 작을때 매도 (d: 국선 1000) 3. 매수한 것이 2번의 조건이 되면, 손절 / 매도한 것이 1번의 조건이 되면, 손절 4. 손절되지 않으면 장 마감 10분전 청산 5. 하루 1회 이하 진입