커뮤니티
수식
2018-10-31 19:35:24
170
글번호 123244
안녕하세요 항상 감사드려요
아래식에서 endtime(020000)에 진입된 종목을 청산되게 수식을 넣어주시면 감사하겠습니다
input : starttime(200000),endtime(020000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
}
if Tcond == true then
{
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
}
답변 1
예스스탁 예스스탁 답변
2018-11-01 14:08:32
안녕하세요
예스스탁입니다.
input : starttime(200000),endtime(020000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
exitlong();
if MarketPosition == -1 Then
ExitShort();
}
if Tcond == true then
{
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
}
즐거운 하루되세요
> 달마7 님이 쓴 글입니다.
> 제목 : 수식
> 안녕하세요 항상 감사드려요
아래식에서 endtime(020000)에 진입된 종목을 청산되게 수식을 넣어주시면 감사하겠습니다
input : starttime(200000),endtime(020000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
}
if Tcond == true then
{
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
}
이전글