예스스탁
예스스탁 답변
2025-02-17 11:51:50
안녕하세요
예스스탁입니다.
# KOSPI 선물 5분봉
input: tt(150000);
var: chkP(3), reChkP(10), stopChk(20);
var: HH(0), LL(0), BS(0), SS(0);
var: dayChk(0),entry(0);
if BarIndex == 0 then ClearDebug();
if Bdate != Bdate[1] or (sTime <= 150000 and sTime[1] < 150000) Then
entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if dayindex == chkP then {
HH = Highest(Max(C,O), chkP+1);
LL = Lowest(Min(C,O), chkP+1);
#if date == 20240612 then messageLog("--HH %.2f, LL: %.2f", HH, LL);
}
#if High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then messageLog("HH %.2f, High: %.2f", HH, High);
if DayIndex >= chkP
and sDate == NextBarSdate
and EntryDate(0) < Date
and EntryDate(1) < Date
and entry == 0
and (stime < 93000 or sTime >=150000)
Then {
Buy("B1", AtStop, HH);
Sell("S1", AtStop, LL);
}
//if dayChk == 0 and High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then {
// messageLog("HH %.2f, High: %.2f", HH, High);
// dayChk = 1;
//}
if (MarketPosition == 1) Then
{
if DayIndex < stopChk Then {
BS = Lowest(Min(C,O), DayIndex+1);
}
Else {
BS = Lowest(Min(C,O), stopChk);
}
ExitLong("EL", AtStop, BS);
}
if (MarketPosition == -1) Then {
if DayIndex < stopChk Then {
SS = Highest(Max(C,O), DayIndex+1);
}
Else {
SS = Highest(Max(C,O), stopChk);
}
#messageLog(" SS %.2f", SS);
ExitShort("ES", AtStop, SS);
}
var : month(0),nday(0),week(0),X(False);
month = int(date/100)-int(date/10000)*100;
nday = date - int(date/100)*100;
Week = DayOfWeek(date);
#만기일
if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then
{
X = true;
SetStopEndofday(151500);
}
Else#만기일아닐때
{
X = False;
SetStopEndofday(152000);
}
즐거운 하루되세요
> 가자아이 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요 항상 감사드립니다.
아래의 서식에서
1.하루에 2번만 진입하는 서식을 추가 부탁드립니다.
- 하루에 1번은 09시30분 이전
- 하루에 1번은 15시 이후
이렇게 하루에 2번만 진입 부탁드립니다.
바쁘시겠지만 부탁드립니다.
감사합니다.
# KOSPI 선물 5분봉
input: tt(150000);
var: chkP(3), reChkP(10), stopChk(20);
var: HH(0), LL(0), BS(0), SS(0);
var: dayChk(0);
if BarIndex == 0 then ClearDebug();
if dayindex == chkP then {
HH = Highest(Max(C,O), chkP+1);
LL = Lowest(Min(C,O), chkP+1);
#if date == 20240612 then messageLog("--HH %.2f, LL: %.2f", HH, LL);
}
#if High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then messageLog("HH %.2f, High: %.2f", HH, High);
if DayIndex >= chkP
and sDate == NextBarSdate
and EntryDate(0) < Date
and EntryDate(1) < Date
Then {
Buy("B1", AtStop, HH);
Sell("S1", AtStop, LL);
}
//if dayChk == 0 and High >= HH and MarketPosition == 0 and ExitDate(1) < Date and time > 93000 then {
// messageLog("HH %.2f, High: %.2f", HH, High);
// dayChk = 1;
//}
if (MarketPosition == 1) Then {
if DayIndex < stopChk Then {
BS = Lowest(Min(C,O), DayIndex+1);
}
Else {
BS = Lowest(Min(C,O), stopChk);
}
ExitLong("EL", AtStop, BS);
}
if (MarketPosition == -1) Then {
if DayIndex < stopChk Then {
SS = Highest(Max(C,O), DayIndex+1);
}
Else {
SS = Highest(Max(C,O), stopChk);
}
#messageLog(" SS %.2f", SS);
ExitShort("ES", AtStop, SS);
}
var : month(0),nday(0),week(0),X(False);
month = int(date/100)-int(date/10000)*100;
nday = date - int(date/100)*100;
Week = DayOfWeek(date);
#만기일
if (month%3 == 0 and nday >= 8 and nday <= 14 and week == 4) then
{
X = true;
SetStopEndofday(151500);
}
Else#만기일아닐때
{
X = False;
SetStopEndofday(152000);
}