커뮤니티

시스템

프로필 이미지
달마7
2024-03-07 00:18:09
796
글번호 177242
답변완료
안녕하세요 아래두가지 질문올림니다 가령 Input : Period1(5),Period2(10); if crossup(c,ma(5)) then buy(); 매수일때는 손실 10틱 수익 20틱 if crossdown(c,ma(10)) then sell(); 매도일때는 손실 20틱 수익 40틱 이렇게 매수와매도시 수익과 손실을 달리하고싶습니다 두번째 트레일링스탑질문입니다 가령 매수진입시 손실10틱 설정하고 20틱이상 수익시 고점대비 -10틱 아래로떨어졌을때 청산수식 부탁드립니다 수고하세요 감사합니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-03-07 10:19:20

안녕하세요 예스스탁입니다. 1 Input : Period1(5),Period2(10); if crossup(c,ma(c,5)) then buy(); if crossdown(c,ma(c,10)) then sell(); if MarketPosition == 1 Then { ExitLong("bl",AtStop,EntryPrice-PriceScale*10); ExitLong("bp",AtLimit,EntryPrice+PriceScale*20); } if MarketPosition == -1 Then { ExitShort("sl",AtStop,EntryPrice+PriceScale*20); ExitShort("sp",AtLimit,EntryPrice-PriceScale*40); } 2 Input : Period1(5),Period2(10); if crossup(c,ma(c,5)) then buy(); if crossdown(c,ma(c,10)) then sell(); if MarketPosition == 1 Then { ExitLong("bl",AtStop,EntryPrice-PriceScale*10); if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then ExitLong("btr",AtStop,highest(H,BarsSinceEntry)-PriceScale*10); } if MarketPosition == -1 Then { ExitShort("sl",AtStop,EntryPrice+PriceScale*20); if lowest(L,BarsSinceEntry) <= EntryPrice+PriceScale*40 Then ExitShort("str",AtStop,lowest(L,BarsSinceEntry)+PriceScale*20); } 즐거운 하루되세요 > 달마7 님이 쓴 글입니다. > 제목 : 시스템 > 안녕하세요 아래두가지 질문올림니다 가령 Input : Period1(5),Period2(10); if crossup(c,ma(5)) then buy(); 매수일때는 손실 10틱 수익 20틱 if crossdown(c,ma(10)) then sell(); 매도일때는 손실 20틱 수익 40틱 이렇게 매수와매도시 수익과 손실을 달리하고싶습니다 두번째 트레일링스탑질문입니다 가령 매수진입시 손실10틱 설정하고 20틱이상 수익시 고점대비 -10틱 아래로떨어졌을때 청산수식 부탁드립니다 수고하세요 감사합니다