커뮤니티

수정부탁드립니다

프로필 이미지
오동도물개
2015-12-27 15:58:06
142
글번호 93795
답변완료
아래지표에서 N일전값이 만약 오늘이 월요일이면 전주 금요일것을 볼려면 N값을 3을 주어야 보여집니다. 그래서 부탁인데 무조건 전일값을 볼려면 1을 주면 전일값을 볼수있도록 하여주십시요. 만약 5일전값을 볼려면 5을 주면 보이도록 말이죠.... 금년한해 감사드립니다. input : Length(10); //SwingHigh와 SwingLow의 기간값 input : LengthMult(2); //기본 기간값에 N배수(굵게 표시되는 중요 지지선과 저항선) input : NdayAgo(0); //N일전(0이면 당일, 1이면 전일, 2이면 전전일...) var : 저항선(0), 지지선(0), Rcount(0), Scount(0); var : 저항선2(0), 지지선2(0), Rcount2(0), Scount2(0); var : R1(0), R2(0), R3(0), R4(0), R5(0), R6(0), R7(0), R8(0), R9(0),R10(0), R11(0), R12(0), R13(0), R14(0), R15(0), R16(0), R17(0), R18(0), R19(0),R20(0); var : S1(0), S2(0), S3(0), S4(0), S5(0), S6(0), S7(0), S8(0), S9(0),S10(0), S11(0), S12(0), S13(0), S14(0), S15(0), S16(0), S17(0), S18(0), S19(0),S20(0); var : R81(0), R82(0), R83(0), R84(0), R85(0), S91(0), S92(0), S93(0), S94(0), S95(0); var1 = DateToJulian(currentdate); var2 = DateToJulian(date); if var2 >= var1-NdayAgo && dayindex >= Length-1 then { 저항선 = SwingHigh(1, H, Length, Length, Length*2+1); 지지선 = swingLow(1, L, Length, Length, Length*2+1); if 저항선 == -1 Then 저항선 = 저항선[1]; if 지지선 == -1 Then 지지선 = 지지선[1]; if 저항선 != 저항선[1] then Rcount = Rcount + 1; if 지지선 != 지지선[1] Then Scount = Scount + 1; if Rcount == 1 then R1 = 저항선; if Rcount == 2 Then R2 = 저항선; if Rcount == 3 then R3 = 저항선; if Rcount == 4 Then R4 = 저항선; if Rcount == 5 then R5 = 저항선; if Rcount == 6 Then R6 = 저항선; if Rcount == 7 then R7 = 저항선; if Rcount == 8 Then R8 = 저항선; if Rcount == 9 then R9 = 저항선; if Rcount == 10 Then R10 = 저항선; if Rcount == 11 then R11 = 저항선; if Rcount == 12 Then R12 = 저항선; if Rcount == 13 then R13 = 저항선; if Rcount == 14 Then R14 = 저항선; if Rcount == 15 then R15 = 저항선; if Rcount == 16 Then R16 = 저항선; if Rcount == 17 then R17 = 저항선; if Rcount == 18 Then R18 = 저항선; if Rcount == 19 then R19 = 저항선; if Rcount == 20 Then R20 = 저항선; if Scount == 1 then S1 = 지지선; if Scount == 2 Then S2 = 지지선; if Scount == 3 then S3 = 지지선; if Scount == 4 Then S4 = 지지선; if Scount == 5 then S5 = 지지선; if Scount == 6 Then S6 = 지지선; if Scount == 7 then S7 = 지지선; if Scount == 8 Then S8 = 지지선; if Scount == 9 then S9 = 지지선; if Scount == 10 Then S10 = 지지선; if Scount == 11 then S11 = 지지선; if Scount == 12 Then S12 = 지지선; if Scount == 13 then S13 = 지지선; if Scount == 14 Then S14 = 지지선; if Scount == 15 then S15 = 지지선; if Scount == 16 Then S16 = 지지선; if Scount == 17 then S17 = 지지선; if Scount == 18 Then S18 = 지지선; if Scount == 19 then S19 = 지지선; if Scount == 20 Then S20 = 지지선; if R1 > 0 then plot1(R1, "R1", RED); if R2 > 0 then plot2(R2, "R2", RED); if R3 > 0 then plot3(R3, "R3", RED); if R4 > 0 then plot4(R4, "R4", RED); if R5 > 0 then plot5(R5, "R5", RED); if R6 > 0 then plot6(R6, "R6", RED); if R7 > 0 then plot7(R7, "R7", RED); if R8 > 0 then plot8(R8, "R8", RED); if R9 > 0 then plot9(R9, "R9", RED); if R10 > 0 then plot10(R10, "R10", RED); if R11 > 0 then plot11(R11, "R11", RED); if R12 > 0 then plot12(R12, "R12", RED); if R13 > 0 then plot13(R13, "R13", RED); if R14 > 0 then plot14(R14, "R14", RED); if R15 > 0 then plot15(R15, "R15", RED); if R16 > 0 then plot16(R16, "R16", RED); if R17 > 0 then plot17(R17, "R17", RED); if R18 > 0 then plot18(R18, "R18", RED); if R19 > 0 then plot19(R19, "R19", RED); if R20 > 0 then plot20(R20, "R20", RED); if S1 > 0 then plot51(S1, "S1", BLUE); if S2 > 0 then plot52(S2, "S2", BLUE); if S3 > 0 then plot53(S3, "S3", BLUE); if S4 > 0 then plot54(S4, "S4", BLUE); if S5 > 0 then plot55(S5, "S5", BLUE); if S6 > 0 then plot56(S6, "S6", BLUE); if S7 > 0 then plot57(S7, "S7", BLUE); if S8 > 0 then plot58(S8, "S8", BLUE); if S9 > 0 then plot59(S9, "S9", BLUE); if S10 > 0 then plot60(S10, "S10", BLUE); if S11 > 0 then plot61(S11, "S11", BLUE); if S12 > 0 then plot62(S12, "S12", BLUE); if S13 > 0 then plot63(S13, "S13", BLUE); if S14 > 0 then plot64(S14, "S14", BLUE); if S15 > 0 then plot65(S15, "S15", BLUE); if S16 > 0 then plot66(S16, "S16", BLUE); if S17 > 0 then plot67(S17, "S17", BLUE); if S18 > 0 then plot68(S18, "S18", BLUE); if S19 > 0 then plot69(S19, "S19", BLUE); if S20 > 0 then plot70(S20, "S20", BLUE); } # 중요 지지저항선은 굵게 표시 if var2 >= var1-NdayAgo && dayindex >= Length*LengthMult-1 then { 저항선2 = SwingHigh(1, H, Length*LengthMult, Length*LengthMult, Length*LengthMult*2+1); 지지선2 = swingLow(1, L, Length*LengthMult, Length*LengthMult, Length*LengthMult*2+1); if 저항선2 == -1 Then 저항선2 = 저항선2[1]; if 지지선2 == -1 Then 지지선2 = 지지선2[1]; if 저항선2 != 저항선2[1] then Rcount2 = Rcount2 + 1; if 지지선2 != 지지선2[1] Then Scount2 = Scount2 + 1; if Rcount2 == 1 then R81 = 저항선2; if Rcount2 == 2 Then R82 = 저항선2; if Rcount2 == 3 then R83 = 저항선2; if Rcount2 == 4 Then R84 = 저항선2; if Rcount2 == 5 then R85 = 저항선2; if Scount2 == 1 then S91 = 지지선2; if Scount2 == 2 Then S92 = 지지선2; if Scount2 == 3 then S93 = 지지선2; if Scount2 == 4 Then S94 = 지지선2; if Scount2 == 5 then S95 = 지지선2; //아래 plot들은 속성창에서 굵게 표시해야 함 if R81 > 0 then plot81(R81, "R81", RED); if R82 > 0 then plot82(R82, "R82", RED); if R83 > 0 then plot83(R83, "R83", RED); if R84 > 0 then plot84(R84, "R84", RED); if R85 > 0 then plot85(R85, "R85", RED); if S91 > 0 then plot91(S91, "S91", BLUE); if S92 > 0 then plot92(S92, "S92", BLUE); if S93 > 0 then plot93(S93, "S93", BLUE); if S94 > 0 then plot94(S94, "S94", BLUE); if S95 > 0 then plot95(S95, "S95", BLUE); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-12-28 15:56:09

