예스스탁
예스스탁 답변
2019-12-12 11:10:08
안녕하세요
예스스탁입니다.
1
if upp Then
{
T = 1;
if MarketPosition == -1 Then
ExitShort();
}
if dnn Then
{
T = -1;
if MarketPosition == 1 Then
exitlong();
}
해당 수식에서 _ExitlongNo1, _ExitShortNo1은
손절수식이 아니라 위 내용에 의해 발생하는 신호입니다.
손절식은 "bl","sl"이라는 이름입니다.
해당 내용이 필요 없으시면 삭젝하셔야 합니다.
2
input: howmany(5), n1(1), n2(1), n3(2),n4(3),n5(4),k최초(2), k일반(3), k익절(4), k손절(10) ;
Input: better1(3), better2(7);
var : upp(false), dnn(false), T(0), Left(3), right(3);
var : ATRV(0),HH(0),LL(0),SHV(0),SHI(0),SLV(0),SLi(0);
upp = (C > ma(C, 100));
dnn = (C < ma(C, 100));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
ATRV = ATR(96);
if upp Then
{
T = 1;
if MarketPosition == -1 Then
ExitShort();
}
if dnn Then
{
T = -1;
if MarketPosition == 1 Then
exitlong();
}
if SwingHigh(1,h,Left,right,Left+right+1) != -1 Then{
SHV = H[3];
SHI = 0;
}
if SwingLow(1,l,Left,right,Left+right+1) != -1 Then{
SLV = L[3];
SLI = 0;
}
SHI = SHI+1;
SLI = SLI+1;
if T == 1 and T != T[1] Then
HH = H;
if T == -1 and T != T[1] Then
LL = L;
Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("bl");
Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("sl");
if T == 1 Then
{
if H > HH Then
HH = H;
if MarketPosition == 0 and Condition1 == false and
((C < HH-ATRv*k최초) or
(countif(T != T[1],BarsSinceExit(1)) < 1 and BarsSinceExit(1) > SHI and C < SHV-ATRv*k최초)) Then
buy("b11",OnClose,def,n1);
if MarketPosition == 0 and Condition1 == true and C <= ExitPrice(1)-better1*Atrv and
((C < HH-ATRv*k최초) or
(countif(T != T[1],BarsSinceExit(1)) < 1 and BarsSinceExit(1) > SHI and C < SHV-ATRv*k최초)) Then
buy("b12",OnClose,def,n1);
if MarketPosition == 0 and Condition1 == true and C <= ExitPrice(1)-better2*Atrv Then
buy("b13",OnClose,def,n1);
if MarketPosition == 1 Then{
exitlong("bp",AtLimit,AvgEntryPrice+atrv*k익절);
if MaxEntries == 1 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then
buy("b2",OnClose,def,n2);
if MaxEntries == 2 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then
buy("b3",OnClose,def,n3);
if MaxEntries == 3 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then
buy("b4",OnClose,def,n4);
if MaxEntries == 4 and MaxEntries < howmany and C <= LatestEntryPrice(0)-atrv*k일반 Then
buy("b5",OnClose,def,n5);
if MaxEntries == howmany Then
ExitLong("bl",AtStop,LatestEntryPrice(0)-atrv*k손절);
}
}
if T == -1 Then{
if L < LL Then
LL = L;
if MarketPosition == 0 and Condition2 == false and
((C > LL+ATRv*k최초) or
(countif(T != T[1],BarsSinceExit(1)) < 1 and BarsSinceExit(1) > SLI and C > SLV+ATRv*k최초)) Then
sell("s1",OnClose,def,n1);
if MarketPosition == 0 and Condition2 == true and C >= ExitPrice(1)+better1*Atrv and
((C > LL+ATRv*k최초) or
(countif(T != T[1],BarsSinceExit(1)) < 1 and BarsSinceExit(1) > SLI and C > SLV+ATRv*k최초)) Then
sell("s12",OnClose,def,n1);
if MarketPosition == 0 and Condition2 == true and C >= ExitPrice(1)+better2*Atrv Then
sell("s13",OnClose,def,n1);
if MarketPosition == -1 Then{
ExitShort("sp",AtLimit,AvgEntryPrice-atrv*k익절);
if MaxEntries == 1 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then
sell("s2",OnClose,def,n2);
if MaxEntries == 2 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then
sell("s3",OnClose,def,n3);
if MaxEntries == 3 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then
sell("s4",OnClose,def,n4);
if MaxEntries == 4 and MaxEntries < howmany and C >= LatestEntryPrice(0)+atrv*k일반 Then
sell("s5",OnClose,def,n5);
if MaxEntries == howmany Then
ExitShort("sl",AtStop,LatestEntryPrice(0)+atrv*k손절);
}
}
3
건의하신 내용은 전달하도록 하겠습니다.
즐거운 하루되세요
> 에구머니 님이 쓴 글입니다.
> 제목 : 시스템식 정정
> 안녕하세요?
시스템식 정정 부탁드립니다.
대단히 감사합니다.
ps) 한가지 건의 사항입니다.
VPS에서 시스템 돌리고 싶은데, 일종의 Auto_Starter 같은 프로그램을 만들어 주시면 참 좋겠습니다.
그러니까, 시간을 세팅해 놓으면 제시간에 스스로 예스트레이더 켰다가 껐다가 하는 녀석입니다.
정말, 저처럼 마눌님 몰래해야 하는 사람들에게는 너무너무 꼭 필요한 거라서요...
건의 드리오니, 천천히 긍정적으로 검토해 주시기 바랍니다.
감사합니다.