커뮤니티
Data2에 대한 식으로 변경 부탁
2016-12-22 10:08:52
145
글번호 105176
안녕하세요?
첨부식을 Data2에 대한 식으로 변경 부탁드립니다.
감사합니다.
- 1. 1일전지지저항선.yin (0.00 MB)
- 2. 당일지지저항선.yin (0.01 MB)
답변 1
예스스탁 예스스탁 답변
2016-12-22 14:17:31
안녕하세요
예스스탁입니다.
1.
# swingHigh와 swingLow를 이용한 장중 지지선과 저항선
input : Length(10); //SwingHigh와 SwingLow의 기간값
input : LengthMult(2); //기본 기간값에 N배수(굵게 표시되는 중요 지지선과 저항선)
input : NdayAgo(0); //N일전(0이면 당일, 1이면 전일, 2이면 전전일...)
var : 저항선(0,data2), 지지선(0,data2), Rcount(0,data2), Scount(0,data2);
var : 저항선2(0,data2), 지지선2(0,data2), Rcount2(0,data2), Scount2(0,data2);
var : R1(0,data2), R2(0,data2), R3(0,data2), R4(0,data2), R5(0,data2),
R6(0,data2), R7(0,data2), R8(0,data2), R9(0,data2),R10(0,data2),
R11(0,data2), R12(0,data2), R13(0,data2), R14(0,data2), R15(0,data2),
R16(0,data2), R17(0,data2), R18(0,data2), R19(0,data2),R20(0,data2);
var : S1(0,data2), S2(0,data2), S3(0,data2), S4(0,data2), S5(0,data2),
S6(0,data2), S7(0,data2), S8(0,data2), S9(0,data2),S10(0,data2),
S11(0,data2), S12(0,data2), S13(0,data2), S14(0,data2), S15(0,data2),
S16(0,data2), S17(0,data2), S18(0,data2), S19(0,data2),S20(0,data2);
var : R81(0,data2), R82(0,data2), R83(0,data2), R84(0,data2), R85(0,data2),
S91(0,data2), S92(0,data2), S93(0,data2), S94(0,data2), S95(0,data2);
var : V1(0,data2),V2(0,data2);
v1 = data2(DateToJulian(currentdate));
v2 = data2(DateToJulian(date));
if data2(v1-v2 == NdayAgo && dayindex >= Length-1)then {
저항선 = data2(SwingHigh(1, H, Length, Length, Length*2+1));
지지선 = data2(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", rgb(255,128,0));
if R2 > 0 then plot2(R2, "R2", rgb(255,128,0));
if R3 > 0 then plot3(R3, "R3", rgb(255,128,0));
if R4 > 0 then plot4(R4, "R4", rgb(255,128,0));
if R5 > 0 then plot5(R5, "R5", rgb(255,128,0));
if R6 > 0 then plot6(R6, "R6", rgb(255,128,0));
if R7 > 0 then plot7(R7, "R7", rgb(255,128,0));
if R8 > 0 then plot8(R8, "R8", rgb(255,128,0));
if R9 > 0 then plot9(R9, "R9", rgb(255,128,0));
if R10 > 0 then plot10(R10, "R10", rgb(255,128,0));
if R11 > 0 then plot11(R11, "R11", rgb(255,128,0));
if R12 > 0 then plot12(R12, "R12", rgb(255,128,0));
if R13 > 0 then plot13(R13, "R13", rgb(255,128,0));
if R14 > 0 then plot14(R14, "R14", rgb(255,128,0));
if R15 > 0 then plot15(R15, "R15", rgb(255,128,0));
if R16 > 0 then plot16(R16, "R16", rgb(255,128,0));
if R17 > 0 then plot17(R17, "R17", rgb(255,128,0));
if R18 > 0 then plot18(R18, "R18", rgb(255,128,0));
if R19 > 0 then plot19(R19, "R19", rgb(255,128,0));
if R20 > 0 then plot20(R20, "R20", rgb(255,128,0));
if S1 > 0 then plot51(S1, "S1", RGB(0,210,210));
if S2 > 0 then plot52(S2, "S2", RGB(0,210,210));
if S3 > 0 then plot53(S3, "S3", RGB(0,210,210));
if S4 > 0 then plot54(S4, "S4", RGB(0,210,210));
if S5 > 0 then plot55(S5, "S5", RGB(0,210,210));
if S6 > 0 then plot56(S6, "S6", RGB(0,210,210));
if S7 > 0 then plot57(S7, "S7", RGB(0,210,210));
if S8 > 0 then plot58(S8, "S8", RGB(0,210,210));
if S9 > 0 then plot59(S9, "S9", RGB(0,210,210));
if S10 > 0 then plot60(S10, "S10", RGB(0,210,210));
if S11 > 0 then plot61(S11, "S11", RGB(0,210,210));
if S12 > 0 then plot62(S12, "S12", RGB(0,210,210));
if S13 > 0 then plot63(S13, "S13", RGB(0,210,210));
if S14 > 0 then plot64(S14, "S14", RGB(0,210,210));
if S15 > 0 then plot65(S15, "S15", RGB(0,210,210));
if S16 > 0 then plot66(S16, "S16", RGB(0,210,210));
if S17 > 0 then plot67(S17, "S17", RGB(0,210,210));
if S18 > 0 then plot68(S18, "S18", RGB(0,210,210));
if S19 > 0 then plot69(S19, "S19", RGB(0,210,210));
if S20 > 0 then plot70(S20, "S20", RGB(0,210,210));
}
# 중요 지지저항선은 굵게 표시
if data2(v1-v2 == NdayAgo && dayindex >= Length*LengthMult-1) then {
저항선2 = data2(SwingHigh(1, H, Length*LengthMult, Length*LengthMult, Length*LengthMult*2+1));
지지선2 = data2(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", MAGENTA);
if R82 > 0 then plot82(R82, "R82", MAGENTA);
if R83 > 0 then plot83(R83, "R83", MAGENTA);
if R84 > 0 then plot84(R84, "R84", MAGENTA);
if R85 > 0 then plot85(R85, "R85", MAGENTA);
if S91 > 0 then plot91(S91, "S91", BLACK);
if S92 > 0 then plot92(S92, "S92", BLACK);
if S93 > 0 then plot93(S93, "S93", BLACK);
if S94 > 0 then plot94(S94, "S94", BLACK);
if S95 > 0 then plot95(S95, "S95", BLACK);
}
2
# swingHigh와 swingLow를 이용한 장중 지지선과 저항선
input : Length(10); //SwingHigh와 SwingLow의 기간값
input : LengthMult(2); //기본 기간값에 N배수(굵게 표시되는 중요 지지선과 저항선)
input : NdayAgo(1); //N일전(0이면 당일, 1이면 전일, 2이면 전전일...)날짜수 지정하실때 휴일포한해서 이전일수를 지정하셔야 합니다
var : 저항선(0,data2), 지지선(0,data2), Rcount(0,data2), Scount(0,data2);
var : 저항선2(0,data2), 지지선2(0,data2), Rcount2(0,data2), Scount2(0,data2);
var : R1(0,data2), R2(0,data2), R3(0,data2), R4(0,data2), R5(0,data2),
R6(0,data2), R7(0,data2), R8(0,data2), R9(0,data2),R10(0,data2),
R11(0,data2), R12(0,data2), R13(0,data2), R14(0,data2), R15(0,data2),
R16(0,data2), R17(0,data2), R18(0,data2), R19(0,data2),R20(0,data2);
var : S1(0,data2), S2(0,data2), S3(0,data2), S4(0,data2), S5(0,data2),
S6(0,data2), S7(0,data2), S8(0,data2), S9(0,data2),S10(0,data2),
S11(0,data2), S12(0,data2), S13(0,data2), S14(0,data2), S15(0,data2),
S16(0,data2), S17(0,data2), S18(0,data2), S19(0,data2),S20(0,data2);
var : R81(0,data2), R82(0,data2), R83(0,data2), R84(0,data2), R85(0,data2),
S91(0,data2), S92(0,data2), S93(0,data2), S94(0,data2), S95(0,data2);
var : V1(0,data2),V2(0,data2);
v1 = DateToJulian(currentdate);
v2 = DateToJulian(date);
# 중요 지지저항선은 굵게 표시
if data2(v2 >= v1-NdayAgo && dayindex >= Length*LengthMult-1) then {
저항선2 = data2(SwingHigh(1, H, Length*LengthMult, Length*LengthMult, Length*LengthMult*2+1));
지지선2 = data2(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", MAGENTA);
if R82 > 0 then plot82(R82, "R82", MAGENTA);
if R83 > 0 then plot83(R83, "R83", MAGENTA);
if R84 > 0 then plot84(R84, "R84", MAGENTA);
if R85 > 0 then plot85(R85, "R85", MAGENTA);
if S91 > 0 then plot91(S91, "S91", BLACK);
if S92 > 0 then plot92(S92, "S92", BLACK);
if S93 > 0 then plot93(S93, "S93", BLACK);
if S94 > 0 then plot94(S94, "S94", BLACK);
if S95 > 0 then plot95(S95, "S95", BLACK);
}
즐거운 하루되세요
> 매버릭 님이 쓴 글입니다.
> 제목 : Data2에 대한 식으로 변경 부탁
> 안녕하세요?
첨부식을 Data2에 대한 식으로 변경 부탁드립니다.
감사합니다.
다음글
이전글