커뮤니티
시스템 연속손실회수 수식 문의드립니다
2015-01-08 08:15:53
164
글번호 82027
안녕하세요. 연속횟수 2회 도달 시 매매금지 공식을 목록에서 찾아보고 만들어보았는데요.
아래의 수식대로 했을경우 2회연속 손실이나도 포지션 진입을 계속 해서 문의드립니다.
Input : 거래시간(1), 시작시간(090000), 끝시간(144000),연속손실회수(2);
var : 매수조건(true), cnt(0), Conlosscnt(0), Conloss(0);
if date != date[1] Then
value20 = sdate[1];
Conlosscnt=0;
for cnt = 20 downto 1
{
if (stime < 끝시간 and ExitDate(cnt) == sdate and ExitTime(cnt) <= 끝시간) or
(stime < 끝시간 and ExitDate(cnt) == value20 and ExitTime(cnt) >= 시작시간) Or
(stime >= 시작시간 and ExitDate(cnt) == sDate and ExitTime(cnt) >= 시작시간) Then
{
if PositionProfit(cnt) < 0 Then
{
Conlosscnt = Conlosscnt+1;
}
Else
{
Conlosscnt = 0;
}
}
}
Condition1 = Conlosscnt < 연속손실회수;
# 매수/청산
If condition1=true Then
{
Buy("매수");
}
iI sTime == 끝시간 Then
{
ExitLong();
}
답변 1
예스스탁 예스스탁 답변
2015-01-08 16:57:27
안녕하세요
예스스탁입니다.
Input : 거래시간(1), 시작시간(090000), 끝시간(144000),연속손실회수(2);
var : 매수조건(true), cnt(0), Conlosscnt(0), Conloss(0);
if date != date[1] Then
value20 = sdate[1];
#당일연속속실횟수
Conlosscnt=0;
for cnt = 20 downto 1
{
{
if ExitDate(cnt) == sdate and PositionProfit(cnt) < 0 Then
Conlosscnt = Conlosscnt+1;
Else
Conlosscnt = 0;
}
}
Condition1 = Conlosscnt < 연속손실회수;
# 매수/청산
If condition1==true and stime >= 시작시간 and stime < 끝시간 Then
{
Buy("매수");
}
if sTime == 끝시간 Then
{
ExitLong();
}
즐거운 하루되세요
> HI_he****** 님이 쓴 글입니다.
> 제목 : 시스템 연속손실회수 수식 문의드립니다
> 안녕하세요. 연속횟수 2회 도달 시 매매금지 공식을 목록에서 찾아보고 만들어보았는데요.
아래의 수식대로 했을경우 2회연속 손실이나도 포지션 진입을 계속 해서 문의드립니다.
Input : 거래시간(1), 시작시간(090000), 끝시간(144000),연속손실회수(2);
var : 매수조건(true), cnt(0), Conlosscnt(0), Conloss(0);
if date != date[1] Then
value20 = sdate[1];
Conlosscnt=0;
for cnt = 20 downto 1
{
if (stime < 끝시간 and ExitDate(cnt) == sdate and ExitTime(cnt) <= 끝시간) or
(stime < 끝시간 and ExitDate(cnt) == value20 and ExitTime(cnt) >= 시작시간) Or
(stime >= 시작시간 and ExitDate(cnt) == sDate and ExitTime(cnt) >= 시작시간) Then
{
if PositionProfit(cnt) < 0 Then
{
Conlosscnt = Conlosscnt+1;
}
Else
{
Conlosscnt = 0;
}
}
}
Condition1 = Conlosscnt < 연속손실회수;
# 매수/청산
If condition1=true Then
{
Buy("매수");
}
iI sTime == 끝시간 Then
{
ExitLong();
}
다음글
이전글