커뮤니티

문의드립니다.

프로필 이미지
잡다백수
2019-05-10 10:59:40
162
글번호 128566
답변완료
도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다. 원수식 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then buy("b2",AtStop, HH + n * PriceScale, 매수단위); if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 1. 시스템 원수식에서 3번째 추가 진입부터는 수량을 '매수단위'의 2배로 하게 부탁드립니다. (이후에는 2배한 걸로 고정) 2. 시스템 원수식에서 n번째 추가진입부터는 진입수량을 '매수단위'의 n2배로 하게 부탁드립니다. (n번째 이후에는 n2배로 고정) 3. 시스템 1번 완성 수식에서 4번째 수식부터는 추가진입수량에서 수량을 1개씩 추가하게 부탁드립니다. 가령 3번째에 수량 2개이면 4번째는 수량 3개, 5번째는 수량 4개. 4. 시스템 2번 완성 수식에서 n번째 다음부터는 진입수량을 1개씩 추가하게 부탁드립니다. 가령 n번째가 수량 2개이면 n번째 다음에는 수량 3개, n번째 다다음에는 수량 4개.
시스템
답변 4
프로필 이미지

예스스탁 예스스탁 답변

2019-05-10 14:10:33

안녕하세요 예스스탁입니다. 1 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= 2 Then vol = 매수단위*2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 2 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= Nentry-1 Then vol = 매수단위*N2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 3 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == 2 Then vol = 매수단위*2; else if count >= 3 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 4 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == Nentry Then vol = 매수단위*N2; else if count >= 4 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : 문의드립니다. > 도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다. 원수식 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then buy("b2",AtStop, HH + n * PriceScale, 매수단위); if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 1. 시스템 원수식에서 3번째 추가 진입부터는 수량을 '매수단위'의 2배로 하게 부탁드립니다. (이후에는 2배한 걸로 고정) 2. 시스템 원수식에서 n번째 추가진입부터는 진입수량을 '매수단위'의 n2배로 하게 부탁드립니다. (n번째 이후에는 n2배로 고정) 3. 시스템 1번 완성 수식에서 4번째 수식부터는 추가진입수량에서 수량을 1개씩 추가하게 부탁드립니다. 가령 3번째에 수량 2개이면 4번째는 수량 3개, 5번째는 수량 4개. 4. 시스템 2번 완성 수식에서 n번째 다음부터는 진입수량을 1개씩 추가하게 부탁드립니다. 가령 n번째가 수량 2개이면 n번째 다음에는 수량 3개, n번째 다다음에는 수량 4개.
프로필 이미지

잡다백수

2019-05-10 14:21:50

