예스스탁
예스스탁 답변
2022-01-10 13:39:04
안녕하세요
예스스탁입니다.
현재 수식이 9시10분~9시20분 전에
k >= 추세 조건이 만족하면 신호가 발생하게 되어 있습니다.
2분째 시간대인 9시 20분에 신호가 발생하게 하시려면 1번과 같이 수정하시면 되고
9시 20분이후에 해당조건을 사용하고자 하시면 2번과 같이 작성하시면 됩니다.
1
input : 추세(1.2);
input : StartTime1(090000),EndTime1(091000);
input : StartTime2(091000),EndTime2(092000);
var : Tcond1(false),tcond2(False);
var : h1(0),l1(0),s1(0),v1(0),h2(0),l2(0),s2(0),v2(0),k(0);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond1 = False;
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
h1 = h;
l1 = l;
s1 = 0;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
{
Tcond2 = False;
if k >= 추세 Then
Buy();
}
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
h2 = h;
l2 = l;
s2 = 0;
}
if Tcond1 == true Then
{
if h > h1 Then
h1 = h;
if l < l1 Then
l1 = l;
s1 = s1+Oi;
v1 = (h1-l1)*1000000/s1;
}
if Tcond2 == true Then
{
if h > h2 Then
h2 = h;
if l < l2 Then
l2 = l;
s2 = s2+Oi;
v2 = (h2-l2)*1000000/s2;
k = v2-v1;
}
2
input : 추세(1.2);
input : StartTime1(090000),EndTime1(091000);
input : StartTime2(091000),EndTime2(092000);
var : Tcond1(false),tcond2(False);
var : h1(0),l1(0),s1(0),v1(0),h2(0),l2(0),s2(0),v2(0),k(0);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond1 = False;
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
h1 = h;
l1 = l;
s1 = 0;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
{
Tcond2 = False;
}
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
h2 = h;
l2 = l;
s2 = 0;
}
if Tcond1 == true Then
{
if h > h1 Then
h1 = h;
if l < l1 Then
l1 = l;
s1 = s1+Oi;
v1 = (h1-l1)*1000000/s1;
}
if Tcond2 == true Then
{
if h > h2 Then
h2 = h;
if l < l2 Then
l2 = l;
s2 = s2+Oi;
v2 = (h2-l2)*1000000/s2;
k = v2-v1;
}
if sTime >= Endtime2 and k >= 추세 Then
Buy();
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 조언을 참고하여 값을 키우니 시뮬레이션이 됩니다.
그런데 진입시간이 의도와 달리 일찍 나옵니다.
수식대로라면 09시20분 이후에 진입해야하는데
대부분 09시12분에 진입하는 결과가 나옵니다.
부탁드립니다.
***********************************************************************************
input : 추세(1.2);
input : StartTime1(090000),EndTime1(091000);
input : StartTime2(091000),EndTime2(092000);
var : Tcond1(false),tcond2(False);
var : h1(0),l1(0),s1(0),v1(0),h2(0),l2(0),s2(0),v2(0),k(0);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond1 = False;
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
h1 = h;
l1 = l;
s1 = 0;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
Tcond2 = False;
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
h2 = h;
l2 = l;
s2 = 0;
}
if Tcond1 == true Then
{
if h > h1 Then
h1 = h;
if l < l1 Then
l1 = l;
s1 = s1+Oi;
v1 = (h1-l1)*1000000/s1;
}
if Tcond2 == true Then
{
if h > h2 Then
h2 = h;
if l < l2 Then
l2 = l;
s2 = s2+Oi;
v2 = (h2-l2)*1000000/s2;
k = v2-v1;
if k >= 추세 Then
Buy();
}