예스스탁
예스스탁 답변
2020-03-16 19:32:05
안녕하세요
예스스탁입니다.
올려주신 수식은 진입과 청산이 모두 봉완성시입니다.
단지 100% 이익일때 청산하는 내용만 조건만족 즉시로 작성되어 있습니다.
해당 내용만 봉완성시 종가로 바꿔드립니다.
1
input : profit(100);
var1 = ma(C,300);
Condition1 = C > var1 and C > DayClose(1);
Condition2 = C < var1 and C < DayClose(1);
if Condition1 == true and Condition1[1] == false Then
buy("b");
if MarketPosition == 1 then
{
if c > EntryPrice*(1+profit/100) Then
ExitLong("bp",OnClose,def,"",Floor(MaxContracts*0.5),1);
if Condition2 == true and Condition2[1] == false Then
ExitLong("bx");
if c < DayClose(1) Then
ExitLong("bx3");
}
2
매도를 매수와 반대조건으로 추가했습니다.
input : profit(100);
var1 = ma(C,300);
Condition1 = C > var1 and C > DayClose(1);
Condition2 = C < var1 and C < DayClose(1);
if Condition1 == true and Condition1[1] == false Then
buy("b");
if MarketPosition == 1 then
{
if c >= EntryPrice*(1+profit/100) Then
ExitLong("bp",OnClose,def,"",Floor(MaxContracts*0.5),1);
if Condition2 == true and Condition2[1] == false Then
ExitLong("bx");
if c < DayClose(1) Then
ExitLong("bx3");
}
if Condition2 == true and Condition2[1] == false Then
sell("s");
if MarketPosition == -1 then
{
if c <= EntryPrice*(1+profit/100) Then
ExitLong("sp",OnClose,def,"",Floor(MaxContracts*0.5),1);
if Condition1 == true and Condition1[1] == false Then
ExitShort("sx");
if c > DayClose(1) Then
ExitShort("sx3");
}
즐거운 하루되세요
> 하리마우 님이 쓴 글입니다.
> 제목 : 점검 부탁드립니다.
> 수식 감사드립니다.
아래 수식은,
이동평균선(300일선)을 돌파하고 전일종가를 돌파하면 매수,
이동평균선(300일선)을 이탈하고 전일종가를 이탈하면 매도
하는 두가지 조건 만족식인데요, 진입/청산 모두 조건만족즉시가 하니고 봉완성후로 부탁합니다.
그리고 100% 이익일때 50%청산하고 나머지는 홀딩하는 수식인데요,
input : profit(100);
var1 = ma(C,300);
Condition1 = C > var1 and C > DayClose(1);
Condition2 = C < var1 and C < DayClose(1);
if Condition1 == true and Condition1[1] == false Then
buy("b");
if MarketPosition == 1 then
{
ExitLong("bp",atlimit,EntryPrice*(1+profit/100),"",Floor(MaxContracts*0.5),1);
if Condition2 == true and Condition2[1] == false Then
ExitLong("bx");
}
위 수식이 현물용인데, 선물(코인)에서 사용할 수 있도록 매수진입/매수청산, 매도진입/매도청산으로 변경 부탁드리고요,
한가지 더,
매수 또는 매도 진입 후, 전일종가를 이탈하면 손절할 수 있도록 조정해 주시면 감사하겠습니다!