예스스탁
예스스탁 답변
2021-03-30 14:32:06
안녕하세요
예스스탁입니다.
1
작성하신 수식내용은
시가가 전일종가대비 10%이상 하락했으면 1, 아니면 -1입니다.
시가가 전일종가대비 10%이상 상승했을떄와 아닐경우이므로 아래와 같이 수정해서 사용하시면 됩니다.
또한 이전 갭조건은 상승갭일때와 하락갭일때로 구분해서 갭이 없을떄는 진입을 하지 않습니다.
10% 상승이 아닐때 이므로 else로 처리하시면 됩니다.
var : RATE(0);
if Bdate != Bdate[1] Then
{
RATE = 0;
#10% 상승이 아닐때
if O < C[1]*1.1 Then
RATE = 1;
Else #10%이상 상승일떄
RATE = -1;
}
2
var : entry(0),AP(0),RATE(0),TT(0),LL(0),HH(0);
if Bdate != Bdate[1] Then
{
entry = 0;
RATE = 0;
#10% 상승이 아닐때
if O < C[1]*1.1 Then
RATE = 1;
Else #10%이상 상승일떄
RATE = -1;
}
HH = DayHigh(0);
LL = min(DayClose(1),DayLow(0));
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if RATE == 1 Then
{
if MarketPosition == 0 Then
{
if entry == 0 or
(entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("LBp1",1) == true) Then
Buy("Lb1",AtLimit,DayOpen*0.97);
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("Lb1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("LBp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("Lb2",AtLimit,DayOpen*0.94);
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("Lb1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("Lb2") == true) Then
Buy("Lb3",AtLimit,DayOpen*0.91);
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if CurrentContracts > CurrentContracts[1] Then
TT = TimeToMinutes(stime);
if MaxEntries == 1 and IsEntryName("Lb1") == true Then
{
ExitLong("Lbp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Lbx1");
}
if (MaxEntries == 2 and IsEntryName("Lb1") == true) or
(MaxEntries == 1 and IsEntryName("Lb2") == true) Then
{
ExitLong("Lbp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Lbx2");
}
if (MaxEntries == 3 and IsEntryName("Lb1") == true) or
(MaxEntries == 2 and IsEntryName("Lb2") == true) Then
{
ExitLong("Lbp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Lbx3");
}
ExitLong("Lbl",AtStop,DayOpen*0.88);
}
}
if RATE == -1 Then
{
if MarketPosition == 0 and HH >= DayClose(1)*1.05 Then
{
if entry == 0 or (entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("Rbp1",1) == true) Then
Buy("Rb1",AtLimit,LL+(HH-LL)*0.618);
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("Rb1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("RBp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("Rb2",AtLimit,LL+(HH-LL)*0.500);
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("Rb1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b2") == true) Then
Buy("Rb3",AtLimit,LL+(HH-LL)*0.382);
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if CurrentContracts > CurrentContracts[1] Then
TT = TimeToMinutes(stime);
if MaxEntries == 1 and IsEntryName("Rb1") == true Then
{
ExitLong("Rbp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Rbx1");
}
if (MaxEntries == 2 and IsEntryName("Rb1") == true) or
(MaxEntries == 1 and IsEntryName("Rb2") == true) Then
{
ExitLong("Rbp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Rbx2");
}
if (MaxEntries == 3 and IsEntryName("Rb1") == true) or
(MaxEntries == 2 and IsEntryName("Rb2") == true) Then
{
ExitLong("Rbp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Rbx3");
}
if LatestEntryName(0) == "Rb3" Then
ExitLong("Rbl",AtStop,LatestEntryPrice(0)*0.98);
}
}
SetStopEndofday(151800);
즐거운 하루되세요
> 맴맴잉 님이 쓴 글입니다.
> 제목 : 문의드립니다..
> 대댓글로 답변을 적으니. 그냥 넘어가는듯 해서 다시 끌어올려 위에다가 적습니다.
항상 감사합니다.
담당자님 덕분에 항상 배우고 있습니다.
제가 요청한 식에서 gap을 기준으로 나눠주셨자나요
혹시 제가 좀 수정할려고 하는데, 혹시 전일 종가대비 10프로 상승했을때 오른쪽식
전일 종가대비 10프로 상승을 못했을때 왼쪽식으로 적용하기 위해선
어떻게 적용해야할지 궁금합니다.
그냥 드는 생각은 gap 부분을
그냥 RATE = 0;
if O*1.1 < C[1] Then
RATE = 1;
if O*1.1 > C[1] Then
RATE = -1;
이렇게 적용하면 될까 생각이 드는데.. 맞는지 틀린지 궁금합니다.ㅜ.ㅜ
알려주세요...ㅜ.ㅜ
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 시스템식 문의 드립니다.
> 안녕하세요
예스스탁입니다.
var : entry(0),AP(0),Gap(0),TT(0),LL(0),HH(0);
if Bdate != Bdate[1] Then
{
entry = 0;
Gap = 0;
if O > C[1] Then
Gap = 1;
if O < C[1] Then
Gap = -1;
}
HH = DayHigh(0);
LL = min(DayClose(1),DayLow(0));
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Gap == 1 Then
{
if MarketPosition == 0 Then
{
if entry == 0 or
(entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("LBp1",1) == true) Then
Buy("Lb1",AtLimit,DayOpen*0.97);
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("Lb1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("LBp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("Lb2",AtLimit,DayOpen*0.94);
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("Lb1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("Lb2") == true) Then
Buy("Lb3",AtLimit,DayOpen*0.91);
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if CurrentContracts > CurrentContracts[1] Then
TT = TimeToMinutes(stime);
if MaxEntries == 1 and IsEntryName("Lb1") == true Then
{
ExitLong("Lbp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Lbx1");
}
if (MaxEntries == 2 and IsEntryName("Lb1") == true) or
(MaxEntries == 1 and IsEntryName("Lb2") == true) Then
{
ExitLong("Lbp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Lbx2");
}
if (MaxEntries == 3 and IsEntryName("Lb1") == true) or
(MaxEntries == 2 and IsEntryName("Lb2") == true) Then
{
ExitLong("Lbp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Lbx3");
}
ExitLong("Lbl",AtStop,DayOpen*0.88);
}
}
if Gap == -1 Then
{
if MarketPosition == 0 and HH >= DayClose(1)*1.05 Then
{
if entry == 0 or (entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("Rbp1",1) == true) Then
Buy("Rb1",AtLimit,LL+(HH-LL)*0.618);
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("Rb1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("RBp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("Rb2",AtLimit,LL+(HH-LL)*0.500);
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("Rb1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b2") == true) Then
Buy("Rb3",AtLimit,LL+(HH-LL)*0.382);
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if CurrentContracts > CurrentContracts[1] Then
TT = TimeToMinutes(stime);
if MaxEntries == 1 and IsEntryName("Rb1") == true Then
{
ExitLong("Rbp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Rbx1");
}
if (MaxEntries == 2 and IsEntryName("Rb1") == true) or
(MaxEntries == 1 and IsEntryName("Rb2") == true) Then
{
ExitLong("Rbp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Rbx2");
}
if (MaxEntries == 3 and IsEntryName("Rb1") == true) or
(MaxEntries == 2 and IsEntryName("Rb2") == true) Then
{
ExitLong("Rbp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("Rbx3");
}
if LatestEntryName(0) == "Rb3" Then
ExitLong("Rbl",AtStop,LatestEntryPrice(0)*0.98);
}
}
SetStopEndofday(151800);
즐거운 하루되세요
> 맴맴잉 님이 쓴 글입니다.
> 제목 : 시스템식 문의 드립니다.
> 예전에 문의들였던 시스템식 2가지를 합칠려고 합니다.
위 그림과 같이 당일 매매이고, 전일 종가대비 갭상하였을 경우 왼쪽 시스템식 적용
전일종가대비 갭 하락하였을 경우 오른쪽 시스템식을 적용하려고 합니다.
예전에 문의들였던 시스템식도 같이 송부드리오니. 요청드립니다.
-------------------------------------------------------------------
왼쪽 시스템식
var : entry(0),AP(0);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 Then
{
if entry == 0 or
(entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("Bp1",1) == true) Then
Buy("b1",AtLimit,DayOpen*0.97);
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("Bp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("b2",AtLimit,DayOpen*0.94);
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("b1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b2") == true) Then
Buy("b3",AtLimit,DayOpen*0.91);
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if MaxEntries == 1 and IsEntryName("b1") == true Then
{
ExitLong("bp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx1");
}
if (MaxEntries == 2 and IsEntryName("b1") == true) or
(MaxEntries == 1 and IsEntryName("b2") == true) Then
{
ExitLong("bp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx2");
}
if (MaxEntries == 3 and IsEntryName("b1") == true) or
(MaxEntries == 2 and IsEntryName("b2") == true) Then
{
ExitLong("bp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime)+60 Then
ExitLong("bx3");
}
ExitLong("bl",AtStop,DayOpen*0.88);
}
SetStopEndofday(151800);
-------------------------------------------------------------------
오른쪽 시스템식
var : entry(0),AP(0),TT(0),LL(0),HH(0);
if Bdate != Bdate[1] Then
entry = 0;
HH = DayHigh(0);
LL = min(DayClose(1),DayLow(0));
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 and HH >= DayClose(1)*1.05 Then
{
if entry == 0 or (entry >= 1 and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06) and IsExitName("Bp1",1) == true) Then
Buy("b1",AtLimit,LL+(HH-LL)*0.618);
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b1") == true) or
(MarketPosition == 0 and entry >= 1 and IsExitName("Bp2",1) == true and (sTime < 115000 or Highest(H,BarsSinceExit(1)) < AP*1.06)) Then
Buy("b2",AtLimit,LL+(HH-LL)*0.500);
if (MarketPosition == 1 and MaxEntries == 2 and IsEntryName("b1") == true) or
(MarketPosition == 1 and MaxEntries == 1 and IsEntryName("b2") == true) Then
Buy("b3",AtLimit,LL+(HH-LL)*0.382);
if MarketPosition == 1 Then
{
AP = AvgEntryPrice;
if CurrentContracts > CurrentContracts[1] Then
TT = TimeToMinutes(stime);
if MaxEntries == 1 and IsEntryName("b1") == true Then
{
ExitLong("bp1",AtLimit,AP*1.02);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("bx1");
}
if (MaxEntries == 2 and IsEntryName("b1") == true) or
(MaxEntries == 1 and IsEntryName("b2") == true) Then
{
ExitLong("bp2",AtLimit,AP*1.01);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("bx2");
}
if (MaxEntries == 3 and IsEntryName("b1") == true) or
(MaxEntries == 2 and IsEntryName("b2") == true) Then
{
ExitLong("bp3",AtLimit,AP*1.005);
if TimeToMinutes(sTime) >= TT+60 Then
ExitLong("bx3");
}
if LatestEntryName(0) == "b3" Then
ExitLong("bl",AtStop,LatestEntryPrice(0)*0.98);
}
SetStopEndofday(151800);
---------------------------------------------------------------
항상 감사합니다.^^