커뮤니티
수정 부탁드립니다.
2015-10-27 22:05:01
185
글번호 91795
매번 성실한 답변에 감사드립니다.^^
사용중인 지표식입니다.
그림에서와같이 2번봉에 지표가 표시되어야하나 2번봉이 다시 메인조건에 해당되어
지표가 표시되지 않고 다음 조건에 만족하는 봉에 지표가 표시되는데
메인조건보다 메인조건이후 지표조건이 우선되도록 수정 부탁드립니다.
var : count(0),Price(0),idx(0);
var4 = BollBandup(20,2);
var5 = BollBandup(80,2);
var6 = BollBandup(240,2);
if date != date[1] Then{
var1 = c;
var2 = o;
var3 = h;
}
condition1 = c > highest(c,24)[1] ; ##24봉중-최고가
Condition2 = crossup(c,var5);
Condition3 = crossup(c,var6); ##주가-240bbup돌파
#### 메인조건 ####
if Condition1 == true and Condition3 == true and c > var5 and
var4 > var6*0.9 and c > c[1] and c > o and
var4 > var4[1] and var5 > var5[1] and var4[1] <= var6[1] and
(var6-var5) < var5*0.05 and c < DayClose(1)*1.15 then{
Price = C;
count = 0;
idx = 0;
}
#### 지표조건 ####
idx = idx+1;
if idx == 2 and C > O and C > Price and L < Price Then{
count = count+1;
plot1(H);
}
if idx > 2 and crossup(C,Price) and C > O Then{
count = count+1;
if count == 1 Then
plot1(H);
}
- 1. 샘플.PNG (0.00 MB)
답변 1
예스스탁 예스스탁 답변
2015-10-28 11:41:48
안녕하세요
예스스탁입니다.
문의하신 내용은 수식 계산상
위치를 바꿔주시는 방법뿐이 없습니다.
수식은 위에서 아래로 읽어 들어가는데
메인조건 로직이 지표조건보다 위에 있으므로
동시에 만족한 경우 초기화가 먼저 되게 됩니다.
지표조건을 메인조건위에 올리면
메인조건과 지표조건이 동시에 충족 도어도
지표조건 수행후에 메인조건이 수행되므로
해당 봉에 지표가 표시될수 있습니다.
즉 동시충족조건에서 먼저 계산할부분이 있으면
위쪽으로 올리시면 됩니다.
var : count(0),Price(0),idx(0);
var4 = BollBandup(20,2);
var5 = BollBandup(80,2);
var6 = BollBandup(240,2);
if date != date[1] Then{
var1 = c;
var2 = o;
var3 = h;
}
condition1 = c > highest(c,24)[1] ; ##24봉중-최고가
Condition2 = crossup(c,var5);
Condition3 = crossup(c,var6); ##주가-240bbup돌파
#### 지표조건 ####
idx = idx+1;
if idx == 2 and C > O and C > Price and L < Price Then{
count = count+1;
plot1(H);
}
if idx > 2 and crossup(C,Price) and C > O Then{
count = count+1;
if count == 1 Then
plot1(H);
}
#### 메인조건 ####
if Condition1 == true and Condition3 == true and c > var5 and
var4 > var6*0.9 and c > c[1] and c > o and
var4 > var4[1] and var5 > var5[1] and var4[1] <= var6[1] and
(var6-var5) < var5*0.05 and c < DayClose(1)*1.15 then{
Price = C;
count = 0;
idx = 0;
}
즐거운 하루되세요
> 부양가족 님이 쓴 글입니다.
> 제목 : 수정 부탁드립니다.
> 매번 성실한 답변에 감사드립니다.^^
사용중인 지표식입니다.
그림에서와같이 2번봉에 지표가 표시되어야하나 2번봉이 다시 메인조건에 해당되어
지표가 표시되지 않고 다음 조건에 만족하는 봉에 지표가 표시되는데
메인조건보다 메인조건이후 지표조건이 우선되도록 수정 부탁드립니다.
var : count(0),Price(0),idx(0);
var4 = BollBandup(20,2);
var5 = BollBandup(80,2);
var6 = BollBandup(240,2);
if date != date[1] Then{
var1 = c;
var2 = o;
var3 = h;
}
condition1 = c > highest(c,24)[1] ; ##24봉중-최고가
Condition2 = crossup(c,var5);
Condition3 = crossup(c,var6); ##주가-240bbup돌파
#### 메인조건 ####
if Condition1 == true and Condition3 == true and c > var5 and
var4 > var6*0.9 and c > c[1] and c > o and
var4 > var4[1] and var5 > var5[1] and var4[1] <= var6[1] and
(var6-var5) < var5*0.05 and c < DayClose(1)*1.15 then{
Price = C;
count = 0;
idx = 0;
}
#### 지표조건 ####
idx = idx+1;
if idx == 2 and C > O and C > Price and L < Price Then{
count = count+1;
plot1(H);
}
if idx > 2 and crossup(C,Price) and C > O Then{
count = count+1;
if count == 1 Then
plot1(H);
}