커뮤니티
질문추가입니다
2018-10-25 18:10:38
160
글번호 123060
오늘 아래와 같이 답변을 주셨는데
시뮬레이션을 돌려보니깐
4시까지 주문이 들어가고 그때부터 포지션을 유지하네요
제가 원하는건 저녁10시부터 오전 4시까지 거래를 하고
4시에 청산까지 되는걸로 부탁드려요
3시 59분에 주문이 들어가도 4시에 강제 청산되는 수식입니다
잘부탁드려요
------------
안녕하세요
예스스탁입니다.
Input : P(5),af(0.02), maxAF(0.2);
input : starttime(220000),endtime(040000);
Var : mav(0),sarv(0),Bcond(false),Scond(false);
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;
}
mav = ma(c,P);
sarv = sar(af,maxAF);
Bcond = C > mav and C > Sarv;
Scond = C < mav and C < Sarv;
if Tcond == true then
{
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
}
즐거운 하루되세요
> 쩜상쩜하 님이 쓴 글입니다.
> 제목 : 질문추가입니다
> Input : P(5),af(0.02), maxAF(0.2);
Var : mav(0),sarv(0),Bcond(false),Scond(false);
mav = ma(c,P);
sarv = sar(af,maxAF);
Bcond = C > mav and C > Sarv;
Scond = C < mav and C < Sarv;
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
이 수식에서
저녁 10시부터 새벽 4시까지만 매매가능하게 추가가능한 수식 가능한가요?
그 외의 시간은 매매 안하게요
잘부탁드립니다
답변 1
예스스탁 예스스탁 답변
2018-10-26 10:28:00
안녕하세요
예스스탁입니다.
Input : P(5),af(0.02), maxAF(0.2);
input : starttime(220000),endtime(040000);
Var : mav(0),sarv(0),Bcond(false),Scond(false);
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();
}
mav = ma(c,P);
sarv = sar(af,maxAF);
Bcond = C > mav and C > Sarv;
Scond = C < mav and C < Sarv;
if Tcond == true then
{
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
}
즐거운 하루되세요
> 쩜상쩜하 님이 쓴 글입니다.
> 제목 : 질문추가입니다
> 오늘 아래와 같이 답변을 주셨는데
시뮬레이션을 돌려보니깐
4시까지 주문이 들어가고 그때부터 포지션을 유지하네요
제가 원하는건 저녁10시부터 오전 4시까지 거래를 하고
4시에 청산까지 되는걸로 부탁드려요
3시 59분에 주문이 들어가도 4시에 강제 청산되는 수식입니다
잘부탁드려요
------------
안녕하세요
예스스탁입니다.
Input : P(5),af(0.02), maxAF(0.2);
input : starttime(220000),endtime(040000);
Var : mav(0),sarv(0),Bcond(false),Scond(false);
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;
}
mav = ma(c,P);
sarv = sar(af,maxAF);
Bcond = C > mav and C > Sarv;
Scond = C < mav and C < Sarv;
if Tcond == true then
{
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
}
즐거운 하루되세요
> 쩜상쩜하 님이 쓴 글입니다.
> 제목 : 질문추가입니다
> Input : P(5),af(0.02), maxAF(0.2);
Var : mav(0),sarv(0),Bcond(false),Scond(false);
mav = ma(c,P);
sarv = sar(af,maxAF);
Bcond = C > mav and C > Sarv;
Scond = C < mav and C < Sarv;
if Bcond == true and Bcond[1] == false Then
buy();
if Scond == true and Scond[1] == false Then
sell();
이 수식에서
저녁 10시부터 새벽 4시까지만 매매가능하게 추가가능한 수식 가능한가요?
그 외의 시간은 매매 안하게요
잘부탁드립니다
다음글
이전글