예스스탁
예스스탁 답변
2021-03-12 09:16:03
안녕하세요
예스스탁입니다.
Dayopen(0) >= DayClose(1)*1.005
시초가가 전일종가대비 5% 이상이므로 위 조건을 각 진입에 추가하시면 됩니다.
수식이 분봉이하의 주기에 적용되므로 일봉시가와 일봉전일종가를 이용하셔야 합니다.
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 and Dayopen(0) >= DayClose(1)*1.005 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 Dayopen(0) >= DayClose(1)*1.005 and
( (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 Dayopen(0) >= DayClose(1)*1.005 and
((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);
즐거운 하루되세요
> 맴맴잉 님이 쓴 글입니다.
> 제목 : 문의드립니다..
> 안녕하세요
수식을 문의드린적이 있었는데 조건을 추가하고 싶었습니다.
갭상승 0.5% 이상 이라는 조건을 만족했을때.전략을 운용한다.
이런 조건을 넣고 싶은데..
전일종가 C[1] <= O*1.005 라고 생각을 하고 있는데, 시스템을 적용한다.
안한다를 잘 모르겠습니다. ㅜ.ㅜ 알려주세요
기존에 요청했던 수식입니다.
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);