예스스탁
예스스탁 답변
2021-03-12 13:00:30
안녕하세요
예스스탁입니다.
차트상 첫 진입은 이전거래가 없어 청산후 2봉이후가 적용되지 못합니다.
첫거래는 조건만족시 진입하고 두번쨰 거래부터 청산후 2개봉 이후에 진입되게 하셔야 합니다.
input : Highest_(10), Lowest_(10),TARGET(60);
var : pl(0),mp(0),recnt(0),p(0),pp(0);
p = IFf(CountIf(CrossDown(c,Ema(c,60)),10) >= 1,20,0);
if MarketPosition == 0 and h < Ema(c,60) and
(TotalTrades == 0 or (TotalTrades >= 1 and BarsSinceExit(1) >= 2)) Then
{
Sell("s",AtStop,Lowest(l,Lowest_)- 20-p );
}
if MarketPosition == -1 Then begin
if BarsSinceEntry < 3 Then
ExitShort("es1",AtStop,Lowest(l,BarsSinceEntry) + 20);
else
ExitShort("es",AtStop,Ema(c,60)+10);
End;
SetStopTrailing(20,100,PointStop);
즐거운 하루되세요
> 엠씨용가 님이 쓴 글입니다.
> 제목 : 청산 후 재진입 수식
> 안녕하세요 ^^ 청산후 재진입 수식에 대한 질문입니다
청산후 2개봉 이후에 재진입을 하고싶은데 청산직후에 바로 진입이 들어가고 있습니다.
진입수식에 barssinceexit(1) > 2 를 넣으면 매매신호가 전혀 발생하지 않네요
var : mp(0);
if mp == 0 and mp[1] <> 0 then recnt = 1;
if mp == 0 then recnt = recnt + 1;
if mp <> 0 then recnt = 0;
또는 진입수식에 recnt > 1을 넣어도 청산후 재진입이 바로 되고 있습니다. 방법 좀 알려주시면 감사하겠습니다 ^^
아래 수식 참고해주십쇼 ^^
input : Highest_(10), Lowest_(10),TARGET(60);
var : pl(0),mp(0),recnt(0),p(0),pp(0);
p = IFf(CountIf(CrossDown(c,Ema(c,60)),10) >= 1,20,0);
if MarketPosition == 0 and h < Ema(c,60) Then Sell("s",AtStop,Lowest(l,Lowest_)- 20 -p );
if MarketPosition == -1 Then begin
if BarsSinceEntry < 3 Then ExitShort("es1",AtStop,Lowest(l,BarsSinceEntry) + 20);
else ExitShort("es",AtStop,Ema(c,60)+10);
End;
SetStopTrailing(20,100,PointStop);