커뮤니티
마지막문의
2011-05-26 14:35:26
643
글번호 39109
input : 조건(1),TT(93000),진입가(285); //조건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,진입가-1);
}
Else
{
SetStopEndofday(0);
}
이 수식에서 진입가를 -0.5를 입력하고 적용햇더니 -1에서도 손절이 안되는데요..뭐가
문젠가요? 소수점을 적어서 그런가요?
변수 적을때 진입가는 소수점 한 자리까지 적나요?
답변 1
예스스탁 예스스탁 답변
2011-05-26 14:48:50
안녕하세요
예스스탁입니다.
진입가에 -값을 넣으시면 안됩니다.
진입가(285)은 수동으로 매수진입한 가격을 넣어주셔야 합니다.
종목의 가격이 -가 될수는 없습니다.
손절포인트를 외부변수로 처리해서 올려드립니다.
만약 손절포인트를 수정하시고자 하시면 해당 변수를 이용하시면 됩니다.
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);
}
즐거운 하루되세요
> 감자골2 님이 쓴 글입니다.
> 제목 : 마지막문의
> input : 조건(1),TT(93000),진입가(285); //조건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,진입가-1);
}
Else
{
SetStopEndofday(0);
}
이 수식에서 진입가를 -0.5를 입력하고 적용햇더니 -1에서도 손절이 안되는데요..뭐가
문젠가요? 소수점을 적어서 그런가요?
변수 적을때 진입가는 소수점 한 자리까지 적나요?
다음글
이전글