예스스탁
예스스탁 답변
2025-07-11 10:20:43
안녕하세요
예스스탁입니다.
input : StartTime(93000),EndTime(151000),P1(20),P2(60);
input : 추세유지하락(3),연속상승(2);
input : 추세유지상승(3),연속하락(2);
var : Tcond(false),mav1(0),mav2(0),T(0),S(0);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
mav1 = ma(c,P1);
mav2 = ma(c,P2);
if mav1 > mav1[1] Then
T = 1;
if mav1 < mav1[1] Then
T = -1;
if mav2 > mav2[1] Then
S = 1;
if mav2 < mav2[1] Then
S = -1;
if Tcond == true Then
{
if MarketPosition <= 0 and
S == 1 and
CountIf(T == 1,연속상승) == 연속상승 and
CountIf(T== -1,추세유지하락)[연속상승] == 추세유지하락 Then
Buy("b");
if MarketPosition >= 0 and
S == -1 and
CountIf(T == -1,연속하락) == 연속하락 and
CountIf(T== 1,추세유지상승)[연속하락] == 추세유지상승 Then
Sell("s");
if MarketPosition == 1 and CountIf(T == -1,연속하락) == 연속하락 Then
ExitLong("bx");
if MarketPosition == -1 and CountIf(T == 1,연속상승) == 연속상승 Then
ExitShort("sx");
}
SetStopEndofday(153000);
즐거운 하루되세요
> 나도부자1 님이 쓴 글입니다.
> 제목 : 수식수정
> 더운 날씨에수고많으십니다.
이전에 작성해주신 수식인데 수정부탁드립니다.
이전의 조건은
- 국내선물 120틱 사용
- 장 운용시간: 09:30~15:10 이후 진입금지/ 15:30 강제청산
- 60이평 상승추세 and 20이평 3봉연속 추세유지(하락)후 2봉연속 상승시 매수
/ 2봉연속 하락시 매수청산(60이평 상승추세에서는 매도진입 금지)
- 60이평 하락추세 and 20이평 3봉연속 추세유지(하락)후 2봉연속 하락시 매도
/ 2봉연속 상승시 매도청산(60이평 하락추세에서는 매수진입 금지)
* 이 수식에 추가로 3봉연속 추세유지 와 2봉 연속 상승을 변수로 지정할 수 있게
부탁 드립니다.
input : StartTime(93000),EndTime(151000),P1(20),P2(60);
var : Tcond(false),mav1(0),mav2(0),T(0),S(0);
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
mav1 = ma(c,P1);
mav2 = ma(c,P2);
if mav1 > mav1[1] Then
T = 1;
if mav1 < mav1[1] Then
T = -1;
if mav2 > mav2[1] Then
S = 1;
if mav2 < mav2[1] Then
S = -1;
if Tcond == true Then
{
if MarketPosition <= 0 and
S == 1 and
CountIf(T == 1,2) == 2 and
CountIf(T== -1,3)[2] == 3 Then
Buy("b");
if MarketPosition >= 0 and
S == -1 and
CountIf(T == -1,2) == 2 and
CountIf(T== 1,3)[2] == 3 Then
Sell("s");
if MarketPosition == 1 and CountIf(T == -1,2) == 2 Then
ExitLong("bx");
if MarketPosition == -1 and CountIf(T == 1,2) == 2 Then
ExitShort("sx");
}
SetStopEndofday(153000);
감사합니다