예스스탁
예스스탁 답변
2020-04-13 16:09:39
안녕하세요
예스스탁입니다.
문의하신 내용은 식작성에 시간이 많이 걸리는 부분으로
저희가 답변을 드릴수 없습니다.
업무상 시간이 많이 요구되는 부분은 저희가 작성해 드리지 않습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 국내 주식 수식 수정 요청드림니다.
> 아래 수식으로 분할 매수-청산 운영하고 있습니다.
참고로: 국내 주식 / ETF 포함
분봉 운용
12개의 분할 조건에 의해 분할 매수 진입버전입니다.
청산은 매매횟수에 따라 150회 이하는 각각 개별 수익 청산
150회 이상 매수시에는 특정 수익시 일괄매도로 설계했는데요 다음과 같이 바꾸고 싶어요
반영 부탁드리겠습니다.
기존에 매매 횟수별로 구분하는 청산을 다음과 같이 매매구분을 횟수와 상관없이 다음과 같이
매수 조건 홀수별로 1.3.5.7.9,11로 매수된 수량은 개별 수익청산 SetStopProfittarget(청산률,PercentStop);
매수 조건 짝수별로 2.4.6.8.10,12로 매수된 수량은 평균수익률 도달시 일괄청산 으로
ExitLong("누적분 일청",atlimit,AvgEntryPrice*(1+(일괄청산률)/100));
해주시면 감사하겠습니다.
ps 혹시 위부분이 구현되기 어렵다면 매매횟수별로 홀수-개별 수익청산 짝수매매-평균수익시 일곽청산으로는 가능할까요??
어떤것으로 해도 상관없습니다만 수식이 간편한것으로 해주시면 감사하겠습니다.
==================================================================================
input : n(20),하락퍼센트(1);
input : p(20),MFI값(100);
input : 매매수(200),금액1(20),금액2(20),금액3(20),금액4(20),금액5(25);
input : 금액6(30),금액7(35),금액8(40),금액9(45),금액10(50);
input : 금액11(60),금액12(70);
input : 전일대비하락률(1),청산률(10),일괄청산률(9),개별청산매매수(165);
var1 = highest(H,n);
var2 = mfi(P);
if stime < 140000 then
{
# 1번 매수 조건
if MaxEntries < 매매수 and
c < var1*하락퍼센트 and
var2 < MFI값 and
c < o and
c <= c[1]*(100-전일대비하락률)/100 Then
buy("b1",OnClose,def,Floor(금액1*10000/c));
# 2번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.01) and
var2 < (MFI값-1) and
c < o and
c <= c[1]*(99.8-전일대비하락률)/100 Then
buy("b2",OnClose,def,Floor(금액2*10000/c));
# 3번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.02) and
var2 < (MFI값-3) and
c < o and
c <= c[1]*(99.6-전일대비하락률)/100 Then
buy("b3",OnClose,def,Floor(금액3*10000/c));
# 4번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.03) and
var2 < (MFI값-5) and
c < o and
c <= c[1]*(99.4-전일대비하락률)/100 Then
buy("b4",OnClose,def,Floor(금액4*10000/c));
# 5번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.04) and
var2 < (MFI값-7) and
c < o and
c <= c[1]*(99.2-전일대비하락률)/100 Then
buy("b5",OnClose,def,Floor(금액5*10000/c));
# 6번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.05) and
var2 < (MFI값-9) and
c < o and
c <= c[1]*(99-전일대비하락률)/100 Then
buy("b6",OnClose,def,Floor(금액6*10000/c));
# 7번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.06) and
var2 < (MFI값-11) and
c < o and
c <= c[1]*(98.8-전일대비하락률)/100 Then
buy("b7",OnClose,def,Floor(금액7*10000/c));
# 8번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.07) and
var2 < (MFI값-13) and
c < o and
c <= c[1]*(98.6-전일대비하락률)/100 Then
buy("b8",OnClose,def,Floor(금액8*10000/c));
# 9번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.08) and
var2 < (MFI값-15) and
c < o and
c <= c[1]*(98.4-전일대비하락률)/100 Then
buy("b9",OnClose,def,Floor(금액9*10000/c));
# 10번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.09) and
var2 < (MFI값-17) and
c < o and
c <= c[1]*(98.2-전일대비하락률)/100 Then
buy("b10",OnClose,def,Floor(금액10*10000/c));
# 11번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.1) and
var2 < (MFI값-19) and
c < o and
c <= c[1]*(98-전일대비하락률)/100 Then
buy("b11",OnClose,def,Floor(금액10*10000/c));
# 12번 매수 조건
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.11) and
var2 < (MFI값-21) and
c < o and
c <= c[1]*(97.8-전일대비하락률)/100 Then
buy("b12",OnClose,def,Floor(금액10*10000/c));
if MaxEntries <= 개별청산매매수 Then
SetStopProfittarget(청산률,PercentStop);
Else
{
SetStopProfittarget(0);
ExitLong("누적분 일청",atlimit,AvgEntryPrice*(1+(일괄청산률)/100));
}
}
Else
SetStopProfittarget(0);