코딩 감사합니다. 추가진입이 2개(수익일 때 추가진입, 피라미딩 추가진입)가 있는데 그냥 추가진입이라고 쓰니 b2 추가진입으로 다 작성해주신 듯 합니다. 저 피라미딩 진입인 bb 추가진입으로 수정 부탁드립니다. 즐거운 주말 되세요~~~~ 아니면 추가 피라미딩 진입 부분을 그냥 아래같은 형식으로 고치면 되는 건가요? if MarketPosition == 1 Then { if count >= 2 Then vol = 매수단위*2; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다. > 안녕하세요 예스스탁입니다. 1 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= 2 Then vol = 매수단위*2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 2 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= Nentry-1 Then vol = 매수단위*N2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 3 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == 2 Then vol = 매수단위*2; else if count >= 3 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 4 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == Nentry Then vol = 매수단위*N2; else if count >= 4 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : 문의드립니다. > 도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다. 원수식 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then buy("b2",AtStop, HH + n * PriceScale, 매수단위); if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 1. 시스템 원수식에서 3번째 추가 진입부터는 수량을 '매수단위'의 2배로 하게 부탁드립니다. (이후에는 2배한 걸로 고정) 2. 시스템 원수식에서 n번째 추가진입부터는 진입수량을 '매수단위'의 n2배로 하게 부탁드립니다. (n번째 이후에는 n2배로 고정) 3. 시스템 1번 완성 수식에서 4번째 수식부터는 추가진입수량에서 수량을 1개씩 추가하게 부탁드립니다. 가령 3번째에 수량 2개이면 4번째는 수량 3개, 5번째는 수량 4개. 4. 시스템 2번 완성 수식에서 n번째 다음부터는 진입수량을 1개씩 추가하게 부탁드립니다. 가령 n번째가 수량 2개이면 n번째 다음에는 수량 3개, n번째 다다음에는 수량 4개.
프로필 이미지

예스스탁 예스스탁 답변

2019-05-10 15:01:03

안녕하세요 예스스탁입니다. bb진입으로 모두 변경해 드립니다. 1 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries >= 2 Then vol = 매수단위*2; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 2 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries >= Nentry-1 Then vol = 매수단위*N2; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 3 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries == 2 Then vol = 매수단위*2; else if MaxEntries >= 3 Then vol = vol+1; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 4 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries == Nentry-1 Then vol = 매수단위*N2; else if MaxEntries >= Nentry Then vol = vol+1; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : Re : Re : 문의드립니다. > 코딩 감사합니다. 추가진입이 2개(수익일 때 추가진입, 피라미딩 추가진입)가 있는데 그냥 추가진입이라고 쓰니 b2 추가진입으로 다 작성해주신 듯 합니다. 저 피라미딩 진입인 bb 추가진입으로 수정 부탁드립니다. 즐거운 주말 되세요~~~~ 아니면 추가 피라미딩 진입 부분을 그냥 아래같은 형식으로 고치면 되는 건가요? if MarketPosition == 1 Then { if count >= 2 Then vol = 매수단위*2; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다. > 안녕하세요 예스스탁입니다. 1 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= 2 Then vol = 매수단위*2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 2 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= Nentry-1 Then vol = 매수단위*N2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 3 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == 2 Then vol = 매수단위*2; else if count >= 3 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 4 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == Nentry Then vol = 매수단위*N2; else if count >= 4 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : 문의드립니다. > 도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다. 원수식 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then buy("b2",AtStop, HH + n * PriceScale, 매수단위); if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 1. 시스템 원수식에서 3번째 추가 진입부터는 수량을 '매수단위'의 2배로 하게 부탁드립니다. (이후에는 2배한 걸로 고정) 2. 시스템 원수식에서 n번째 추가진입부터는 진입수량을 '매수단위'의 n2배로 하게 부탁드립니다. (n번째 이후에는 n2배로 고정) 3. 시스템 1번 완성 수식에서 4번째 수식부터는 추가진입수량에서 수량을 1개씩 추가하게 부탁드립니다. 가령 3번째에 수량 2개이면 4번째는 수량 3개, 5번째는 수량 4개. 4. 시스템 2번 완성 수식에서 n번째 다음부터는 진입수량을 1개씩 추가하게 부탁드립니다. 가령 n번째가 수량 2개이면 n번째 다음에는 수량 3개, n번째 다다음에는 수량 4개.
프로필 이미지

잡다백수

2019-05-11 10:59:00

코딩 감사합니다. 그런데 일정 기간 후 수량 하나씩 더 추가하는 수식이요. (vol = vol+1; 들어간 것들) 써보면 그림같이 이상하게 곱해진 수량이 추가됩니다. 그러니까 3번째부터 2개들어가면 그 다음에 3개 들어가는게 아니라 58개 이렇게 수량이 추가되네요. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 문의드립니다. > 안녕하세요 예스스탁입니다. bb진입으로 모두 변경해 드립니다. 1 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries >= 2 Then vol = 매수단위*2; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 2 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries >= Nentry-1 Then vol = 매수단위*N2; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 3 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries == 2 Then vol = 매수단위*2; else if MaxEntries >= 3 Then vol = vol+1; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 4 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { buy("b2",AtStop, HH + n * PriceScale, 매수단위); } if MarketPosition == 1 Then { if MaxEntries == Nentry-1 Then vol = 매수단위*N2; else if MaxEntries >= Nentry Then vol = vol+1; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : Re : Re : 문의드립니다. > 코딩 감사합니다. 추가진입이 2개(수익일 때 추가진입, 피라미딩 추가진입)가 있는데 그냥 추가진입이라고 쓰니 b2 추가진입으로 다 작성해주신 듯 합니다. 저 피라미딩 진입인 bb 추가진입으로 수정 부탁드립니다. 즐거운 주말 되세요~~~~ 아니면 추가 피라미딩 진입 부분을 그냥 아래같은 형식으로 고치면 되는 건가요? if MarketPosition == 1 Then { if count >= 2 Then vol = 매수단위*2; Else vol = 매수단위; //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,vol); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다. > 안녕하세요 예스스탁입니다. 1 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= 2 Then vol = 매수단위*2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 2 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count >= Nentry-1 Then vol = 매수단위*N2; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 3 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == 2 Then vol = 매수단위*2; else if count >= 3 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 4 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2),Nentry(3),N2(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); var : vol(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then { if count == Nentry Then vol = 매수단위*N2; else if count >= 4 Then vol = vol+1; Else vol = 매수단위; buy("b2",AtStop, HH + n * PriceScale, vol); } if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 즐거운 하루되세요 > 잡다백수 님이 쓴 글입니다. > 제목 : 문의드립니다. > 도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다. 원수식 input: ATR기간(3),ATR곱셈(3),n(5),당일진입횟수(2); var : 매수단위(0),투입금액(0),ATRV(0),count(0),HH(0); ATRV = atr(ATR기간); 매수단위 = 1; #진입회수제한 Count = 0 ; for Value1 = 0 to 10 { if EntryDate( Value1 ) == sdate then Count = Count + 1; } #당일첫번째 진입(기존조건으로 진입) if MarketPosition <= 0 and Count == 0 and NextBarSdate == sdate then buy("b1",AtStop,dayopen + n * PriceScale, 매수단위); #당일 두번째 진입부터 당일 N번째 진입까지 #직전 매수거래의 최고가 아래에서 가격이 상승해 최고가 이상의 시세 발생시 매수진입 if MarketPosition <= 0 and Count >= 1 and Count < 당일진입횟수 and stime > 100000 and H < HH + n * PriceScale and PositionProfit(1) >= 0 and NextBarSdate == sdate then buy("b2",AtStop, HH + n * PriceScale, 매수단위); if MarketPosition == 1 Then { //진입이후 최고가 HH = highest(H,BarsSinceEntry); if NextBarSdate == sdate Then buy("bb",AtStop,LatestEntryPrice(0)+ATR곱셈*ATRV*2 ,매수단위); ExitLong("bx2",AtStop,LatestEntryPrice(0)-ATR곱셈*ATRV ); } 1. 시스템 원수식에서 3번째 추가 진입부터는 수량을 '매수단위'의 2배로 하게 부탁드립니다. (이후에는 2배한 걸로 고정) 2. 시스템 원수식에서 n번째 추가진입부터는 진입수량을 '매수단위'의 n2배로 하게 부탁드립니다. (n번째 이후에는 n2배로 고정) 3. 시스템 1번 완성 수식에서 4번째 수식부터는 추가진입수량에서 수량을 1개씩 추가하게 부탁드립니다. 가령 3번째에 수량 2개이면 4번째는 수량 3개, 5번째는 수량 4개. 4. 시스템 2번 완성 수식에서 n번째 다음부터는 진입수량을 1개씩 추가하게 부탁드립니다. 가령 n번째가 수량 2개이면 n번째 다음에는 수량 3개, n번째 다다음에는 수량 4개.