커뮤니티
포지션 진입문제
2004-05-11 10:44:48
1214
글번호 3580
Input : Number(2), starttime(090300);
var : buyCond(0), sellCond(0), cnt(0), buycnt(0), sellcnt(0), state(0),
매수조건(0), 매도조건(0);
if date[1] != date then
{
cnt = 0;
buycnt = 0;
sellcnt =0;
}
매수조건 = (매수조건1);
매도조건 = (매도조건1);
buyCond = stime >= starttime and 매수조건 >= (조건2) ;
sellCond = stime >= starttime and 매도조건 >= (조건3) ;
state = marketposition();
If state == 0 and buycond and cnt < Number then
{
if buycnt == 0 then
Buy();
cnt = cnt +1;
buycnt = buycnt+1;
}
If state == 0 and sellcond and cnt < Number then
{
if sellcnt == 0 then
sell();
cnt = cnt +1;
sellcnt = sellcnt+1;
}
일중 2번매매이고 첫번째 진입포지션이 청산되면 반대포지션으로만 한번더 진입하게되는식입니다. 그런데 손설청산시에는 반대포지션으로 진입을 하지만 이익청산시에는 반대포지션 조건이 나와도 진입을 하지 않습니다. 다시 말씀드리면 첫번째 매도진입하여
1.5P 이익청산후 얼마간시간이 경과후 매수조건이되어 매수진입이 되어야 하는데
진입이 안되는 것입니다. 시뮬레이션결과도 마찬가지로 나오는듯합니다. 수식에
문제가 있는듯한데 수정 부탁드립니다....... 참고로 손절1.5, 이익1.5 3:04 종가청산입니다.
답변 1
예스스탁 예스스탁 답변
2004-05-11 13:20:35
안녕하세요? 예스스탁입니다...
정확한 매수, 매도로직을 알 수 없기 때문에 문제가 되는 부분을 확인할 수가 없지만 다음과 같이 식을 작성해 보셔도 될 것 같습니다...
만약, 원하시는 내용이 아니라면 정확한 매수, 매도로직을 알려주셔야 답변이 가능하리라 봅니다...
Input : Number(2), starttime(090300);
var : buyCond(0), sellCond(0), cnt(0), buycnt(0), sellcnt(0), state(0),
매수조건(0), 매도조건(0);
if date[1] != date then
{
cnt = 0;
buycnt = 0;
sellcnt =0;
}
매수조건 = (매수조건1);
매도조건 = (매도조건1);
buyCond = stime >= starttime and 매수조건 >= (조건2) ;
sellCond = stime >= starttime and 매도조건 >= (조건3) ;
state = marketposition();
If state != 1 and buycond and cnt < Number then {
if buycnt == 0 then {
Buy();
cnt = cnt +1;
buycnt = buycnt+1;
}
}
If state != -1 and sellcond and cnt < Number then {
if sellcnt == 0 then {
sell();
cnt = cnt +1;
sellcnt = sellcnt+1;
}
}
감사합니다...
> dfsfg 님이 쓴 글입니다.
> 제목 : 포지션 진입문제
> Input : Number(2), starttime(090300);
var : buyCond(0), sellCond(0), cnt(0), buycnt(0), sellcnt(0), state(0),
매수조건(0), 매도조건(0);
if date[1] != date then
{
cnt = 0;
buycnt = 0;
sellcnt =0;
}
매수조건 = (매수조건1);
매도조건 = (매도조건1);
buyCond = stime >= starttime and 매수조건 >= (조건2) ;
sellCond = stime >= starttime and 매도조건 >= (조건3) ;
state = marketposition();
If state == 0 and buycond and cnt < Number then
{
if buycnt == 0 then
Buy();
cnt = cnt +1;
buycnt = buycnt+1;
}
If state == 0 and sellcond and cnt < Number then
{
if sellcnt == 0 then
sell();
cnt = cnt +1;
sellcnt = sellcnt+1;
}
일중 2번매매이고 첫번째 진입포지션이 청산되면 반대포지션으로만 한번더 진입하게되는식입니다. 그런데 손설청산시에는 반대포지션으로 진입을 하지만 이익청산시에는 반대포지션 조건이 나와도 진입을 하지 않습니다. 다시 말씀드리면 첫번째 매도진입하여
1.5P 이익청산후 얼마간시간이 경과후 매수조건이되어 매수진입이 되어야 하는데
진입이 안되는 것입니다. 시뮬레이션결과도 마찬가지로 나오는듯합니다. 수식에
문제가 있는듯한데 수정 부탁드립니다....... 참고로 손절1.5, 이익1.5 3:04 종가청산입니다.