예스스탁
예스스탁 답변
2020-03-23 10:40:47
안녕하세요
예스스탁입니다.
input : n(180),하락퍼센트(0.95);
input : p(20),MFI값(70);
input : 매매수(25),금액1(0),금액2(0),금액3(5),금액4(10),금액5(15),금액6(15),금액7(15),금액8(15);
input : 전일대비하락률(0.85),청산률(11);
var : cnt(0);
Array : EP[9](0);
var1 = highest(H,n);
var2 = mfi(P);
if stime < 143000 then
{
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));
ExitLong("bx1.",atlimit,c*1.03,"b1");
}
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.04) and
var2 < (MFI값-7) and
c < o and
c <= c[1]*(99.4-전일대비하락률)/100 Then
{
buy("b2",OnClose,def,Floor(금액2*10000/c));
ExitLong("bx2.",atlimit,c*1.04,"b2");
}
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.08) and
var2 < (MFI값-14) and
c < o and
c <= c[1]*(99.2-전일대비하락률)/100 Then
{
buy("b3",OnClose,def,Floor(금액3*10000/c));
ExitLong("bx3.",atlimit,c*1.05,"b3");
}
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.12) and
var2 < (MFI값-21) and
c < o and
c <= c[1]*(98.8-전일대비하락률)/100 Then
{
buy("b4",OnClose,def,Floor(금액4*10000/c));
ExitLong("bx4.",atlimit,c*1.06,"b4");
}
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.16) and
var2 < (MFI값-28) and
c < o and
c <= c[1]*(98.4-전일대비하락률)/100 Then
{
buy("b5",OnClose,def,Floor(금액5*10000/c));
ExitLong("bx5.",atlimit,c*1.07,"b5");
}
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.2) and
var2 < (MFI값-35) and
c < o and
c <= c[1]*(98.0-전일대비하락률)/100 Then
{
buy("b6",OnClose,def,Floor(금액6*10000/c));
ExitLong("bx6.",atlimit,c*1.08,"b6");
}
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.24) and
var2 < (MFI값-42) and
c < o and
c <= c[1]*(97.6-전일대비하락률)/100 Then
{
buy("b7",OnClose,def,Floor(금액6*10000/c));
ExitLong("bx7.",atlimit,c*1.09,"b7");
}
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.28) and
var2 < (MFI값-48) and
c < o and
c <= c[1]*(97.2-전일대비하락률)/100 Then
{
buy("b8",OnClose,def,Floor(금액6*10000/c));
ExitLong("bx8.",atlimit,c*1.10,"b8");
}
if MarketPosition == 1 Then
{
if LatestEntryName =="b1" Then
EP[1] = LatestEntryPrice(0);
if LatestEntryName =="b2" Then
EP[2] = LatestEntryPrice(0);
if LatestEntryName =="b3" Then
EP[3] = LatestEntryPrice(0);
if LatestEntryName =="b4" Then
EP[4] = LatestEntryPrice(0);
if LatestEntryName =="b5" Then
EP[5] = LatestEntryPrice(0);
if LatestEntryName =="b6" Then
EP[6] = LatestEntryPrice(0);
if LatestEntryName =="b7" Then
EP[7] = LatestEntryPrice(0);
if LatestEntryName =="b8" Then
EP[8] = LatestEntryPrice(0);
if EP[1] > 0 then
ExitLong("bx1",atlimit,EP[1]*1.03,"b1");
if EP[2] > 0 then
ExitLong("bx2",atlimit,EP[2]*1.04,"b2");
if EP[3] > 0 then
ExitLong("bx3",atlimit,EP[3]*1.05,"b3");
if EP[4] > 0 then
ExitLong("bx4",atlimit,EP[4]*1.06,"b4");
if EP[5] > 0 then
ExitLong("bx5",atlimit,EP[5]*1.07,"b5");
if EP[6] > 0 then
ExitLong("bx6",atlimit,EP[6]*1.08,"b6");
if EP[7] > 0 then
ExitLong("bx7",atlimit,EP[7]*1.09,"b7");
if EP[8] > 0 then
ExitLong("bx8",atlimit,EP[8]*1.10,"b8");
}
}
if MarketPosition == 0 then
{
for cnt = 1 to 8
{
EP[cnt-1] = 0;
}
}
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 수식 추가로 작성 요청드릴께요~~
> 아래수식은 b1~b8번 까지 다른 매수조건이지만
청산 조건은 진입후 11% 수익시 청산하게되는 수식입니다.
각각 매수조건별로 청산조건을 다르게 설계가능할까요?
예를 들면
b1조건에 매수후 3% 수익시 청산
b2조건에 매수후 4% 수익시 청산
b3조건에 매수후 5% 수익시 청산
b4조건에 매수후 6% 수익시 청산
b5조건에 매수후 7% 수익시 청산
b6조건에 매수후 8% 수익시 청산
b7조건에 매수후 9% 수익시 청산
b8조건에 매수후 10% 수익시 청산
하게 하는 식을 부탁드릴게요~~
input : n(180),하락퍼센트(0.95);
input : p(20),MFI값(70);
input : 매매수(25),금액1(0),금액2(0),금액3(5),금액4(10),금액5(15),금액6(15),금액7(15),금액8(15);
input : 전일대비하락률(0.85),청산률(11);
var1 = highest(H,n);
var2 = mfi(P);
if stime < 143000 then
{
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));
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.04) and
var2 < (MFI값-7) and
c < o and
c <= c[1]*(99.4-전일대비하락률)/100 Then
buy("b2",OnClose,def,Floor(금액2*10000/c));
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.08) and
var2 < (MFI값-14) and
c < o and
c <= c[1]*(99.2-전일대비하락률)/100 Then
buy("b3",OnClose,def,Floor(금액3*10000/c));
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.12) and
var2 < (MFI값-21) and
c < o and
c <= c[1]*(98.8-전일대비하락률)/100 Then
buy("b4",OnClose,def,Floor(금액4*10000/c));
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.16) and
var2 < (MFI값-28) and
c < o and
c <= c[1]*(98.4-전일대비하락률)/100 Then
buy("b5",OnClose,def,Floor(금액5*10000/c));
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.2) and
var2 < (MFI값-35) and
c < o and
c <= c[1]*(98.0-전일대비하락률)/100 Then
buy("b6",OnClose,def,Floor(금액6*10000/c));
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.24) and
var2 < (MFI값-42) and
c < o and
c <= c[1]*(97.6-전일대비하락률)/100 Then
buy("b7",OnClose,def,Floor(금액6*10000/c));
if MaxEntries < 매매수 and
c < var1*(하락퍼센트-0.28) and
var2 < (MFI값-48) and
c < o and
c <= c[1]*(97.2-전일대비하락률)/100 Then
buy("b8",OnClose,def,Floor(금액6*10000/c));
SetStopProfittarget(청산률,PercentStop);
}
Else
SetStopProfittarget(0);