커뮤니티
문의드립니다.
2018-01-05 10:09:29
136
글번호 115491
안녕하세요~ 조금 늦었지만 새해 복 많이 받으세요~
[문의내용] 진입전략이 3가지 일때 진입전략 별로 Setstoptrailing 설정이 가능할까요?
예>
if ma1 > ma2
Then Buy("매수1");
if ma2 > ma3
Then Buy("매수2");
if ma3 > ma4
Then Buy("매수3");
매수1에대해서 SetStopTrailing(20,50,PointStop);
매수2에대해서 SetStopTrailing(30,60,PointStop);
매수3에대해서 SetStopTrailing(35,70,PointStop); 이런 방식으로 진입별 기준을 다르게 설정이 가능한지 궁금합니다.
그럼 수고하세요~
답변 1
예스스탁 예스스탁 답변
2018-01-08 10:55:05
안녕하세요
예스스탁입니다.
아래와 같이 풀어서 작성하셔야 합니다.
청산함수에 진입명을 지정하면 해당 진입이 발생했을때만 동작합니다.
if ma1 > ma2 Then Buy("매수1");
if ma2 > ma3 Then Buy("매수2");
if ma3 > ma4 Then Buy("매수3");
if MarketPosition == 1 Then{
var1 = highest(h,BarsSinceEntry);
if var1 >= EntryPrice+50 Then
ExitLong("btr1",AtStop,var1-20,"매수1");
if var1 >= EntryPrice+60 Then
ExitLong("btr2",AtStop,var1-30,"매수2");
if var1 >= EntryPrice+70 Then
ExitLong("btr3",AtStop,var1-35,"매수3");
}
새해 복 많이 받으세요
> 휴먼 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요~ 조금 늦었지만 새해 복 많이 받으세요~
[문의내용] 진입전략이 3가지 일때 진입전략 별로 Setstoptrailing 설정이 가능할까요?
예>
if ma1 > ma2
Then Buy("매수1");
if ma2 > ma3
Then Buy("매수2");
if ma3 > ma4
Then Buy("매수3");
매수1에대해서 SetStopTrailing(20,50,PointStop);
매수2에대해서 SetStopTrailing(30,60,PointStop);
매수3에대해서 SetStopTrailing(35,70,PointStop); 이런 방식으로 진입별 기준을 다르게 설정이 가능한지 궁금합니다.
그럼 수고하세요~