답변완료
수식문의
수고하십니다.
아래수식으로 30분기준,검색기간 500봉으로 검색하고 있습니다.
검색이 된 후 기존 검색된 종목은 유지되고 새로운 종목이 추가로 검색되게 할 수
있도록 수정 부탁드립니다
Input : DayPeriod(20),P1(60),P2(120),NC(12), Mult(1.01),SV(100000);
Var : T(0),S(0),Cnt(0),Sum(0),Dayma(0);
Sum = 0;
For cnt = 0 to Dayperiod-1
{
Sum = Sum + DayClose(Cnt);
}
Dayma = Sum/DayPeriod;
Var1 = Ma(C,P1);
Var2 = Ma(C,P2);
if CrossDown(C,Var1) Then
{
T = 1;
if Var1 > Var2 and T[1] == -1 and Index <= S+NC and C >= DayClose(1)*Mult and
C > Dayma and C>O and DayVolume(0)>SV Then
Find(1);
}
if CrossDown(C,Var1) Then
{
T = -1;
S = Index;
}
if T == -1 and C < Var2 Then
T = -2;
2023-08-10
1161
글번호 171371
검색
답변완료
문의
답변 수식으로 시뮬레이션 해보았습니다.
연속봉 1만 결과가 나오고
나머지 연속봉2 이상에서는 결과가 나오지 않습니다.
최초 요청수식은 각각의 연속봉에서 결과가 나온 수식입니다.
살펴주십시요.
*****************************************************************************
안녕하세요
예스스탁입니다.
input : ntime(084500);
input: 연속봉(2),연속small(0.00),연속large(1.00);
var : Tcond(False),ii(0);
if data2(Bdate != Bdate[1]) Then
Tcond = False;
if Data2((sdate != sdate[1] and stime >= ntime) or
(sdate == sdate[1] and stime >= ntime and stime[1] < ntime)) Then
Tcond = true;
ii = 0;
if tcond == true Then
{
ii = ii +1;
if ii >= 연속봉 and data2(accumN(iff(C>O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate and AccumN(abs(C-O), 연속봉) >= 연속small and AccumN(abs(C-O), 연속봉) < 연속large) then
buy();
}
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 문의
> 답변 고맙습니다.
3분봉
입력시간 084500
연속봉 2개 조건으로 시뮬레이션을 해보니
전일 종가에 음봉이 있으면 그것을 포함하다 보니
당일 첫봉에 진입하는 경우가 발생합니다.
금일 발생봉 조건과 시간입력한 이후 봉부터 연속봉을 계산하는 수식이오니
수정 부탁드립니다.
항상 고맙습니다.
*********************************************************************************
안녕하세요
예스스탁입니다.
input : ntime(084800);
input: 연속봉(1),연속small(0.52),연속large(0.56);
var : Tcond(False);
if data2(Bdate != Bdate[1]) Then
Tcond = False;
if Data2((sdate != sdate[1] and stime >= ntime) or
(sdate == sdate[1] and stime >= ntime and stime[1] < ntime)) Then
Tcond = true;
if Tcond == true and data2(accumN(iff(C>O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate and AccumN(abs(C-O), 연속봉) >= 연속small and AccumN(abs(C-O), 연속봉) < 연속large) then
buy();
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 문의
> 아래 수식에
입력시간부터 봉을 계산하는 수식을 추가하여 주십시요.
*****************************************************************************
input : ntime(084800);
input: 연속봉(1),연속small(0.52),연속large(0.56);
if data2(accumN(iff(C>O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate and AccumN(abs(C-O), 연속봉) >= 연속small and AccumN(abs(C-O), 연속봉) < 연속large) then
buy();
2023-08-10
765
글번호 171370
시스템
답변완료
지정한 시간까지 선을 그리고 싶습니다.
항상 도움에 감사드립니다.
아래와 같은 코드를 실행하면
첨부파일1과같은 선이 그어지는데요.
선은 ntime 부터 그날 장이 끝나는 시간까지 그어지는데요.
input : ntime(210000), line_num(8), size_tick(16);
var : Tcond(False), oo(0), k(0);
array : up_line[20](0), dn_line[20](0), uptext[20](0), dntext[20](0);
array : up_touch[20](0), dn_touch[20](0), up_T[20](0), dn_T[20](0), up_TL[50](0), dn_TL[50](0);
oo = o;
if Bdate != Bdate[1] Then
Tcond = False;
if (sdate != sdate[1] and stime >= ntime) or
(sdate == sdate[1] and stime >= ntime and stime[1] < ntime) Then
{
Tcond = true;
For k = 1 to line_num
{
up_T[k] = 0;
dn_T[k] = 0;
up_line[k] = oo + PriceScale*size_tick*k;
dn_line[k] = oo - PriceScale*size_tick*k;
up_touch[k] = 0;
dn_touch[k] = 0;
up_TL[k] = TL_New(sDate,sTime,up_line[k],NextBarSdate,NextBarStime,up_line[k]); // 선긋기
dn_TL[k] = TL_New(sDate,sTime,dn_line[k],NextBarSdate,NextBarStime,dn_line[k]); // 선긋기
if H >= up_line[k] Then
{
up_T[k] = k;
up_touch[k] = up_touch[k] + 1;
}
if L <= dn_line[k] Then
{
dn_T[k] = -k;
dn_touch[k] = dn_touch[k] + 1;
}
uptext[k] = Text_New(NextBarSdate,NextBarStime,up_line[k],NumToStr(up_touch[k],0));
dntext[k] = Text_New(NextBarSdate,NextBarStime,dn_line[k],NumToStr(dn_touch[k],0));
}
}
Else
{
if Tcond == true Then
{
For k = 1 to line_num
{
TL_SetEnd(up_TL[k],NextBarSdate,NextBarStime,up_line[k]);
TL_SetEnd(dn_TL[k],NextBarSdate,NextBarStime,dn_line[k]);
}
}
}
------------------------------------------------------
선이 그려지는 시간이 장이 끝나는 시간까지가 아닌
장이 끝나기 전, 지정한 시간까지 그어지게 하고 싶어서
아래와 같이
endtime(230000) 변수를 추가하고
(ex) 23시 또는 새벽 1시까지)
else 이후 부분을
stime <= endtime 추가해서 수정해 봤는데
적용이 되지 않네요.
도움 부탁드립니다.
input : ntime(210000), endtime(230000), line_num(8), size_tick(16);
var : Tcond(False), oo(0), k(0);
array : up_line[20](0), dn_line[20](0), uptext[20](0), dntext[20](0);
array : up_touch[20](0), dn_touch[20](0), up_T[20](0), dn_T[20](0), up_TL[50](0), dn_TL[50](0);
oo = o;
if Bdate != Bdate[1] Then
Tcond = False;
if (sdate != sdate[1] and stime >= ntime) or
(sdate == sdate[1] and stime >= ntime and stime[1] < ntime) Then
// 여긴 시작점 위치에 해당한다.
// 초반 캔들 부분에 해당되는 내용만 표시가 된다.
{
Tcond = true;
For k = 1 to line_num
{
up_T[k] = 0;
dn_T[k] = 0;
up_line[k] = oo + PriceScale*size_tick*k;
dn_line[k] = oo - PriceScale*size_tick*k;
up_touch[k] = 0;
dn_touch[k] = 0;
up_TL[k] = TL_New(sDate,sTime,up_line[k],NextBarSdate,NextBarStime,up_line[k]); // 선긋기
dn_TL[k] = TL_New(sDate,sTime,dn_line[k],NextBarSdate,NextBarStime,dn_line[k]); // 선긋기
if H >= up_line[k] Then
{
up_T[k] = k;
up_touch[k] = up_touch[k] + 1;
}
if L <= dn_line[k] Then
{
dn_T[k] = -k;
dn_touch[k] = dn_touch[k] + 1;
}
uptext[k] = Text_New(NextBarSdate,NextBarStime,up_line[k],NumToStr(up_touch[k],0));
dntext[k] = Text_New(NextBarSdate,NextBarStime,dn_line[k],NumToStr(dn_touch[k],0));
}
}
Else
{
if Tcond == true and stime <= endtime Then
{
For k = 1 to line_num
{
TL_SetEnd(up_TL[k],NextBarSdate,NextBarStime,up_line[k]);
TL_SetEnd(dn_TL[k],NextBarSdate,NextBarStime,dn_line[k]);
}
}
}
2023-08-09
1321
글번호 171359
지표