MP = MarketPosition;
if MP == 0 and MP[1] == 1 Then {
recnt = 1;
}
if MP == 0 and MP[1] == -1 Then{
recnt =1;
}
if MarketPosition == 0 and MarketPosition(1) == 1 and recnt < rebar Then {
recnt = 1+recnt:
buy("reentry", AtStop, Highest(H, traillbar);
}
If MarketPosition == 0 AND MarketPosition(1) == -1 AND ReCnt < ReBars then {
ReCnt = ReCnt + 1;
Sell ("Short ReEntry", atstop,Lowest(L , TrailBar ) ) ;
위 식은 청산 후 reabars봉이내에 traillbar의 최고(저)점을 넘으면 재진입하는 식인데요,
이걸 MP단락을 날려버리고 이런식으로 써도 되는건가요?
if MarketPosition == 0 and MarketPosition(1) == 1 and BarsSinceExit(1) >= 2 then {
buy(""Long ReEntry", AtStop, Highest(H, traillbar);
}
If MarketPosition == 0 AND MarketPosition(1) == -1 AND BarsSinceExit(1) >= 2 then {
Sell ("Short ReEntry", atstop,Lowest(L , TrailBar ) ) ;
답변 1
예스스탁
예스스탁 답변
2021-05-26 11:20:26
안녕하세요
예스스탁입니다.
예 MP단락은 필요가 없습니다.
BarsSinceExit(1), MarketPosition(1)
함수값을 이용하시면 됩니다.
다만 기존식이 rebar 이내이므로 BarsSinceExit(1) <= rebar 로 변경하시면 됩니다.
청산후 2봉이후 rebar봉 전이 됩니다.
if MarketPosition == 0 and MarketPosition(1) == 1 and BarsSinceExit(1) >= 2 and BarsSinceExit(1) < rebar then
{
buy("Long ReEntry", AtStop,Highest(H, traillbar));
}
If MarketPosition == 0 AND MarketPosition(1) == -1 AND BarsSinceExit(1) >= 2 and BarsSinceExit(1) < rebar then
{
Sell ("Short ReEntry", atstop,Lowest(L,TrailBar)) ;
}
즐거운 하루되세요
> 부동여산 님이 쓴 글입니다.
> 제목 : 수식 문의드립니다
>
MP = MarketPosition;
if MP == 0 and MP[1] == 1 Then {
recnt = 1;
}
if MP == 0 and MP[1] == -1 Then{
recnt =1;
}
if MarketPosition == 0 and MarketPosition(1) == 1 and recnt < rebar Then {
recnt = 1+recnt:
buy("reentry", AtStop, Highest(H, traillbar);
}
If MarketPosition == 0 AND MarketPosition(1) == -1 AND ReCnt < ReBars then {
ReCnt = ReCnt + 1;
Sell ("Short ReEntry", atstop,Lowest(L , TrailBar ) ) ;
위 식은 청산 후 reabars봉이내에 traillbar의 최고(저)점을 넘으면 재진입하는 식인데요,
이걸 MP단락을 날려버리고 이런식으로 써도 되는건가요?
if MarketPosition == 0 and MarketPosition(1) == 1 and BarsSinceExit(1) >= 2 then {
buy(""Long ReEntry", AtStop, Highest(H, traillbar);
}
If MarketPosition == 0 AND MarketPosition(1) == -1 AND BarsSinceExit(1) >= 2 then {
Sell ("Short ReEntry", atstop,Lowest(L , TrailBar ) ) ;