안녕하세요 예스스탁입니다. 문의하신 내용 가능하지 않습니다. 해당식이 당일기준으로 N일전부터 값을 계산하기 위한 내용인데 차트의 데이터로 N일전은 당일차트까지 계산해 와야 알수 있는데 당일까지오면 이전일로 돌아갈수 없어 수식자체가 구현되지 않아 편법으로 컴퓨터의 날짜와 차트의 날짜를 비교하게 작성된 식입니다. 달력의 날자로 N일전을 지정할수 밖에 없습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 오동도물개 님이 쓴 글입니다. > 제목 : 수정부탁드립니다 > 아래지표에서 N일전값이 만약 오늘이 월요일이면 전주 금요일것을 볼려면 N값을 3을 주어야 보여집니다. 그래서 부탁인데 무조건 전일값을 볼려면 1을 주면 전일값을 볼수있도록 하여주십시요. 만약 5일전값을 볼려면 5을 주면 보이도록 말이죠.... 금년한해 감사드립니다. input : Length(10); //SwingHigh와 SwingLow의 기간값 input : LengthMult(2); //기본 기간값에 N배수(굵게 표시되는 중요 지지선과 저항선) input : NdayAgo(0); //N일전(0이면 당일, 1이면 전일, 2이면 전전일...) var : 저항선(0), 지지선(0), Rcount(0), Scount(0); var : 저항선2(0), 지지선2(0), Rcount2(0), Scount2(0); var : R1(0), R2(0), R3(0), R4(0), R5(0), R6(0), R7(0), R8(0), R9(0),R10(0), R11(0), R12(0), R13(0), R14(0), R15(0), R16(0), R17(0), R18(0), R19(0),R20(0); var : S1(0), S2(0), S3(0), S4(0), S5(0), S6(0), S7(0), S8(0), S9(0),S10(0), S11(0), S12(0), S13(0), S14(0), S15(0), S16(0), S17(0), S18(0), S19(0),S20(0); var : R81(0), R82(0), R83(0), R84(0), R85(0), S91(0), S92(0), S93(0), S94(0), S95(0); var1 = DateToJulian(currentdate); var2 = DateToJulian(date); if var2 >= var1-NdayAgo && dayindex >= Length-1 then { 저항선 = SwingHigh(1, H, Length, Length, Length*2+1); 지지선 = swingLow(1, L, Length, Length, Length*2+1); if 저항선 == -1 Then 저항선 = 저항선[1]; if 지지선 == -1 Then 지지선 = 지지선[1]; if 저항선 != 저항선[1] then Rcount = Rcount + 1; if 지지선 != 지지선[1] Then Scount = Scount + 1; if Rcount == 1 then R1 = 저항선; if Rcount == 2 Then R2 = 저항선; if Rcount == 3 then R3 = 저항선; if Rcount == 4 Then R4 = 저항선; if Rcount == 5 then R5 = 저항선; if Rcount == 6 Then R6 = 저항선; if Rcount == 7 then R7 = 저항선; if Rcount == 8 Then R8 = 저항선; if Rcount == 9 then R9 = 저항선; if Rcount == 10 Then R10 = 저항선; if Rcount == 11 then R11 = 저항선; if Rcount == 12 Then R12 = 저항선; if Rcount == 13 then R13 = 저항선; if Rcount == 14 Then R14 = 저항선; if Rcount == 15 then R15 = 저항선; if Rcount == 16 Then R16 = 저항선; if Rcount == 17 then R17 = 저항선; if Rcount == 18 Then R18 = 저항선; if Rcount == 19 then R19 = 저항선; if Rcount == 20 Then R20 = 저항선; if Scount == 1 then S1 = 지지선; if Scount == 2 Then S2 = 지지선; if Scount == 3 then S3 = 지지선; if Scount == 4 Then S4 = 지지선; if Scount == 5 then S5 = 지지선; if Scount == 6 Then S6 = 지지선; if Scount == 7 then S7 = 지지선; if Scount == 8 Then S8 = 지지선; if Scount == 9 then S9 = 지지선; if Scount == 10 Then S10 = 지지선; if Scount == 11 then S11 = 지지선; if Scount == 12 Then S12 = 지지선; if Scount == 13 then S13 = 지지선; if Scount == 14 Then S14 = 지지선; if Scount == 15 then S15 = 지지선; if Scount == 16 Then S16 = 지지선; if Scount == 17 then S17 = 지지선; if Scount == 18 Then S18 = 지지선; if Scount == 19 then S19 = 지지선; if Scount == 20 Then S20 = 지지선; if R1 > 0 then plot1(R1, "R1", RED); if R2 > 0 then plot2(R2, "R2", RED); if R3 > 0 then plot3(R3, "R3", RED); if R4 > 0 then plot4(R4, "R4", RED); if R5 > 0 then plot5(R5, "R5", RED); if R6 > 0 then plot6(R6, "R6", RED); if R7 > 0 then plot7(R7, "R7", RED); if R8 > 0 then plot8(R8, "R8", RED); if R9 > 0 then plot9(R9, "R9", RED); if R10 > 0 then plot10(R10, "R10", RED); if R11 > 0 then plot11(R11, "R11", RED); if R12 > 0 then plot12(R12, "R12", RED); if R13 > 0 then plot13(R13, "R13", RED); if R14 > 0 then plot14(R14, "R14", RED); if R15 > 0 then plot15(R15, "R15", RED); if R16 > 0 then plot16(R16, "R16", RED); if R17 > 0 then plot17(R17, "R17", RED); if R18 > 0 then plot18(R18, "R18", RED); if R19 > 0 then plot19(R19, "R19", RED); if R20 > 0 then plot20(R20, "R20", RED); if S1 > 0 then plot51(S1, "S1", BLUE); if S2 > 0 then plot52(S2, "S2", BLUE); if S3 > 0 then plot53(S3, "S3", BLUE); if S4 > 0 then plot54(S4, "S4", BLUE); if S5 > 0 then plot55(S5, "S5", BLUE); if S6 > 0 then plot56(S6, "S6", BLUE); if S7 > 0 then plot57(S7, "S7", BLUE); if S8 > 0 then plot58(S8, "S8", BLUE); if S9 > 0 then plot59(S9, "S9", BLUE); if S10 > 0 then plot60(S10, "S10", BLUE); if S11 > 0 then plot61(S11, "S11", BLUE); if S12 > 0 then plot62(S12, "S12", BLUE); if S13 > 0 then plot63(S13, "S13", BLUE); if S14 > 0 then plot64(S14, "S14", BLUE); if S15 > 0 then plot65(S15, "S15", BLUE); if S16 > 0 then plot66(S16, "S16", BLUE); if S17 > 0 then plot67(S17, "S17", BLUE); if S18 > 0 then plot68(S18, "S18", BLUE); if S19 > 0 then plot69(S19, "S19", BLUE); if S20 > 0 then plot70(S20, "S20", BLUE); } # 중요 지지저항선은 굵게 표시 if var2 >= var1-NdayAgo && dayindex >= Length*LengthMult-1 then { 저항선2 = SwingHigh(1, H, Length*LengthMult, Length*LengthMult, Length*LengthMult*2+1); 지지선2 = swingLow(1, L, Length*LengthMult, Length*LengthMult, Length*LengthMult*2+1); if 저항선2 == -1 Then 저항선2 = 저항선2[1]; if 지지선2 == -1 Then 지지선2 = 지지선2[1]; if 저항선2 != 저항선2[1] then Rcount2 = Rcount2 + 1; if 지지선2 != 지지선2[1] Then Scount2 = Scount2 + 1; if Rcount2 == 1 then R81 = 저항선2; if Rcount2 == 2 Then R82 = 저항선2; if Rcount2 == 3 then R83 = 저항선2; if Rcount2 == 4 Then R84 = 저항선2; if Rcount2 == 5 then R85 = 저항선2; if Scount2 == 1 then S91 = 지지선2; if Scount2 == 2 Then S92 = 지지선2; if Scount2 == 3 then S93 = 지지선2; if Scount2 == 4 Then S94 = 지지선2; if Scount2 == 5 then S95 = 지지선2; //아래 plot들은 속성창에서 굵게 표시해야 함 if R81 > 0 then plot81(R81, "R81", RED); if R82 > 0 then plot82(R82, "R82", RED); if R83 > 0 then plot83(R83, "R83", RED); if R84 > 0 then plot84(R84, "R84", RED); if R85 > 0 then plot85(R85, "R85", RED); if S91 > 0 then plot91(S91, "S91", BLUE); if S92 > 0 then plot92(S92, "S92", BLUE); if S93 > 0 then plot93(S93, "S93", BLUE); if S94 > 0 then plot94(S94, "S94", BLUE); if S95 > 0 then plot95(S95, "S95", BLUE); }