커뮤니티

문의

프로필 이미지
주식달인
2008-10-04 00:49:56
885
글번호 17324
답변완료
항상 친절한 답변 감사드립니다. var : cnt1(0),cnt2(0),cnt3(0); if date != date[1] Then{ cnt1 = 0; cnt2 = 0; cnt3 = 0; } if stime >= 90000 and stime < 140000 Then{ if MarketPosition() == 0 and crossup(ma(c,20),ma(c,100)) and cnt1 < 3 Then{ buy(); cnt1 = cnt1+1; SetStopLoss(0.5); } } if stime >= 110000 and stime < 142000 Then{ if MarketPosition() == 0 and dayhigh()*0.995 and cnt2 < 3 Then{ buy(); cnt2 = cnt2+1; SetStopLoss(0.3); } } if stime >= 130000 and stime < 150000 Then{ if MarketPosition() == 0 and C < Lowest(L,20)[1] and cnt3 < 1 Then{ buy(); cnt3 = cnt3+1; } } SetStopLoss(0.2); 상기 수식에서 cnt2 에서는 기존의 포지션이 있을 경우에도 매수시그널이 나오면 주문을 나가게 하는데 한번주문시 마다 3게약씩 나가게 할수 있나요. 동일한 방법으로 cnt3 에서도 기존의 포지션이 있는 경우나 없는 경우에도 매수 시그널이 나오면 주문을 나가게 하는데 한번 주문시 마다 1계약으로 고정하는 수식을 부탁합니다. 아울러 각각 주문마다 다른 손절수식을 적용하고 싶습니다. 미리 감사 드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2008-10-06 09:14:00

안녕하세요 예스스탁입니다. 매수포지션 진입 시 다시 매수포지션을 추가매수를 하시려면 피라미딩 기능을 사용하셔야 합니다. 진입식의 marketposition() == 0이라면 부분은 무포지션 상태에서만 진입해라 이므로 2번째,3번째 진입식에서 이부분을 없애시면 2번째와 3번째는 매수포지션이 있는 상태에서도 신호를 발생해 수량을 누적하게 됩니다. 또한 첫 진입에 의해 손절값이 정해집니다. var : cnt1(0),cnt2(0),cnt3(0); if date != date[1] Then{ cnt1 = 0; cnt2 = 0; cnt3 = 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 stime >= 130000 and stime < 150000 Then{ if /*MarketPosition() == 0 and*/ C < Lowest(L,20)[1] and cnt3 < 1 Then{ buy("b3",OnClose,def,1); cnt3 = cnt3+1; } } if IsEntryName("b1") == true Then SetStopLoss(0.5); Else if IsEntryName("b2") == true Then SetStopLoss(0.3); Else if IsEntryName("b3") == true Then SetStopLoss(0.2); Else SetStopLoss(0); 즐거운 하루되세요 > 주식달인 님이 쓴 글입니다. > 제목 : 문의 > 항상 친절한 답변 감사드립니다. var : cnt1(0),cnt2(0),cnt3(0); if date != date[1] Then{ cnt1 = 0; cnt2 = 0; cnt3 = 0; } if stime >= 90000 and stime < 140000 Then{ if MarketPosition() == 0 and crossup(ma(c,20),ma(c,100)) and cnt1 < 3 Then{ buy(); cnt1 = cnt1+1; SetStopLoss(0.5); } } if stime >= 110000 and stime < 142000 Then{ if MarketPosition() == 0 and dayhigh()*0.995 and cnt2 < 3 Then{ buy(); cnt2 = cnt2+1; SetStopLoss(0.3); } } if stime >= 130000 and stime < 150000 Then{ if MarketPosition() == 0 and C < Lowest(L,20)[1] and cnt3 < 1 Then{ buy(); cnt3 = cnt3+1; } } SetStopLoss(0.2); 상기 수식에서 cnt2 에서는 기존의 포지션이 있을 경우에도 매수시그널이 나오면 주문을 나가게 하는데 한번주문시 마다 3게약씩 나가게 할수 있나요. 동일한 방법으로 cnt3 에서도 기존의 포지션이 있는 경우나 없는 경우에도 매수 시그널이 나오면 주문을 나가게 하는데 한번 주문시 마다 1계약으로 고정하는 수식을 부탁합니다. 아울러 각각 주문마다 다른 손절수식을 적용하고 싶습니다. 미리 감사 드립니다.