답변완료
문의드립니다.
안녕하세요~
키움에서 사용하던 수식 변환 요청드리려합니다.
1. 기존 키움① 신호검색 수식을 예스랭귀지 종목 검색으로 변화하였는데, 출력이 되지 않습니다. 어떤부분이 잘못됐는지 확인 요청드립니다.
키움①
a=(nPredayclose(1)+npredayclose(2)+npredayclose(3)+npredayclose(4))/4;
b=(dayclose()+npredayclose(1)+npredayclose(2))/3;
crossup(b,a)&&
if((h-o)/o*100<=10,1,0)&&
if((dayopen()-c(1))/c(1)*100<8,1,0)
1-1. 예스랭귀지 변환 : 종목 검색
Var : a(0), b(0);
a=DayClose(1)+DayClose(2)+DayClose(3)+DayClose(4)/4;
b=(dayclose(0)+dayclose(1)+dayclose(2))/3;
if crossup(b,a)&& (h-o)/o*100<=10 && (dayopen(0)-c[1])/c[1]*100<8 then find(1);
1-2. 예스랭귀지 변환 : 검색(키움의 신호) 으로 변환하려면 if이후 어떤 함수를 써야하나요?
2. 키움② 수식을 종목 검색으로 변환 요청드립니다..
키움②
b1=(nPredayclose(1)+npredayclose(2)+npredayclose(3)+npredayclose(4))/4;
b2=(dayclose()+npredayclose(1)+npredayclose(2))/3;
d1=(nPredayclose(2)+npredayclose(3)+npredayclose(4)+npredayclose(5))/4;
d2=(nPredayclose(1)+npredayclose(2)+npredayclose(3))/3;
e1=(nPredayclose(3)+npredayclose(4)+npredayclose(5)+npredayclose(6))/4;
e2=(nPredayclose(2)+npredayclose(3)+npredayclose(4))/3;
f1=(nPredayclose(4)+npredayclose(5)+npredayclose(6)+npredayclose(7))/4-
f2=(nPredayclose(3)+npredayclose(4)+npredayclose(5))/3;
g1=(nPredayclose(5)+npredayclose(6)+npredayclose(7)+npredayclose(8))/4;
g2=(nPredayclose(4)+npredayclose(5)+npredayclose(6))/3;
a1=b1-b2;
a2=d1-d2;
a3=e1-e2;
a4=f1-f2;
a5=g1-g2;
if(max(a1,a2,a3,a4,a5)==a2,1,0)&&
if(a1<a2,1,0)&&if(b1>d2,1,0)&&
if(d1>d2,1,0)&&if(e1>e2,1,0)&&
if((h-o)/o*100<=10,1,0)&&
if((dayopen()-c(1))/c(1)*100<8,1,0)
2020-05-17
517
글번호 138944
검색
답변완료
수식에 오류가 있나요?
*매도진입가격을 입력해서 하락돌파 되면 조정시 매도진입가에서 들어가는 조건입니다.
익절과 손절 가격도 입력해 둡니다.
매도진입=8910.50
매도손절=8987
매도익절=8870
문제가 없다고 생각했는데 진입이후 손절도 익절도 되지가 않네요.
첨부한 이미지와 같이 진입은 정상적으로 되었으며,
시스템모니터에서도 예비신호는 뜨는데 전혀 실행이 안됩니다....
뭐가 문제인가요?
수식은 아래와 같습니다. 봐주십시오.
Input : 거래시작날짜(20200515), 거래시작시간(170000);
Inputs: 매도진입(0), 매도익절(0), 매도손절(0);
Vars: Tcond(false);
if sdate == 거래시작날짜 and
((sdate != sdate[1] and stime >= 거래시작시간) or
(sdate == sdate[1] and stime >= 거래시작시간 and stime[1] < 거래시작시간)) Then
{
Tcond = true;
}
if Tcond == true then
{
#매도조건#
If C < 매도진입
and (C[1] > 매도진입 or C[2] > 매도진입 or C[3] > 매도진입 or C[4] > 매도진입)
and MarketPosition == 0
Then Sell("매도", AtLimit, 매도진입,2);
If IsEntryName("매도") Then {
If currentcontracts == maxcontracts Then {
If C < EntryPrice Then ExitLong("매도익", AtLimit,매도익절,"",1);
If C > EntryPrice Then
ExitLong("매도본", AtLimit, 매도진입);
ExitLong("매도손", AtStop, 매도손절);
}
If currentcontracts < maxcontracts Then {
If lowest(C,barssinceentry) > 매도익절
Then exitshort ("매도익1",atstop,entryprice-(entryprice-lowest(C,barssinceentry))*0.2);
If lowest(C,barssinceentry) < 매도익절
Then exitshort ("매도익2",atstop,entryprice-(entryprice-lowest(C,barssinceentry))*0.4);
If lowest(C,barssinceentry) < 매도익절-(매도진입-매도익절)/2
Then exitshort ("매도익22",atstop,entryprice-(entryprice-lowest(C,barssinceentry))*0.8);
}
}
}
추가질문
1. 이해가 안되는 것은 위의 수식처럼 진입, 익절, 손절을 입력하지 않고,
입력은 고점과 저점만 해서 수식에 의해 산출되는 피보나치 되돌림선들을 변수로 사용할 경우에는
같은 조건에 손절, 익절이 된다는 것입니다.
예를 들어 23.8% 선에서 진입 50%선에서 손절로 설정하면 된다는 말이죠.... 왜 그럴까요?
2. 해외선물 나스닥과 같은 경우 HTS상에서 100틱이상은 손절이나 익절을 걸지 못하게 막아놓았던데, 시스템 수식에서는 상관이 없는 거죠?
2020-05-16
1085
글번호 138938
시스템
답변완료
수정부탁드려요
강조에서는 나오는데 조건 검색이 안돼요
input : N(10),n1(20);
var : cnt(0),sum1(0),sum2(0),cnt1(0),sum3(0),sum4(0);
Array : mm[100](0);
if bdate != bdate[1] Then
{
mm[0] = 0;
for cnt = 1 to 99
{
mm[cnt] = mm[cnt-1][1];
}
}
mm[0] = mm[0] + m;
if mm[n-1] > 0 then
{
sum1 = 0;
sum2 = 0;
for cnt = 0 to N-1
{
sum1 = sum1 + mm[cnt];
sum2 = sum2 + DayVolume(cnt);
}
var1 = (sum1/sum2);
}
if bdate != bdate[1] Then
{
mm[0] = 0;
for cnt1 = 1 to 99
{
mm[cnt1] = mm[cnt1-1][1];
}
}
mm[0] = mm[0] + m;
if mm[n1-1] > 0 then
{
sum3 = 0;
sum4 = 0;
for cnt1 = 0 to n1-1
{
sum3 = sum3 + mm[cnt1];
sum4 = sum4 + DayVolume(cnt1);
}
var2 = (sum3/sum4);
var3 = (money/v);
}
if var1 > var2 and var2 > var3 Then
find(1);
2020-05-16
930
글번호 138936
종목검색