커뮤니티

문의 드립니다.

프로필 이미지
태양같이
2019-09-20 10:19:06
216
글번호 132103
답변완료
안녕하세요~ 지난 번 작성해주신 지표식 관련해 재문의 드립니다. 맨 아래 수식은 지난 번 작성해주신 수식입니다. 먼저.. 수식 중에 아래 (80000);; <= 이 부분이 오타 아닌지요..? 1) 아래 지표식의 경우 StartnDay, EndnDay 그리고 StartnTime, EndnTime 으로 된 것을.. 년월일과 시간을 변수 조정이 가능하게 수식 수정을 재 부탁드립니다. input: p(1); input : Startdate(20190000),StartnTime(080000); input : Enddate(20190000),EndnTime(080000); 2) 그리고 현재 아래의 수식을 적용할 때 오일의 경우 전월 LTD이후 당월 LTD 당일까지 날짜를 입력하면 지표가 왜곡됩니다. 이번 월물 오일의 경우 10월물을 지표로 표현하기 위해 전월물 LTD 다음 거래일인 8월21일과 당월물 LTD인 9월20을 변수에 StartnDay(21), EndnDay(20)입력하면 지표가 7월22일부터 오늘 9월 19일 현재까지 이어져서 표현이 됩니다. StartnDay(20), EndnDay(20)로 적으면 지표가 캔들을 벗어나 버리고요.. 골드의 경우는 전월물 FND 다음 거래일부터 당월물 FND일을 입력하면 정상 표현되고요.. 오일의 경우 제가 날짜를 잘못 입력한 것인지요..? 조언과 수식 검토부탁드립니다. input: p(1); input : StartnDay(10),StartnTime(80000); input : EndnDay(20),EndnTime(80000);; var: nday(0),month(0),HH(0),LL(0),RR(0); var : Tcond(false); month = int(sdate/100)-int(sdate/10000)*100; nday = sdate%100; if bdate != bdate[1] Then { Condition1 = false; Condition2 = false; } if (month != month[1] and nday >= StartnDay) or (month == month[1] and nday >= StartnDay and nday[1] < StartnDay) then { Condition1 = true; } if Condition1 == true and ((sdate != sdate[1] and stime >= StartnTime) or (sdate == sdate[1] and stime >= StartnTime and stime[1] < StartnTime)) Then { Tcond = true; HH = H; LL = L; } if (month != month[1] and nday >= EndnDay) or (month == month[1] and nday >= EndnDay and nday[1] < EndnDay) then { Condition2 = true; } if Condition2 == true and ((sdate != sdate[1] and stime >= EndnTime) or (sdate == sdate[1] and stime >= EndnTime and stime[1] < EndnTime)) Then { Tcond = false; } if Tcond == true then { if H > HH Then HH = H; if L < Ll Then LL = L; RR=HH-LL; } if HH > 0 and LL > 0 then { if P == 1 Then { plot1(HH,"근월물최고가"); plot2(HH,"근월물최저가"); } Else { plot1(HH,"근월물최고가"); plot2(LL,"근월물최저가"); } } 3) 아래 수식의 경우 입력한 마지막 일자는 지표 표현이 안 됩니다. 예를 들어 국선의 경우 이번 만기일이 11일이었는데요.. 11일을 입력해도 10일까지만 표현이 됩니다. 검토 부탁드립니다. input: p(1); input : startdate(20190911),enddate(20191010); var: HH(0),LL(0),RR(0); var : Tcond(false); if sdate != sdate[1] and sdate == startdate then { Tcond = True; HH=H; LL=L; } if sdate != sdate[1] and sdate == enddate then Tcond = false; if Tcond == true then { if H > HH Then HH = H; if L < Ll Then LL = L; RR=HH-LL; if P ==1 Then 매번 큰 도움을 받고 있습니다. 깊이 감사드립니다.
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-09-20 13:24:38

안녕하세요 예스스탁입니다. ;;는 하나 삭제하시면 됩니다. 그대로 두셔도 무방합니다. 1 input: p(1); input : Startdate(20190911),StartnTime(080000); input : Enddate(20191010),EndnTime(080000); var: HH(0),LL(0),RR(0); var : Tcond(false); if sdate != sdate[1] Then { Condition1 = false; if sdate >= startdate and sdate[1] < startdate then { Condition1 = true; } Condition2 = false; if sdate >= Enddate and sdate[1] < Enddate then { Condition2 = true; } } if Condition1 == true and ((sdate != sdate[1] and stime >= StartnTime) or (sdate == sdate[1] and stime >= StartnTime and stime[1] < StartnTime)) Then { Tcond = true; HH = H; LL = L; } if Condition2 == true and ((sdate != sdate[1] and stime >= EndnTime) or (sdate == sdate[1] and stime >= EndnTime and stime[1] < EndnTime)) Then { Tcond = false; } if Tcond == true then { if H > HH Then HH = H; if L < Ll Then LL = L; RR=HH-LL; } if HH > 0 and LL > 0 then { if P == 1 Then { plot1(HH,"근월물최고가"); plot2(HH,"근월물최저가"); } Else { plot1(HH,"근월물최고가"); plot2(LL,"근월물최저가"); } } 2 수식이 정상적으로 지정한 21일의 지정한 시간을 기준으로 초기화가 되고 있습니다. P를 0으로 셋팅해 최고가와 최저가를 동시에 그려보시기 바랍니다. 최고가만 표시하면 해당봉이 가격이 높아 이전구간과 연결되어 단순히 가격이 상승한것으로만 보입니다. 수식에 지정한 시작일자와 시작시간 봉에 붉은 수직선 지정한 종료일자와 종료시간 봉에 파란 수직선이 그려지게 추가해 드립니다. input: p(1); input : StartnDay(10),StartnTime(80000); input : EndnDay(20),EndnTime(80000);; var: nday(0),month(0),HH(0),LL(0),RR(0); var : Tcond(false),TL(0); month = int(sdate/100)-int(sdate/10000)*100; nday = sdate%100; if bdate != bdate[1] Then { Condition1 = false; Condition2 = false; } if (month != month[1] and nday >= StartnDay) or (month == month[1] and nday >= StartnDay and nday[1] < StartnDay) then { Condition1 = true; } if Condition1 == true and ((sdate != sdate[1] and stime >= StartnTime) or (sdate == sdate[1] and stime >= StartnTime and stime[1] < StartnTime)) Then { Tcond = true; HH = H; LL = L; TL = TL_new(sdate,stime,9999999,sdate,stime,0); TL_setColor(TL,RED); } if (month != month[1] and nday >= EndnDay) or (month == month[1] and nday >= EndnDay and nday[1] < EndnDay) then { Condition2 = true; } if Condition2 == true and ((sdate != sdate[1] and stime >= EndnTime) or (sdate == sdate[1] and stime >= EndnTime and stime[1] < EndnTime)) Then { Tcond = false; TL = TL_new(sdate,stime,9999999,sdate,stime,0); TL_setColor(TL,BLUE); } if Tcond == true then { if H > HH Then HH = H; if L < Ll Then LL = L; RR=HH-LL; } if HH > 0 and LL > 0 then { if P == 1 Then { plot1(HH,"근월물최고가"); plot2(HH,"근월물최저가"); } Else { plot1(HH,"근월물최고가"); plot2(LL,"근월물최저가"); } } 3 enddate가 끝날짜입니다. 전일이 enddate일때 종료되게 수정해 드립니다. input: p(1); input : startdate(20190911),enddate(20191010); var: HH(0),LL(0),RR(0); var : Tcond(false); if sdate != sdate[1] and sdate == startdate then { Tcond = True; HH=H; LL=L; } if sdate != sdate[1] and sdate[1] == enddate then Tcond = false; 즐거운 하루되세요 > 태양같이 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요~ 지난 번 작성해주신 지표식 관련해 재문의 드립니다. 맨 아래 수식은 지난 번 작성해주신 수식입니다. 먼저.. 수식 중에 아래 (80000);; <= 이 부분이 오타 아닌지요..? 1) 아래 지표식의 경우 StartnDay, EndnDay 그리고 StartnTime, EndnTime 으로 된 것을.. 년월일과 시간을 변수 조정이 가능하게 수식 수정을 재 부탁드립니다. input: p(1); input : Startdate(20190000),StartnTime(080000); input : Enddate(20190000),EndnTime(080000); 2) 그리고 현재 아래의 수식을 적용할 때 오일의 경우 전월 LTD이후 당월 LTD 당일까지 날짜를 입력하면 지표가 왜곡됩니다. 이번 월물 오일의 경우 10월물을 지표로 표현하기 위해 전월물 LTD 다음 거래일인 8월21일과 당월물 LTD인 9월20을 변수에 StartnDay(21), EndnDay(20)입력하면 지표가 7월22일부터 오늘 9월 19일 현재까지 이어져서 표현이 됩니다. StartnDay(20), EndnDay(20)로 적으면 지표가 캔들을 벗어나 버리고요.. 골드의 경우는 전월물 FND 다음 거래일부터 당월물 FND일을 입력하면 정상 표현되고요.. 오일의 경우 제가 날짜를 잘못 입력한 것인지요..? 조언과 수식 검토부탁드립니다. input: p(1); input : StartnDay(10),StartnTime(80000); input : EndnDay(20),EndnTime(80000);; var: nday(0),month(0),HH(0),LL(0),RR(0); var : Tcond(false); month = int(sdate/100)-int(sdate/10000)*100; nday = sdate%100; if bdate != bdate[1] Then { Condition1 = false; Condition2 = false; } if (month != month[1] and nday >= StartnDay) or (month == month[1] and nday >= StartnDay and nday[1] < StartnDay) then { Condition1 = true; } if Condition1 == true and ((sdate != sdate[1] and stime >= StartnTime) or (sdate == sdate[1] and stime >= StartnTime and stime[1] < StartnTime)) Then { Tcond = true; HH = H; LL = L; } if (month != month[1] and nday >= EndnDay) or (month == month[1] and nday >= EndnDay and nday[1] < EndnDay) then { Condition2 = true; } if Condition2 == true and ((sdate != sdate[1] and stime >= EndnTime) or (sdate == sdate[1] and stime >= EndnTime and stime[1] < EndnTime)) Then { Tcond = false; } if Tcond == true then { if H > HH Then HH = H; if L < Ll Then LL = L; RR=HH-LL; } if HH > 0 and LL > 0 then { if P == 1 Then { plot1(HH,"근월물최고가"); plot2(HH,"근월물최저가"); } Else { plot1(HH,"근월물최고가"); plot2(LL,"근월물최저가"); } } 3) 아래 수식의 경우 입력한 마지막 일자는 지표 표현이 안 됩니다. 예를 들어 국선의 경우 이번 만기일이 11일이었는데요.. 11일을 입력해도 10일까지만 표현이 됩니다. 검토 부탁드립니다. input: p(1); input : startdate(20190911),enddate(20191010); var: HH(0),LL(0),RR(0); var : Tcond(false); if sdate != sdate[1] and sdate == startdate then { Tcond = True; HH=H; LL=L; } if sdate != sdate[1] and sdate == enddate then Tcond = false; if Tcond == true then { if H > HH Then HH = H; if L < Ll Then LL = L; RR=HH-LL; if P ==1 Then 매번 큰 도움을 받고 있습니다. 깊이 감사드립니다.