커뮤니티
지표
2018-10-05 16:21:16
204
글번호 122481
아래지표에서 선이 상승이면 빨강 하락이면 파랑으로 표현하고 싶습니다.
Input:n(4), af(0.02), maxAF(0.2);
Var:j(0),k(0),x(0),z(0),value(0),SarUpC(0),SarDnC(0),SarUpBar(0),SarDnBar(0),SarUpVal(0),SarDnVal(0),
추세선(0),지지선(0),저항선(0);
Array:고[10](0),저[10](0),고Bar[10](0),저Bar[10](0);
value = Sar(af,maxAF);
for j = 1 to 9 {
저Bar[j] = 저Bar[j] + 1;
고Bar[j] = 고Bar[j] + 1;
}
SarUpBar = SarUpBar + 1;
SarDnBar = SarDnBar + 1;
if Highest(H,n)[n+1] <= H[n] and H[n] > Highest(H,n) then {
for j = 8 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
고[1] = H[n];
고Bar[1] = n;
if 저Bar[1] > 고Bar[2] then {
for j = 8 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
k = n + 1;
for j = n + 2 to 고Bar[2]-1 {
if L[k] > L[j] then k = j;
}
저[1] = L[k];
저Bar[1] = k;
}
}
if Lowest(L,n)[n+1] >= L[n] and L[n] < Lowest(L,n) then {
for j = 8 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
저[1] = L[n];
저Bar[1] = n;
if 고Bar[1] > 저Bar[2] then {
for j = 8 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
k = n + 1;
for j = n + 2 to 저Bar[2]-1 {
if H[k] < H[j] then k = j;
}
고[1] = H[k];
고Bar[1] = k;
}
}
if CrossUp(C,value) then {
SarUpC = C;
SarUpVal = (value[1] + value)/2;
SarUpBar = 0;
}
if CrossDown(C,value) then {
SarDnC = C;
SarDnVal = (value[1] + value)/2;
SarDnBar = 0;
}
추세선 = 0; 지지선 = 0; 저항선 = 0;
if C > value then {
for j = 9 downto 1 {
if SarUpBar <= 저Bar[j] then x = j;
if SarUpBar <= 고Bar[j] then z = j;
}
추세선 = (SarUpC - 저[x])/(저Bar[x] - SarUpBar) * 저Bar[x] + 저[x];
지지선 = (SarUpVal - 저[x])/(저Bar[x] - SarUpBar) * 저Bar[x] + 저[x];
저항선 = (SarUpVal - 저[x])/(저Bar[x] - SarUpBar) * 고Bar[z] + 고[z];
}
if C < value then {
for j = 9 downto 1 {
if SarDnBar <= 저Bar[j] then x = j;
if SarDnBar <= 고Bar[j] then z = j;
}
추세선 = (SarDnC - 고[z])/(고Bar[z] - SarDnBar) * 고Bar[z] + 고[z];
지지선 = (SarDnVal - 고[z])/(고Bar[z] - SarDnBar) * 고Bar[z] + 고[z];
저항선 = (SarDnVal - 고[z])/(고Bar[z] - SarDnBar) * 저Bar[x] + 저[x];
}
if 추세선 > 0 then {
plot1(추세선,"추세선",Green);
plot2(지지선,"지지선",Red);
plot3(저항선,"저항선",Blue);
}
답변 1
예스스탁 예스스탁 답변
2018-10-08 10:30:22
안녕하세요
예스스탁입니다.
Input:n(4), af(0.02), maxAF(0.2);
Var:j(0),k(0),x(0),z(0),value(0),SarUpC(0),SarDnC(0),SarUpBar(0),SarDnBar(0),SarUpVal(0),SarDnVal(0),
추세선(0),지지선(0),저항선(0);
Array:고[10](0),저[10](0),고Bar[10](0),저Bar[10](0);
var : color1(0),color2(0),color3(0);
value = Sar(af,maxAF);
for j = 1 to 9 {
저Bar[j] = 저Bar[j] + 1;
고Bar[j] = 고Bar[j] + 1;
}
SarUpBar = SarUpBar + 1;
SarDnBar = SarDnBar + 1;
if Highest(H,n)[n+1] <= H[n] and H[n] > Highest(H,n) then {
for j = 8 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
고[1] = H[n];
고Bar[1] = n;
if 저Bar[1] > 고Bar[2] then {
for j = 8 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
k = n + 1;
for j = n + 2 to 고Bar[2]-1 {
if L[k] > L[j] then k = j;
}
저[1] = L[k];
저Bar[1] = k;
}
}
if Lowest(L,n)[n+1] >= L[n] and L[n] < Lowest(L,n) then {
for j = 8 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
저[1] = L[n];
저Bar[1] = n;
if 고Bar[1] > 저Bar[2] then {
for j = 8 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
k = n + 1;
for j = n + 2 to 저Bar[2]-1 {
if H[k] < H[j] then k = j;
}
고[1] = H[k];
고Bar[1] = k;
}
}
if CrossUp(C,value) then {
SarUpC = C;
SarUpVal = (value[1] + value)/2;
SarUpBar = 0;
}
if CrossDown(C,value) then {
SarDnC = C;
SarDnVal = (value[1] + value)/2;
SarDnBar = 0;
}
추세선 = 0; 지지선 = 0; 저항선 = 0;
if C > value then {
for j = 9 downto 1 {
if SarUpBar <= 저Bar[j] then x = j;
if SarUpBar <= 고Bar[j] then z = j;
}
추세선 = (SarUpC - 저[x])/(저Bar[x] - SarUpBar) * 저Bar[x] + 저[x];
지지선 = (SarUpVal - 저[x])/(저Bar[x] - SarUpBar) * 저Bar[x] + 저[x];
저항선 = (SarUpVal - 저[x])/(저Bar[x] - SarUpBar) * 고Bar[z] + 고[z];
}
if C < value then {
for j = 9 downto 1 {
if SarDnBar <= 저Bar[j] then x = j;
if SarDnBar <= 고Bar[j] then z = j;
}
추세선 = (SarDnC - 고[z])/(고Bar[z] - SarDnBar) * 고Bar[z] + 고[z];
지지선 = (SarDnVal - 고[z])/(고Bar[z] - SarDnBar) * 고Bar[z] + 고[z];
저항선 = (SarDnVal - 고[z])/(고Bar[z] - SarDnBar) * 저Bar[x] + 저[x];
}
if 추세선 > 0 then {
if 추세선 > 추세선[1] Then
color1 = red;
if 추세선 < 추세선[1] Then
color1 = blue;
if 지지선 > 지지선[1] Then
color2 = red;
if 지지선 < 지지선[1] Then
color2 = blue;
if 저항선 > 저항선[1] Then
color3 = red;
if 저항선 < 저항선[1] Then
color3 = blue;
plot1(추세선,"추세선",color1);
plot2(지지선,"지지선",color2);
plot3(저항선,"저항선",color3);
}
즐거운 하루되세요
> 야크 님이 쓴 글입니다.
> 제목 : 지표
> 아래지표에서 선이 상승이면 빨강 하락이면 파랑으로 표현하고 싶습니다.
Input:n(4), af(0.02), maxAF(0.2);
Var:j(0),k(0),x(0),z(0),value(0),SarUpC(0),SarDnC(0),SarUpBar(0),SarDnBar(0),SarUpVal(0),SarDnVal(0),
추세선(0),지지선(0),저항선(0);
Array:고[10](0),저[10](0),고Bar[10](0),저Bar[10](0);
value = Sar(af,maxAF);
for j = 1 to 9 {
저Bar[j] = 저Bar[j] + 1;
고Bar[j] = 고Bar[j] + 1;
}
SarUpBar = SarUpBar + 1;
SarDnBar = SarDnBar + 1;
if Highest(H,n)[n+1] <= H[n] and H[n] > Highest(H,n) then {
for j = 8 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
고[1] = H[n];
고Bar[1] = n;
if 저Bar[1] > 고Bar[2] then {
for j = 8 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
k = n + 1;
for j = n + 2 to 고Bar[2]-1 {
if L[k] > L[j] then k = j;
}
저[1] = L[k];
저Bar[1] = k;
}
}
if Lowest(L,n)[n+1] >= L[n] and L[n] < Lowest(L,n) then {
for j = 8 downto 1 {
저[j+1] = 저[j];
저Bar[j+1] = 저Bar[j];
}
저[1] = L[n];
저Bar[1] = n;
if 고Bar[1] > 저Bar[2] then {
for j = 8 downto 1 {
고[j+1] = 고[j];
고Bar[j+1] = 고Bar[j];
}
k = n + 1;
for j = n + 2 to 저Bar[2]-1 {
if H[k] < H[j] then k = j;
}
고[1] = H[k];
고Bar[1] = k;
}
}
if CrossUp(C,value) then {
SarUpC = C;
SarUpVal = (value[1] + value)/2;
SarUpBar = 0;
}
if CrossDown(C,value) then {
SarDnC = C;
SarDnVal = (value[1] + value)/2;
SarDnBar = 0;
}
추세선 = 0; 지지선 = 0; 저항선 = 0;
if C > value then {
for j = 9 downto 1 {
if SarUpBar <= 저Bar[j] then x = j;
if SarUpBar <= 고Bar[j] then z = j;
}
추세선 = (SarUpC - 저[x])/(저Bar[x] - SarUpBar) * 저Bar[x] + 저[x];
지지선 = (SarUpVal - 저[x])/(저Bar[x] - SarUpBar) * 저Bar[x] + 저[x];
저항선 = (SarUpVal - 저[x])/(저Bar[x] - SarUpBar) * 고Bar[z] + 고[z];
}
if C < value then {
for j = 9 downto 1 {
if SarDnBar <= 저Bar[j] then x = j;
if SarDnBar <= 고Bar[j] then z = j;
}
추세선 = (SarDnC - 고[z])/(고Bar[z] - SarDnBar) * 고Bar[z] + 고[z];
지지선 = (SarDnVal - 고[z])/(고Bar[z] - SarDnBar) * 고Bar[z] + 고[z];
저항선 = (SarDnVal - 고[z])/(고Bar[z] - SarDnBar) * 저Bar[x] + 저[x];
}
if 추세선 > 0 then {
plot1(추세선,"추세선",Green);
plot2(지지선,"지지선",Red);
plot3(저항선,"저항선",Blue);
}
다음글
이전글