커뮤니티
손절식문의
2011-05-27 15:06:54
659
글번호 39167
input : 조건(1),TT(93000),진입가(285),손절포인트(1); //조건1이면 첫봉에서 매수, 조건0이면 첫봉에서 매도
if sdate < CurrentDate Then{
if 조건 == 1 Then
if dayindex == 0 then buy();
if 조건 == 0 Then
if dayindex == 0 then sell();
}
if sdate == CurrentDate and stime >= TT Then{
if CrossUp( C, ma(C,10)) and C > O then
exitshort("매도청산",AtMarket);
if CrossDown(C, ma(C,10)) and C < O then
exitlong("매수청산",AtMarket);
SetStopEndofday(145800);
exitlong("손절",AtStop,진입가-손절포인트);
}
Else
{
SetStopEndofday(0);
}
수식
정말고맙습니다.
하나만 더 확인부탁드립니다.
매수포지션에대한 손절매는 잘됩니다.그런데 매도포지션에대한 손절은 안됩니다.
다시한번 부탁드립니다.
매번 귀찮게 해서 죄송합니다.
답변 1
예스스탁 예스스탁 답변
2011-05-27 16:02:18
안녕하세요
예스스탁입니다.
input : 조건(1),TT(93000),진입가(285),손절포인트(1); //조건1이면 첫봉에서 매수, 조건0이면 첫봉에서 매도
if sdate < CurrentDate Then{
if 조건 == 1 Then
if dayindex == 0 then buy();
if 조건 == 0 Then
if dayindex == 0 then sell();
}
if sdate == CurrentDate and stime >= TT Then{
if CrossUp( C, ma(C,10)) and C > O then
exitshort("매도청산",AtMarket);
if CrossDown(C, ma(C,10)) and C < O then
exitlong("매수청산",AtMarket);
SetStopEndofday(145800);
exitlong("매수손절",AtStop,진입가-손절포인트);
ExitShort("매도손절",AtStop,진입가+손절포인트);
}
Else
{
SetStopEndofday(0);
}
즐거운 하루되세요
> 감자골2 님이 쓴 글입니다.
> 제목 : 손절식문의
> input : 조건(1),TT(93000),진입가(285),손절포인트(1); //조건1이면 첫봉에서 매수, 조건0이면 첫봉에서 매도
if sdate < CurrentDate Then{
if 조건 == 1 Then
if dayindex == 0 then buy();
if 조건 == 0 Then
if dayindex == 0 then sell();
}
if sdate == CurrentDate and stime >= TT Then{
if CrossUp( C, ma(C,10)) and C > O then
exitshort("매도청산",AtMarket);
if CrossDown(C, ma(C,10)) and C < O then
exitlong("매수청산",AtMarket);
SetStopEndofday(145800);
exitlong("손절",AtStop,진입가-손절포인트);
}
Else
{
SetStopEndofday(0);
}
수식
정말고맙습니다.
하나만 더 확인부탁드립니다.
매수포지션에대한 손절매는 잘됩니다.그런데 매도포지션에대한 손절은 안됩니다.
다시한번 부탁드립니다.
매번 귀찮게 해서 죄송합니다.
다음글
이전글