커뮤니티

갯수제한?

프로필 이미지
노블사랑
2013-03-07 17:10:31
159
글번호 60406
답변완료
수고하십니다. 아래 로직을 돌려보니 손절을 할때마다(이익실현전까지) 주문 갯수가 계속 배가 되는데.. 최대 갯수를 정하고 싶습니다. 아래보면 첨엔 1개 그담 2개 4개 8개 이런식으로 계속 들어가는데(익절하면 다시 처음1개로),... 최대갯수를 일정수 예로 20개 이렇게 정하고 싶습니다. 부탁드립니다. if dayindex >= 0 and stime < 150000 Then{ IF MarketPosition <= 0 and h < dayopen+PriceScale*1 Then buy("b",AtStop,dayopen+PriceScale*1,IFF(MarketPosition != 0,CurrentContracts*2,1)); IF MarketPosition >= 0 and L > dayopen-PriceScale*1 Then SELL("S",AtStop,dayopen-PriceScale*1,IFF(MarketPosition != 0,CurrentContracts*2,1)); } SetStopProfittarget(0.5,PointStop);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-03-07 17:46:21

안녕하세요 예스스탁입니다. input : 최대진입수량(20); if dayindex >= 0 and stime < 150000 Then{ IF MarketPosition <= 0 and h < dayopen+PriceScale*1 Then buy("b",AtStop,dayopen+PriceScale*1,min(IFF(MarketPosition != 0,CurrentContracts*2,1),최대진입수량)); IF MarketPosition >= 0 and L > dayopen-PriceScale*1 Then SELL("S",AtStop,dayopen-PriceScale*1,min(IFF(MarketPosition != 0,CurrentContracts*2,1),최대진입수량)); } SetStopProfittarget(0.5,PointStop); 즐거운 하루되세요 > 노블사랑 님이 쓴 글입니다. > 제목 : 갯수제한? > 수고하십니다. 아래 로직을 돌려보니 손절을 할때마다(이익실현전까지) 주문 갯수가 계속 배가 되는데.. 최대 갯수를 정하고 싶습니다. 아래보면 첨엔 1개 그담 2개 4개 8개 이런식으로 계속 들어가는데(익절하면 다시 처음1개로),... 최대갯수를 일정수 예로 20개 이렇게 정하고 싶습니다. 부탁드립니다. if dayindex >= 0 and stime < 150000 Then{ IF MarketPosition <= 0 and h < dayopen+PriceScale*1 Then buy("b",AtStop,dayopen+PriceScale*1,IFF(MarketPosition != 0,CurrentContracts*2,1)); IF MarketPosition >= 0 and L > dayopen-PriceScale*1 Then SELL("S",AtStop,dayopen-PriceScale*1,IFF(MarketPosition != 0,CurrentContracts*2,1)); } SetStopProfittarget(0.5,PointStop);