커뮤니티
손절 수정
2015-05-13 02:27:51
127
글번호 85963
Input : shortPeriod(5), longPeriod(20);
Var : 단기이평(0), 장기이평(0);
단기이평 = ma(C, shortPeriod);
장기이평 = ma(C, longPeriod);
if crossup(단기이평, 장기이평) then buy();
if crossdown(단기이평, 장기이평) then sell();
1. 손절은 1.0 pt로하고 수익 0.5 pt 발생시 손절을 0.1 pt 로 조정하고 싶읍니다.
2. 진입 후 0.5 pt 수익발생 후 반대로 진행시 0.1 pt 이익 으로 청산하고 싶읍니다.
수식 부탁합니다.
답변 1
예스스탁 예스스탁 답변
2015-05-13 10:35:17
안녕하세요
예스스탁입니다.
단기이평 = ma(C, shortPeriod);
장기이평 = ma(C, longPeriod);
if crossup(단기이평, 장기이평) then buy();
if crossdown(단기이평, 장기이평) then sell();
if MarketPosition == 1 Then{
var1 = highest(H,BarsSinceEntry);
if var1 < EntryPrice+0.5 then
ExitLong("bL1",AtStop,EntryPrice-1.0);
Else
ExitLong("bL2",AtStop,EntryPrice-0.1);
if var1 >= EntryPrice+0.5 then
ExitLong("bP",AtStop,EntryPrice+0.1);
}
if MarketPosition == -1 Then{
var2 = highest(L,BarsSinceEntry);
if var2 > EntryPrice-0.5 then
ExitShort("sL1",AtStop,EntryPrice+1.0);
Else
ExitShort("sL2",AtStop,EntryPrice+0.1);
if var1 <= EntryPrice-0.5 then
ExitShort("sP",AtStop,EntryPrice-0.1);
}
즐거운 하루되세요
> HI_SE****** 님이 쓴 글입니다.
> 제목 : 손절 수정
> Input : shortPeriod(5), longPeriod(20);
Var : 단기이평(0), 장기이평(0);
단기이평 = ma(C, shortPeriod);
장기이평 = ma(C, longPeriod);
if crossup(단기이평, 장기이평) then buy();
if crossdown(단기이평, 장기이평) then sell();
1. 손절은 1.0 pt로하고 수익 0.5 pt 발생시 손절을 0.1 pt 로 조정하고 싶읍니다.
2. 진입 후 0.5 pt 수익발생 후 반대로 진행시 0.1 pt 이익 으로 청산하고 싶읍니다.
수식 부탁합니다.