커뮤니티

문의

프로필 이미지
주식달인
2008-10-29 23:43:56
585
글번호 17772
답변완료
var : cnt1(0),cnt2(0); if date != date[1] Then{ cnt1 = 0; cnt2 = 0; } if stime >= 90000 and stime < 140000 Then{ if MarketPosition() == 0 and crossup(ma(c,20),ma(c,100)) and cnt1 < 3 Then{ buy("b1"); cnt1 = cnt1+1; } } if stime >= 110000 and stime < 142000 Then{ if /*MarketPosition() == 0 and*/ dayhigh()*0.995 and cnt2 < 3 Then{ buy("B2",OnClose,def,3); cnt2 = cnt2+1; } } if IsEntryName("b1") == true Then SetStopLoss(0.5); Else if IsEntryName("b2") == true Then SetStopLoss(0.3); Else SetStopLoss(0); 상기식에서 "b1"에 경우에는 청산식을 0.5 손절시 청산 or 5ma가 20ma을 하향할경우에 청산하는 수식으로 전환가능한가요. 아울러 "b2"의 경우에는 손절식은 그대로하고 익절방법을 20%아상 상승후 일정부분 하락시 트레일링스톱하는 수식을 추가할수있나요. 미리 감사 드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2008-10-30 14:15:54

안녕하세요 예스스탁입니다. 1. b1의 손절을 0.5로 변겨아면 b1과 같으므로 SetStopLoss(0.5);와 같이만 추가하시면 됩니다. var : cnt1(0),cnt2(0); if date != date[1] Then{ cnt1 = 0; cnt2 = 0; } if stime >= 90000 and stime < 140000 Then{ if MarketPosition() == 0 and crossup(ma(c,20),ma(c,100)) and cnt1 < 3 Then{ buy("b1"); cnt1 = cnt1+1; } } if stime >= 110000 and stime < 142000 Then{ if /*MarketPosition() == 0 and*/ dayhigh()*0.995 and cnt2 < 3 Then{ buy("B2",OnClose,def,3); cnt2 = cnt2+1; } } if IsEntryName("b1") == true and CrossDown(ma(c,5),ma(c,20)) Then exitlong("매수청산"); SetStopLoss(0.5); 2. B2진입일 경우 익절 upv 상승%이며 dnv는 하락%입니다. input : dnv(10),upv(20); var : cnt1(0),cnt2(0); if date != date[1] Then{ cnt1 = 0; cnt2 = 0; } if stime >= 90000 and stime < 140000 Then{ if MarketPosition() == 0 and crossup(ma(c,20),ma(c,100)) and cnt1 < 3 Then{ buy("b1"); cnt1 = cnt1+1; } } if stime >= 110000 and stime < 142000 Then{ if /*MarketPosition() == 0 and*/ dayhigh()*0.995 and cnt2 < 3 Then{ buy("B2",OnClose,def,3); cnt2 = cnt2+1; } } if IsEntryName("b1") == true and CrossDown(ma(c,5),ma(c,20)) Then exitlong("매수청산"); if IsEntryName("b1") == true Then SetStopLoss(0.5); Else if IsEntryName("b2") == true Then SetStopLoss(0.3); Else SetStopLoss(0); if IsEntryName("B2") == true Then SetStopTrailing(dnv,upv,PercentStop,1); Else SetStopTrailing(0,0); 즐거운 하루되세요 > 주식달인 님이 쓴 글입니다. > 제목 : 문의 > var : cnt1(0),cnt2(0); if date != date[1] Then{ cnt1 = 0; cnt2 = 0; } if stime >= 90000 and stime < 140000 Then{ if MarketPosition() == 0 and crossup(ma(c,20),ma(c,100)) and cnt1 < 3 Then{ buy("b1"); cnt1 = cnt1+1; } } if stime >= 110000 and stime < 142000 Then{ if /*MarketPosition() == 0 and*/ dayhigh()*0.995 and cnt2 < 3 Then{ buy("B2",OnClose,def,3); cnt2 = cnt2+1; } } if IsEntryName("b1") == true Then SetStopLoss(0.5); Else if IsEntryName("b2") == true Then SetStopLoss(0.3); Else SetStopLoss(0); 상기식에서 "b1"에 경우에는 청산식을 0.5 손절시 청산 or 5ma가 20ma을 하향할경우에 청산하는 수식으로 전환가능한가요. 아울러 "b2"의 경우에는 손절식은 그대로하고 익절방법을 20%아상 상승후 일정부분 하락시 트레일링스톱하는 수식을 추가할수있나요. 미리 감사 드립니다.