커뮤니티

수정 부탁드립니다.

프로필 이미지
포보스
2022-09-28 09:57:40
907
글번호 162566
답변완료
안녕하세요? 다음 해선 순매수량에 당일만 표기하려 "if CurrentDate == sdate Then" 를 넣어도 잘 안되네요. 또 부탁드려봅니다. 오늘동 좋은하루 보내세요. 꾸뻑 var : sum(0),hh(0),ll(0); if Bdate != Bdate[1] Then sum = 0; if C > O Then sum = sum+v; if C < O Then sum = sum-v; if Bdate != Bdate[1] Then { hh = sum; ll = sum; } if sum > hh Then hh = sum; if sum < ll Then ll = sum; { Plot1(sum,"누적",IFf(sum > 0,RGB(255,0,0),RGB(0,0,255))); PlotBaseLine1(0); plot2(hh,"당일고점"); plot3(ll,"당일저점"); plot4(hh-(hh-ll)*0.236,"23.6%"); plot5(hh-(hh-ll)*0.382,"38.2%"); plot6(hh-(hh-ll)*0.500,"50.0%"); plot7(hh-(hh-ll)*0.618,"61.8%"); plot8(hh-(hh-ll)*0.764,"76.4%"); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-09-28 15:28:44

안녕하세요 예스스탁입니다. if CurrentDate == sdate Then 위 내용은 차트봉의 날짜와 컴퓨터의 날짜를 비교해서 당일을 체크하게 됩니다. 당일시작해서 당일종료되는 국내종목에만 맞게 되어 있고 주말에 적용되면 값이 출력되지 않습니다. 해외선물은 24시간 거대되고 거래일 변경이 0시가 아니므로 체크가 좀 어렵습니다. 아래식으로 적용해 보시기 바랍니다. 적용시점 현재시간(컴퓨터시간)으로 7시 전인지 후인지 판단해서 당일 파악하게 작성했습니다. var : sum(0),hh(0),ll(0); if Bdate != Bdate[1] Then { sum = 0; Condition1 = False; if CurrentTime >= 70000 and CurrentDate == Bdate Then Condition1 = true; if CurrentTime <= 70000 and DateToJulian(CurrentDate)-1 == DateToJulian(Bdate) Then Condition1 = true; } if C > O Then sum = sum+v; if C < O Then sum = sum-v; if Bdate != Bdate[1] Then { hh = sum; ll = sum; } if sum > hh Then hh = sum; if sum < ll Then ll = sum; if Condition1 == true Then { Plot1(sum,"누적",IFf(sum > 0,RGB(255,0,0),RGB(0,0,255))); PlotBaseLine1(0); plot2(hh,"당일고점"); plot3(ll,"당일저점"); plot4(hh-(hh-ll)*0.236,"23.6%"); plot5(hh-(hh-ll)*0.382,"38.2%"); plot6(hh-(hh-ll)*0.500,"50.0%"); plot7(hh-(hh-ll)*0.618,"61.8%"); plot8(hh-(hh-ll)*0.764,"76.4%"); } 즐거운 하루되세요 > 포보스 님이 쓴 글입니다. > 제목 : 수정 부탁드립니다. > 안녕하세요? 다음 해선 순매수량에 당일만 표기하려 "if CurrentDate == sdate Then" 를 넣어도 잘 안되네요. 또 부탁드려봅니다. 오늘동 좋은하루 보내세요. 꾸뻑 var : sum(0),hh(0),ll(0); if Bdate != Bdate[1] Then sum = 0; if C > O Then sum = sum+v; if C < O Then sum = sum-v; if Bdate != Bdate[1] Then { hh = sum; ll = sum; } if sum > hh Then hh = sum; if sum < ll Then ll = sum; { Plot1(sum,"누적",IFf(sum > 0,RGB(255,0,0),RGB(0,0,255))); PlotBaseLine1(0); plot2(hh,"당일고점"); plot3(ll,"당일저점"); plot4(hh-(hh-ll)*0.236,"23.6%"); plot5(hh-(hh-ll)*0.382,"38.2%"); plot6(hh-(hh-ll)*0.500,"50.0%"); plot7(hh-(hh-ll)*0.618,"61.8%"); plot8(hh-(hh-ll)*0.764,"76.4%"); }