일봉 매매에 적용하고자 합니다.
연속 음봉3개 종가 5분전 매수
연속 양봉3개 종가 5분전 매도
청산은 없습니다
답변 4
예스스탁
예스스탁 답변
2024-10-18 14:22:32
안녕하세요
예스스탁입니다.
일봉주기에서는 시간을 지정해 신호발생이 가능하지 않습니다.
분봉이하에서만 시간을 조건으로 신호를 발생할 수 있습니다.
아래식을 5분봉 차트에 적용하시면 됩니다.
if MarketPosition <= 0 and
NextBarStime >= 153000 and sTime < 153000 and
C < DayOpen and
DayClose(1) < DayOpen(1) and
DayClose(2) < DayOpen(2) Then
Buy("b",AtMarket);
if MarketPosition >= 0 and
NextBarStime >= 153000 and sTime < 153000 and
C > DayOpen and
DayClose(1) > DayOpen(1) and
DayClose(2) > DayOpen(2) Then
Sell("s",AtMarket);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 일봉 매매에 적용하고자 합니다.
연속 음봉3개 종가 5분전 매수
연속 양봉3개 종가 5분전 매도
청산은 없습니다
input : StartTime(190000),EndTime(50000),Xtime(50000);
var : Tcond(false),entry(0);
if sdate != sDate[1] Then
SetStopEndofday(Xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Inputs: VtyPercent(0.23),ATRperiod(4);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
input : StartTime(190000),EndTime(50000),Xtime(50000);
var : Tcond(false),entry(0);
if sdate != sDate[1] Then
SetStopEndofday(Xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Inputs: VtyPercent(0.12),ATRperiod(4);
If MarketPosition() <> 1 Then
Buy ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
ExitLong ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));
input : StartTime(190000),EndTime(50000),Xtime(50000);
var : Tcond(false),entry(0);
if sdate != sDate[1] Then
SetStopEndofday(Xtime);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
SetStopEndofday(0);
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
Inputs: VtyPercent(0.12),ATRperiod(4);
If MarketPosition() <> 1 Then
ExitShort ("Vty_LE", AtStop, Close + (VtyPercent * ATR(ATRperiod)));
If MarketPosition() <> -1 Then
Sell ("Vty_SE)", AtStop, Close - (VtyPercent * ATR(ATRperiod)));