예스스탁
예스스탁 답변
2024-10-08 14:55:28
안녕하세요
예스스탁입니다.
# KOSPI 선물 10분봉
input: tt(150000);
var: chkP(3), reChkP(30), stopChk(35);
var: HH(0), LL(0), BS(0), SS(0);
var: dayChk(0),trade(False);
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 Bdate != Bdate[1] Then
{
trade = true;
if DayOpen >= DayClose(1)+5 or
DayOpen <= DayClose(1)-5 or
DayOpen >= DayClose(1)*1.01 or
DayOpen <= DayClose(1)*0.99 Then
Trade = False;
}
if Trade == False and sTime >= 93000 Then
Trade = true;
if Trade == true Then
{
if DayIndex >= chkP
and Time < 95000
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 ExitDate(1) == Date
and Time < 150000
// and LatestEntryName(1) != "B2"
// and LatestEntryName(1) != "S2"
// and LatestEntryName(0) != "B2"
// and LatestEntryName(0) != "S2"
Then {
if DayIndex < reChkP Then {
HH = Highest(Max(C,O), DayIndex+1);
LL = Lowest(Min(C,O), DayIndex+1);
}
Else {
HH = Highest(Max(C,O), reChkP);
LL = Lowest(Min(C,O), reChkP);
}
Buy("B2", AtStop, HH);
Sell("S2", AtStop, LL);
}
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);
}
}
SetStopEndofday(1530);
즐거운 하루되세요
> 가자아이 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 안녕하세요
항상 친절한 답변 감사드립니다.
아래의 서식에서
"선물 5포인트 또는 1% 이상 전일 종가대비 갭상승(하락)시작에는
진입시간을 9시30분 이후로 한다."
이 서식을 아래의 서식에 포함시켜 주시면 감사하겠습니다.
# KOSPI 선물 10분봉
input: tt(150000);
var: chkP(3), reChkP(30), stopChk(35);
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 Time < 95000
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 ExitDate(1) == Date
and Time < 150000
// and LatestEntryName(1) != "B2"
// and LatestEntryName(1) != "S2"
// and LatestEntryName(0) != "B2"
// and LatestEntryName(0) != "S2"
Then {
if DayIndex < reChkP Then {
HH = Highest(Max(C,O), DayIndex+1);
LL = Lowest(Min(C,O), DayIndex+1);
}
Else {
HH = Highest(Max(C,O), reChkP);
LL = Lowest(Min(C,O), reChkP);
}
Buy("B2", AtStop, HH);
Sell("S2", AtStop, LL);
}
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);
}
SetStopEndofday(1530);