커뮤니티
안녕하세요!
2013-11-07 16:54:55
161
글번호 69310
아래수식에서 PLOT1,PLOT2 가 서로교차하지않고,
고가는 고가되로 저가는 저가되로 나타나게 2개의 식이 나타 날수있도록
수정 부탁 좀 올립니다.
아무리 해봐도 되질않아 부탁 드립니다.
nput:atrLength(14),multi(1);
Var:j(0),dayATR(0),sum(0),upTr(100),dnTr(-100),trnd(0),
date11(0),date12(0),time11(0),time12(0),TL1(0),
date21(0),date22(0),time21(0),time22(0),TL2(0),
date31(0),date32(0),time31(0),time32(0),TL3(0);
Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0);
sum = 0;
for j = 1 to atrLength {
sum = sum + Max(DayClose(j+1),DayHigh(j)) - Min(DayClose(j+1),DayLow(j));
}
dayATR = sum/atrLength;
for j = 1 to 9 {
loBar[j] = loBar[j] + 1;
hiBar[j] = hiBar[j] + 1;
}
if hiVal[0] <= H or hiVal[0] == 0 then {
hiVal[0] = H;
hiBar[0] = 0;
}
else {
hiBar[0] = hiBar[0] + 1;
}
if loVal[0] >= L or loVal[0] == 0 then {
loVal[0] = L;
loBar[0] = 0;
}
else {
loBar[0] = loBar[0] + 1;
}
if trnd != dnTr && hiVal[0] > H && hiVal[0] - (dayATR * multi) > L then trnd = dnTr;
else if trnd != upTr && loVal[0] < L && loVal[0] + (dayATR * multi) < H then trnd = upTr;
if trnd[1] == upTr and trnd == dnTr then {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date11 = date[loBar[1]];
time11 = stime[loBar[1]];
Value11 = loVal[1];
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
}
if trnd[1] == dnTr and trnd == dnTr and
hiVal[1] < hiVal[0] then {
if loVal[1] <= loVal[0] then {
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
}
else {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
loVal[1] = loVal[0];
loBar[1] = loBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
}
}
if trnd[1] == dnTr and trnd == upTr then {
for j = 8 downto 1 {
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
if trnd[1] == upTr and trnd == upTr and
loVal[1] > loVal[0] then {
if hiVal[1] >= hiVal[0] then {
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
else {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[loBar[2]];
time11 = stime[loBar[2]];
Value11 = loVal[2];
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
}
PLOT1(VALUE11);
PLOT2(VALUE12);
감사합니다 == 꾸 뻑 ==
답변 1
예스스탁 예스스탁 답변
2013-11-08 16:39:45
안녕하세요
예스스탁입니다.
2개의 선을 교차하지 않게 그리고자 하시면
plot1은 value11과 value12 중 큰값을
plot2는 value11과 value12 중 작은값을 그리게 하시면 됩니다.
input:atrLength(14),multi(1);
Var:j(0),dayATR(0),sum(0),upTr(100),dnTr(-100),trnd(0),
date11(0),date12(0),time11(0),time12(0),TL1(0),
date21(0),date22(0),time21(0),time22(0),TL2(0),
date31(0),date32(0),time31(0),time32(0),TL3(0);
Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0);
sum = 0;
for j = 1 to atrLength {
sum = sum + Max(DayClose(j+1),DayHigh(j)) - Min(DayClose(j+1),DayLow(j));
}
dayATR = sum/atrLength;
for j = 1 to 9 {
loBar[j] = loBar[j] + 1;
hiBar[j] = hiBar[j] + 1;
}
if hiVal[0] <= H or hiVal[0] == 0 then {
hiVal[0] = H;
hiBar[0] = 0;
}
else {
hiBar[0] = hiBar[0] + 1;
}
if loVal[0] >= L or loVal[0] == 0 then {
loVal[0] = L;
loBar[0] = 0;
}
else {
loBar[0] = loBar[0] + 1;
}
if trnd != dnTr && hiVal[0] > H && hiVal[0] - (dayATR * multi) > L then trnd = dnTr;
else if trnd != upTr && loVal[0] < L && loVal[0] + (dayATR * multi) < H then trnd = upTr;
if trnd[1] == upTr and trnd == dnTr then {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date11 = date[loBar[1]];
time11 = stime[loBar[1]];
Value11 = loVal[1];
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
}
if trnd[1] == dnTr and trnd == dnTr and
hiVal[1] < hiVal[0] then {
if loVal[1] <= loVal[0] then {
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
}
else {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
loVal[1] = loVal[0];
loBar[1] = loBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
}
}
if trnd[1] == dnTr and trnd == upTr then {
for j = 8 downto 1 {
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
if trnd[1] == upTr and trnd == upTr and
loVal[1] > loVal[0] then {
if hiVal[1] >= hiVal[0] then {
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
else {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[loBar[2]];
time11 = stime[loBar[2]];
Value11 = loVal[2];
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
}
PLOT1(max(VALUE11,value12));
PLOT2(min(VALUE12,value11));
즐거운 하루되세요
> 비월검파 님이 쓴 글입니다.
> 제목 : 안녕하세요!
> 아래수식에서 PLOT1,PLOT2 가 서로교차하지않고,
고가는 고가되로 저가는 저가되로 나타나게 2개의 식이 나타 날수있도록
수정 부탁 좀 올립니다.
아무리 해봐도 되질않아 부탁 드립니다.
nput:atrLength(14),multi(1);
Var:j(0),dayATR(0),sum(0),upTr(100),dnTr(-100),trnd(0),
date11(0),date12(0),time11(0),time12(0),TL1(0),
date21(0),date22(0),time21(0),time22(0),TL2(0),
date31(0),date32(0),time31(0),time32(0),TL3(0);
Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0);
sum = 0;
for j = 1 to atrLength {
sum = sum + Max(DayClose(j+1),DayHigh(j)) - Min(DayClose(j+1),DayLow(j));
}
dayATR = sum/atrLength;
for j = 1 to 9 {
loBar[j] = loBar[j] + 1;
hiBar[j] = hiBar[j] + 1;
}
if hiVal[0] <= H or hiVal[0] == 0 then {
hiVal[0] = H;
hiBar[0] = 0;
}
else {
hiBar[0] = hiBar[0] + 1;
}
if loVal[0] >= L or loVal[0] == 0 then {
loVal[0] = L;
loBar[0] = 0;
}
else {
loBar[0] = loBar[0] + 1;
}
if trnd != dnTr && hiVal[0] > H && hiVal[0] - (dayATR * multi) > L then trnd = dnTr;
else if trnd != upTr && loVal[0] < L && loVal[0] + (dayATR * multi) < H then trnd = upTr;
if trnd[1] == upTr and trnd == dnTr then {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date11 = date[loBar[1]];
time11 = stime[loBar[1]];
Value11 = loVal[1];
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
}
if trnd[1] == dnTr and trnd == dnTr and
hiVal[1] < hiVal[0] then {
if loVal[1] <= loVal[0] then {
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
}
else {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
loVal[1] = loVal[0];
loBar[1] = loBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
}
}
if trnd[1] == dnTr and trnd == upTr then {
for j = 8 downto 1 {
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
if trnd[1] == upTr and trnd == upTr and
loVal[1] > loVal[0] then {
if hiVal[1] >= hiVal[0] then {
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
else {
for j = 8 downto 1 {
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[loBar[2]];
time11 = stime[loBar[2]];
Value11 = loVal[2];
date12 = date[hiBar[1]];
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
}
}
PLOT1(VALUE11);
PLOT2(VALUE12);
감사합니다 == 꾸 뻑 ==
다음글
이전글