예스스탁
예스스탁 답변
2019-12-27 17:59:58
안녕하세요
예스스탁입니다.
1
손절이 항상 지정한 피라미딩횟수 충족한 이후에만 발생하기를 원하시면
아래와 같이 수정하시면 됩니다. 지정하신 손절이 평단가 대비입니다.
설정하신 값에 따라 N번 진입이후에 손절가가 최종 진입가 위일수도 있습니다.
손절을 평단가가 아닌 최종 진입가 기준으로 하시면
각 손절식의 AvgEntryPrice을 LatestEntryPrice(0)로 변경하시면 됩니다.
손절부분은 사용자분의 의도에 맞춰 직접 수정하시기 바랍니다.
input: howmany(5), n1(1), n2(2), n3(3),n4(4),n5(5),k최초(2), k일반(3), k익절(4), k손절(4),again(3),pause(5);
var : atrv(0),vv(0);
atrv = atr(50);
if C < highest(C,30)-3*atrv then
var1 = C;
if C > Lowest(C,30)+3*atrv then
var2 = C;
Condition1 = MarketPosition == 0 and MarketPosition(1) == 1 and IsExitName("bL");
Condition2 = MarketPosition == 0 and MarketPosition(1) == -1 and IsExitName("sL");
if MarketPosition == 0 and
(TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= pause)) and
(Condition1 == false or (Condition1 == true and var1-k최초*atrv <= ExitPrice(1)-Again*Atr(50))) Then
{
buy("b",atlimit,var1-k최초*atrv,n1);
}
if MarketPosition == 1 then
{
if MaxEntries == howmany then
ExitLong("bL",AtStop,AvgEntryPrice-k손절*atrv);
ExitLong("bP",AtLimit,AvgEntryPrice+k익절*atrv);
if howmany >= 2 and MaxEntries < howmany then
{
if MaxEntries == 1 then
vv = n2;
if MaxEntries == 2 then
vv = n3;
if MaxEntries == 3 then
vv = n4;
if MaxEntries == 4 then
vv = n5;
buy("bb",atlimit,LatestEntryPrice(0)-k일반*atrv,vv);
}
}
if MarketPosition == 0 and
(TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= pause)) and
(Condition2 == false or (Condition2 == true and var2+k최초*atrv >= ExitPrice(1)+Again*Atr(50))) Then
{
sell("s",atlimit,var2+k최초*atrv,n1);
}
if MarketPosition == -1 then
{
if MaxEntries == howmany then
ExitShort("sL",AtStop,AvgEntryPrice+k손절*atrv);
ExitShort("sP",AtLimit,AvgEntryPrice-k익절*atrv);
if howmany >= 2 and CurrentEntries < howmany then
{
if MaxEntries == 1 then
vv = n2;
if MaxEntries == 2 then
vv = n3;
if MaxEntries == 3 then
vv = n4;
if MaxEntries == 4 then
vv = n5;
sell("ss",atlimit,LatestEntryPrice(0)+k일반*atrv,vv);
}
}
2
아래 지표 적용해 보시기 바랍니다.
봉의 고가나 저가가 해당 라인을 터치해야 신호가 발생합니다.
해당 기간에 터치하는 봉이 없습니다.
input: howmany(5), n1(1), n2(2), n3(3),n4(4),n5(5),k최초(2), k일반(3), k익절(4), k손절(4),again(3),pause(5);
var : atrv(0),vv(0);
atrv = atr(50);
if C < highest(C,30)-3*atrv then
var1 = C;
if C > Lowest(C,30)+3*atrv then
var2 = C;
plot1(var1[1]-k최초*atrv[1]);
plot2(var2[1]+k최초*atrv[1]);
즐거운 하루되세요
> 에구머니 님이 쓴 글입니다.
> 제목 : 시스템식 정정
> 안녕하세요?
65425번 아직 문제점이 남아 있어서 재질문 했으니 살펴 주시기 바랍니다.
감사합니다.