답변완료
행복; 지표식 작성 바랍니다
한국의 금융산업 발전을 위해 불철주야 애쓰시는 귀하의 노고를 높이 평가합니다
지표식 관련입니다
< 조건 >
- 주기; 1분봉
- 전일(D-1 day) 종가가 상한가 인 경우
- 오늘(D day) 10시 5분부터 11시 23분 사이의 최고가를 기준으로, 11시 23분부터 당일 장 종료까지, (+) 5%, (-) 5% 를 그리기
를 하고자 합니다
<< 아래 >> 를 어떻게 수정하면 되는지요?
=============<< 아래 >>======================================
Input : 변동률(5);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
if CodeCategory() == 2 then {
if date >= 20030721 then {
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
up7 = int(UpLimit/1+0.00001)*1;
}
}
Else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
if sdate < 20101004 Then{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if bdate != bdate[1] then
{
Condition1 = false;
if DayClose(1) == 상한가[1] Then
Condition1 = true;
}
If Condition1 == true Then
{
plot1(DayOpen * (1+변동률/100),"상승변동률",BLACK);
plot2(DayOpen * (1-변동률/100),"하락변동률",BLACK);
}
==================================================================
지표식 작성 바랍니다
수고하십시요^^
2020-01-05
308
글번호 134888
지표
답변완료
디마크고가를 이동평균할수있게 도와 주세요 .
새해에도 고생하시는 운영자님들 항상 복 받으시고 건강하세요.
아이디와 계좌를 약 10년전에 만들어 두고 수식에 어려움이 너무 많아서
여태 사용하지 않았던 사용자 입니다.
다름이 아니라 디마크고가의 일주기 이평값을 분봉에 사용하기 위해서 입니다 .
게시판에서 일봉의 지수이평을 분봉에 사용하는것과 결합해 보려고 하니
실력이 모자라 도저히 안돼네요.
아래수식에서 디마크고가의 일봉값을 지수이동 평균한것과
dema이동평균한것을 분봉에 불러 와서 검색하기 위함입니다.
수식에 능통한 분들의 도움을 구하고자 합니다 .
디마크고가의 지수200 이평과 , 디마크고가의 데마40 이평을 분봉에 사용하기 위함입니다.
~~~~~ 아래 수식 ~~~~~~~~~~~~~
Input : Period(200);
Var :dh(0),dh200(0),Ep(0), JISU(0), DINDEX(0), PreJISU(0);
Ep = 2/(Period+1);
if bdate != bdate[1] then{
DINDEX = DINDEX + 1;
PreJISU = JISU[1];
}
if DINDEX <= 1 then
JISU = C;
else
JISU = C * EP + PreJISU * (1-EP);
If DayClose(1) > DayOpen(1) Then
{
value1 = (DayHigh(1)+DayLow(1)+DayClose(1)+DayHigh(1))/2-DayLow(1);
value2 = (DayHigh(1)+DayLow(1)+DayClose(1)+DayHigh(1))/2-DayHigh(1);
}
Else If DayClose(1) < DayOpen(1) Then
{
value1 = (DayHigh(1)+DayLow(1)+DayClose(1)+DayLow(1))/2-DayLow(1);
value2 = (DayHigh(1)+DayLow(1)+DayClose(1)+DayLow(1))/2-DayHigh(1);
}
Else
{
value1 = (DayHigh(1)+DayLow(1)+DayClose(1)+DayClose(1))/2-DayLow(1);
value2 = (DayHigh(1)+DayLow(1)+DayClose(1)+DayClose(1))/2-DayHigh(1);
}
dh=value1;
dh200= JISU(dh,period);
위와 같이 하면 "함수만이 입력값을 가질수 있읍니다"
라고 나옵니다 .
데마이평은 ema(ema(dh,40),40)
으로 사용해도 됩니다 . 감사합니다 .
2020-01-03
394
글번호 134886
종목검색