예스스탁
예스스탁 답변
2026-02-24 10:58:54
안녕하세요
예스스탁입니다.
input : starttime(100000),Endtime(50000);
var : Tcond(False);
Var : PP(0), R1(0),R2(0), R3(0), R4(0), S1(0), S2(0), S3(0),S4(0);
PP = ( DayHigh(1) + DayClose(1) + DayLow(1) )/3; //피봇선
R4 = DayHigh(1) + 3*(PP - DayLow(1)); //3차저항
R3 = DayHigh(1) + 2*(PP - DayLow(1)); //3차저항
R2 = PP+DayHigh(1)-DayLow(1); //2차저항
R1 = 2 * PP - DayLow(1); //1차저항
S1 = 2 * PP - DayHigh(1); //1차지지
S2 = PP-DayHigh(1)+DayLow(1); //2차지지
S3 = DayLow(1) - 2*(DayHigh(1) - PP); //3차지지
S4 = DayLow(1) - 3*(DayHigh(1) - PP); //3차지지
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if tcond == true Then
{
if MarketPosition >= 0 Then
{
if CrossUp(C,R4) Then
Sell("S4");
if CrossUp(C,R3) Then
Sell("S3");
if CrossUp(C,R2) Then
Sell("S2");
if CrossUp(C,R1) Then
Sell("S1");
if CrossDown(C,PP-PriceScale*20) Then
Sell("S");
}
if MarketPosition <= 0 Then
{
if CrossDown(C,S1) Then
Buy("B1");
if CrossDown(C,S2) Then
Buy("B2");
if CrossDown(C,S3) Then
Buy("B3");
if CrossDown(C,S4) Then
Buy("B4");
if CrossUp(C,PP+PriceScale*20) Then
Buy("B");
}
if MarketPosition == -1 Then
{
if IsEntryName("S4") == true and CrossDown(C,R3) Then
ExitShort("S4x");
if IsEntryName("S3") == true and CrossDown(C,R2) Then
Buy("S3x");
if IsEntryName("S2") == true and CrossDown(C,R1) Then
Buy("S2x");
if IsEntryName("S1") == true and CrossDown(C,PP) Then
Buy("S1x");
}
if MarketPosition == 1 Then
{
if IsEntryName("B1") == true and CrossUp(C,PP) Then
ExitLong("B1x");
if IsEntryName("B2") == true and CrossUp(C,S1) Then
Sell("B2x");
if IsEntryName("B3") == true and CrossUp(C,S2) Then
Buy("B3x");
if IsEntryName("B4") == true and CrossUp(C,S3) Then
Buy("B4x");
}
}
즐거운 하루되세요