답변완료
시스템식 문의 드립니다.
제가 아래의 시스템식을 작성하였는데, 오류가 많이 나서 어디가 잘못되었는지 확인좀
부탁드리겠습니다.
----------------------------------------------------------------------------------
input : 고점(7000),저점(2000);
input : 투자금액(10000000);
var : entry(False),786매수(0),618매수(0),5매수(0),382손절(0),1타점익절(0),2타점익절(0);
786매수 = 저점+((고점-저점)*0.786;
618매수 = 저점+((고점-저점)*0.618;
5매수 = 저점+((고점-저점)*0.5;
382손절 = 저점+((고점-저점)*382;
1타점익절 = 618매수+((786매수-618매수)*0.66;
2타점익절 = 5매수+((618매수-5매수)*0.66;
if Bdate != Bdate[1] Then
entry = true;
if TotalTrades > TotalTrades[1] Then
entry = False;
if MarketPosition == 0 and entry == true Then
{
Buy("618매수",AtLimit,618매수,Floor(투자금액)));
}
if (MarketPosition == 1 and MaxEntries == 1 and IsEntryName("618매수") == true Then
{
Buy("5매수",AtLimit,5매수,Floor(투자금액)));
}
if MarketPosition == 1 Then
{
if MaxEntries == 1 Then
{
ExitLong("1타점익절",AtLimit,1타점익절);
}
if MaxEntries == 2 Then
{
ExitLong("2타점익절",AtLimit,2타점익절);
}
ExitLong("382손절",AtStop,382손절);
----------------------------------------------------------------------------------
2021-11-09
516
글번호 153468
시스템
답변완료
문의드립니다
if NextBarSdate <> sDate and DayOfWeek(Bdate) == 5 Then
{ Var1 = weekHigh(0);
Var2 = weekLow(0);
}
Else
{ Var1 = weekHigh(1);
Var2 = weekLow(1);
}
if MarketPosition == 0 Then {
Buy("매수", AtStop , A);
}
if MarketPosition == 1 Then
Buy("애드업", AtStop , B ); //피라미딩
if MarketPosition == 1 and CurrentEntries == 2 and sDate == EntryDate(0) Then
목표가 = var1 + N ; //피라미딩까지 진입후에는 목표가를 정함
#청산식
if MarketPosition == 1 and CurrentEntries == 2 Then
ExitLong("수익실현", AtLimit,목표가);
A< B < var1 + N 인 임의의 가격을 가정하고 이렇게 식을 진행했을때
피라미딩 애드업을 한 이후에
1. 다음봉에서 바로 청산되는 오류가 생깁니다.
2. 다음봉에서 바로 청산되지 않을 경우
원래 의도는 피라미딩 진입한 날의 기준으로 직전 주봉의 고가 + N 이 목표가인데
실제 청산은 피라미딩 진입한 날의 기준 그 주의 주봉 고가 + N 에서 청산되는 오류가
생기는 것같습니다.
케이스를 보아하니 청산된 직전거래의 가격보다 이번거래의 가격이 높을때 1번 오류가 생기는 것 같은데
2가지 오류가 어떻게 생기는 건지 잘 이해가 안되고 있습니다.
수식에 어떤 오류가 있는건지 도움 부탁드립니다.
항상 감사합니다.
2021-11-09
768
글번호 153464
시스템
답변완료
선물만기 롤오버 시스템식 질문입니다
시뮬레이션시
선물 만기일 당일청산 하고
다음날 같은 포지션으로 재진입 시스템을 만들고 싶습니다
Input : shortPeriod(5), longPeriod(20);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
# 매수/매도청산
If CrossUP(value1, value2) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
Sell();
}
var1 = date - int(date/100)*100; //일
var2 = DayOfWeek(date); //요일
if var1 >= 8 and var1 <= 14 and // 8일에서 14일 사이이고
var2 == 4 then // 목요일
Condition1 = True;
Else
Condition1 = False;
if Condition1 == true Then#만기일에는
SetStopEndofday(144000);#14시 40분에 청산
Else
SetStopEndofday(0);#만기일이 아닌날에는 당일청산하지 않음
#만기다음날 첫봉
if date != date[1] and condition1 == false and condition1[1] == true then{
if MarketPosition(1) == 1 Then
buy();
if MarketPosition(1) == -1 Then
sell();}
당일청산 신호가 만기일이 아닌날에도 뜨네요
수식 수정 부탁드립니다
2021-11-08
853
글번호 153463
시스템
답변완료
키움 기준 신호를 예스 검색식으로 부탁합니다.
조건 A를 만족하는 결과가 나오고 난 뒤 10봉 이내에
조건 B 또는 C를 만족하는 결과가 나타나는 검색식을 부탁합니다.
---------------------------------------------------------------------
++조건 A ++
m1=ma(c,shortP,종류1);
m2=ma(c,longP,종류2);
po=(m1-m2)/m1*100;
if(po<0 && po>po(1) && po(1)<po(2), po(1),0)
==> 변수 [ shortP:5, longP:20, 종류1:지수, 종류2:가중 ]
++조건 B ++
Crossup(CCI(Period),변수)
==> 변수 : Period : 9, 변수 : 80
++ 조건 C ++
A=avg(c,5);
B=A(1);
CrossUp(A,B) && c>=o
2021-11-08
829
글번호 153462
종목검색
답변완료
수식수정
코인기준으로 수정부탁드립니다.
첫매수 진입을 9시가 되면 동시에 매수진행하고 9시 시작가를 깨면 손절.
두번째와 세번째 진입은 현재식과 같이 동일하게 진행
아래는 현재 수식입니다.
input : 금액(3000000);
var : idx(0),entry(0);
var : HH(0),Bxcond(false);
if Bdate != Bdate[1] Then
{
idx = 0;
entry = 0;
}
idx = idx+1;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 Then
{
if (Bdate != Bdate[1] and C > DayOpen) or (Bdate == Bdate[1] and CrossUp(c,DayOpen)) Then
{
if entry < 2 and idx > 2 Then
Buy("b",OnClose,DEF,Floor(금액/C));
}
}
if MarketPosition == 1 Then
{
ExitLong("bx1",AtLimit,EntryPrice*1.03,"",Floor(MaxContracts*0.2),1);
ExitLong("bx2",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.2),1);
ExitLong("bx3",AtLimit,EntryPrice*1.07,"",Floor(MaxContracts*0.2),1);
ExitLong("bx4",AtLimit,EntryPrice*1.09,"",Floor(MaxContracts*0.2),1);
}
HH = highest(H,BarsSinceEntry);
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx4" Then
Bxcond = true;
if Bxcond == false and HH >= EntryPrice*1.09 and HH < EntryPrice*1.20 Then
ExitLong("Bxs",AtStop,HH-(HH-EntryPrice)*0.2);
if C < DayOpen Then
ExitLong("bxx");
2021-11-08
1144
글번호 153460
시스템
답변완료
안녕하세요
항상 도움주셔서 감사합니다.
study("Indicator",overlay=true)
TD = close > close[4] ?nz(TD[1])+1:0
TS = close < close[4] ?nz(TS[1])+1:0
TDUp = TD - valuewhen(TD < TD[1], TD , 1 )
TDDn = TS - valuewhen(TS < TS[1], TS , 1 )
plotshape(TDUp==7?true:na,style=shape.triangledown,text="7",color=green,location=location.abovebar)
plotshape(TDUp==8?true:na,style=shape.triangledown,text="8",color=green,location=location.abovebar)
plotshape(TDUp==9?true:na,style=shape.triangledown,text="⚠️",color=green,location=location.abovebar)
plotshape(TDDn==7?true:na,style=shape.triangleup,text="7",color=red,location=location.belowbar)
plotshape(TDDn==8?true:na,style=shape.triangleup,text="8",color=red,location=location.belowbar)
plotshape(TDDn==9?true:na,style=shape.triangleup,text="✅",color=red,location=location.belowbar)
예스랭귀지로 변환 문의드릴 수 있을까요?
감사합니다.
2021-11-08
842
글번호 153459
지표