커뮤니티
스위칭
2018-04-20 12:43:21
133
글번호 118358
//매수진입
if 조건식 and marketposition==0 then
{
buy;
}
//매수진입2
if data2(bdate!=bdate[1] and 조건식) and marketposition==0 then
{
buy;
}
//매수청산
if marketposition==1 and 조건식 then
{
exitlong;
}
//매도진입
if 조건식 and marketposition==0
{
sell;
}
//매도진입2
if data3(bdate!=bdate[1] and 조건식) and marketposition==0 then
{
sell;
}
//매도청산
if marketposition==-1 and 조건식 then
{
exitshort
}
매수매도 잘 되고 있습니다만
스위칭을 추가하고 싶습니다.
예를 들어
매도포지션 보유중이였는데 매도청산과 매수진입2이 하나의 봉에서 이루어져야 하는데
매도청산만 되고 매수진입2이 안됩니다.
청산시점은 "봉 완성"으로 해놓은 상태구요, "조건만족시 즉시"는 개인적으로 원하지 않습니다.
답변 1
예스스탁 예스스탁 답변
2018-04-20 13:51:29
안녕하세요
예스스탁입니다.
1
설정창의 강제청산탭의 청산시점 봉완성시, 조건만족즉시는
강제청산에만 적용되는 내용입니다.
exitlong,exitshort으로 작성한 내용은 일반청산으로 해당 옵션이 적용되는 부분이 아닙니다
2
marketposition == 0
현재 진입이 모두 무포지션일때만 진입되게 조건이 주어져 있습니다.
매수진입은 marketpositio <= 0으로 , 매도진입은 marketposition >= 0으로
변경하시면 진입이후 반대반향 조건에 의해 자동으로 스위칭이 됩니다.
3
수정한 식입니다.
//매수진입
if 조건식 and marketposition <=0 then
{
buy();
}
//매수진입2
if data2(bdate!=bdate[1] and 조건식) and marketposition <=0 then
{
buy();
}
//매수청산
if marketposition==1 and 조건식 then
{
exitlong();
}
//매도진입
if 조건식 and marketposition>=0 then
{
sell();
}
//매도진입2
if data3(bdate!=bdate[1] and 조건식) and marketposition>=0 then
{
sell();
}
//매도청산
if marketposition==-1 and 조건식 then
{
exitshort();
}
즐거운 하루되세요
> 수급돌파 님이 쓴 글입니다.
> 제목 : 스위칭
> //매수진입
if 조건식 and marketposition==0 then
{
buy;
}
//매수진입2
if data2(bdate!=bdate[1] and 조건식) and marketposition==0 then
{
buy;
}
//매수청산
if marketposition==1 and 조건식 then
{
exitlong;
}
//매도진입
if 조건식 and marketposition==0
{
sell;
}
//매도진입2
if data3(bdate!=bdate[1] and 조건식) and marketposition==0 then
{
sell;
}
//매도청산
if marketposition==-1 and 조건식 then
{
exitshort
}
매수매도 잘 되고 있습니다만
스위칭을 추가하고 싶습니다.
예를 들어
매도포지션 보유중이였는데 매도청산과 매수진입2이 하나의 봉에서 이루어져야 하는데
매도청산만 되고 매수진입2이 안됩니다.
청산시점은 "봉 완성"으로 해놓은 상태구요, "조건만족시 즉시"는 개인적으로 원하지 않습니다.
다음글
이전글