커뮤니티
Turtle- 매수식 에서 매도식을 좀 만들어주세요
2011-04-26 08:44:31
868
글번호 37949
//[매수진입] 20H
//[손절매] 10L
//[추가진입] 20H+ATR/2
//- Trailing stop(2ATR) 이나 Stoploss(ATR/2) 사용
input : period(10);
if crossup(C,highest(H,20)[1]) Then
buy("매수");
if MarketPosition() == 1 and crossup(c,highest(H[1],20)*ATR(Period)/2) Then
buy("추가진입");
if MarketPosition() == 1 Then{
exitlong("손절매",atstop,lowest(L,10));
exitlong("Tr",AtStop,highest(H,BarsSinceEntry())-ATR(Period)*2);
exitlong("Stoploss",AtStop,EntryPrice()*ATR(PEriod)/2);
}
이 식은 책에 공개된 식으로, 추세구간 매수신호후 청산만 됩니다.
------------------------------------------------------------
추세구간 매도신호후 청산되도록 수정부탁드립니다.
crossup --> crossdown
H --> L, Highest--> Lowest,buy-->sell,exitlong--->exitshort 로 바꾸었는데
신호가 안나오네요??^^
ATR 부분을 손대야할 것 같은데, ATR에 대한 개념이 안 서 있어서,
이 부분을 고칠 수가 없습니다.
감사합니다.
답변 2
예스스탁 예스스탁 답변
2011-04-26 09:48:52
안녕하세요
예스스탁입니다.
input : period(10);
if crossup(C,highest(H,20)[1]) Then
buy("매수");
if CrossDown(C,Lowest(L,20)[1]) Then
Sell("매도");
if MarketPosition() == 1 and crossup(c,highest(H[1],20)+ATR(Period)/2) Then
buy("추가매수");
if MarketPosition() == -1 and CrossDown(c,Lowest(L[1],20)-ATR(Period)/2) Then
Sell("추가매도");
if MarketPosition() == 1 Then{
exitlong("B손절매",atstop,lowest(L,10));
exitlong("bTr",AtStop,highest(H,BarsSinceEntry)-ATR(Period)*2);
exitlong("bloss",AtStop,EntryPrice+ATR(PEriod)/2);
}
if MarketPosition() == -1 Then{
ExitShort("S손절매",atstop,Highest(H,10));
ExitShort("sTr",AtStop,Lowest(H,BarsSinceEntry)+ATR(Period)*2);
ExitShort("Sloss",AtStop,EntryPrice-ATR(PEriod)/2);
}
즐거운 하루되세요
> 선행 님이 쓴 글입니다.
> 제목 : Turtle- 매수식 에서 매도식을 좀 만들어주세요
> //[매수진입] 20H
//[손절매] 10L
//[추가진입] 20H+ATR/2
//- Trailing stop(2ATR) 이나 Stoploss(ATR/2) 사용
input : period(10);
if crossup(C,highest(H,20)[1]) Then
buy("매수");
if MarketPosition() == 1 and crossup(c,highest(H[1],20)*ATR(Period)/2) Then
buy("추가진입");
if MarketPosition() == 1 Then{
exitlong("손절매",atstop,lowest(L,10));
exitlong("Tr",AtStop,highest(H,BarsSinceEntry())-ATR(Period)*2);
exitlong("Stoploss",AtStop,EntryPrice()*ATR(PEriod)/2);
}
이 식은 책에 공개된 식으로, 추세구간 매수신호후 청산만 됩니다.
------------------------------------------------------------
추세구간 매도신호후 청산되도록 수정부탁드립니다.
crossup --> crossdown
H --> L, Highest--> Lowest,buy-->sell,exitlong--->exitshort 로 바꾸었는데
신호가 안나오네요??^^
ATR 부분을 손대야할 것 같은데, ATR에 대한 개념이 안 서 있어서,
이 부분을 고칠 수가 없습니다.
감사합니다.
선행
2011-04-26 15:00:06
감사합니다. 꾸벅
다음글