커뮤니티
수식검토요망
2011-04-14 14:03:13
857
글번호 37609
그림은 제가 작성한 지표의 파동A와 B의 궤적이 10이하로
내려갔다가 다시 10이상으로 올라오는 것을 단계별로 정리한것입니다
아래의 산식은 단계별로 적용한 산식입니다
질문1: 위 그림의 개념중 누락된건 없는지요(단기:A, 장기:B)?
A는 B에 대해 선행합니다
질문2: 아래산식이 제대로 작성된건가요?
질문3: Loop문을 이용해서 좀더 단순화 할순 없는지요? 지표3개를 이런식으로
정리해야하는데.....
부탁드립니다
-아래-
If A>10 and B>10 and A<B then {
Phase=1;
var1=0;
}
If A<10 and A>0 and B>10 and A<B then {
Phase=2;
var1=-0.5;
if A>10 then
Phase=1
}
If A<10 and A>0 and B<10 and B>0 and A<B then {
Phase=3;
var1=-2;
if B>10 then
Phase=2
}
If A<10 and A>0 and B<10 and B>0 and A>B then {
Phase=4;
var1=-1;
if A<B then
Phase=3
}
If A>10 and B<10 and B>0 and A>B then {
Phase=5;
var1=-0.5;
if A<10 then
Phase=4
}
If A>10 and B>10 and A>B then {
Phase=6;
var1=0;
if A<B then
Phase=1
}
- 1. 201104.jpg (0.32 MB)
답변 1
예스스탁 예스스탁 답변
2011-04-14 14:50:45
안녕하세요
예스스탁입니다.
아래는 수정한 식입니다.
현재단계를 인식하는 내용을 추가해야 합니다.
이런 내용이 없으면 몇단계를 건너뛰는 내용이 발생할 수 있고
마지막 6단계에서 A < B발생하면 0으로 초기화하여 다시 1단계 부터
시작하실 수 있도록 하셔야 합니다.
아래식 수정된 식이고 for문등으로 간단화는 가능하지 않습니다.
#0단계 --> 1단계
If Phase == 0 and A>10 and B>10 and A<B then {
Phase=1;
var1=0;
}
# 1단계 --> 2단계
If Phase == 1 And A<10 and A>0 and B>10 and A<B then {
Phase=2;
var1=-0.5;
}
# 2단계 중 1단계로 리턴
if Phase == 2 and A > 10 then
Phase=1
# 2단계 --> 3단계
If Phase == 2 and A<10 and A>0 and B<10 and B>0 and A<B then {
Phase=3;
var1=-2;
}
# 3단계 중 2단계로 리턴
if Phase == 3 and B>10 then
Phase=2
}
# 3단계 --> 4단계
If Phase ==3 and A<10 and A>0 and B<10 and B>0 and A>B then {
Phase=4;
var1=-1;
}
# 4단계 중 3단계로 리턴
if Phase == 4 and A<B then
Phase=3;
}
# 4단계 --> 5단계
If Phase == 4 and A>10 and B<10 and B>0 and A>B then {
Phase=5;
var1=-0.5;
}
# 5단계 중 4단계로 리턴
if Phase == 5 and A<10 then
Phase=4
}
# 5단계 --> 6단계
If Phase == 5 and A>10 and B>10 and A>B then {
Phase=6;
var1=0;
}
# 6단계 중 5단계로 리턴
if Phase == 6 and B<10 then
Phase=5;
}
# 6단계중 A < B발생하면 0단계로 초기화(1단계부터 다시 조건감시를 위해 0으로 셋팅)
if Phase == 6 and A<B then
Phase=0;
}
즐거운 하루되세요
> 티끌 님이 쓴 글입니다.
> 제목 : 수식검토요망
> 그림은 제가 작성한 지표의 파동A와 B의 궤적이 10이하로
내려갔다가 다시 10이상으로 올라오는 것을 단계별로 정리한것입니다
아래의 산식은 단계별로 적용한 산식입니다
질문1: 위 그림의 개념중 누락된건 없는지요(단기:A, 장기:B)?
A는 B에 대해 선행합니다
질문2: 아래산식이 제대로 작성된건가요?
질문3: Loop문을 이용해서 좀더 단순화 할순 없는지요? 지표3개를 이런식으로
정리해야하는데.....
부탁드립니다
-아래-
If A>10 and B>10 and A<B then {
Phase=1;
var1=0;
}
If A<10 and A>0 and B>10 and A<B then {
Phase=2;
var1=-0.5;
if A>10 then
Phase=1
}
If A<10 and A>0 and B<10 and B>0 and A<B then {
Phase=3;
var1=-2;
if B>10 then
Phase=2
}
If A<10 and A>0 and B<10 and B>0 and A>B then {
Phase=4;
var1=-1;
if A<B then
Phase=3
}
If A>10 and B<10 and B>0 and A>B then {
Phase=5;
var1=-0.5;
if A<10 then
Phase=4
}
If A>10 and B>10 and A>B then {
Phase=6;
var1=0;
if A<B then
Phase=1
}
다음글