커뮤니티

문의 드립니다.

프로필 이미지
비츠로
2012-01-17 10:16:29
270
글번호 46690
답변완료
아래식에서 청산식중 데이타2 참조로 ADX(13)이 40이상일때부턴 bbx,ssx만 적용이 되도록 부탁드립니다. 일단 40이 돌파되면 40아래로 떨어져도 무조건 bbx,ssx만 적용을 합니다. 40 돌파되전엔 bx, sx만 체결되도록 부탁드립니다. 또 하나더 추가하자면 bPt1 sPT1처럼 bbx,ssx도 청산되면 무포지션에서 반대로만 진입이 되도록 부탁드립니다. Input : shortPeriod(5), longPeriod(20), period(36); var : cnt(0),count(0); value1 = ema(C, shortPeriod); value2 = ema(C, longPeriod); value3= ema(C, Period); count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then count = count+1; } condition1 = count == 0 or (count >= 1 and (MarketPosition == -1 or (MarketPosition == 0 and IsExitName("bPt1",1) == false))); condition2 = count == 0 or (count >= 1 and (MarketPosition == 1 or (MarketPosition == 0 and IsExitName("sPT1",1) == false))); if Condition1 == true and value1> value2 and value3 > value3[1] Then buy("b"); if Condition2 == true and value1<value2 and value3 < value3[1] Then sell("s"); if MarketPosition == 1 and value3 < value3[1] Then ExitLong("bx"); if MarketPosition == 1 and value2 < value2[1] Then ExitLong("bbx"); if MarketPosition == -1 and value3 > value3[1] Then ExitShort("sx"); if MarketPosition == -1 and value2 > value2[1] Then ExitShort("ssx"); if MarketPosition !=0 Then{ ExitLong("bPT1",atLimit,EntryPrice+1);#진입가+1포인트 매수청산 ExitShort("SPT1",AtLimit,EntryPrice-1);#진입가-1포인트 매도청산 }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-01-17 14:27:54

안녕하세요 예스스탁입니다. Input : shortPeriod(5), longPeriod(20), period(36),ADXP(14); var : cnt(0),count(0),d2adx(0,data2),cond(false,data2); d2adx = data2(ADX(ADXP)); value1 = ema(C, shortPeriod); value2 = ema(C, longPeriod); value3= ema(C, Period); if data2(date != date[1]) then cond = false; if d2adx >= 40 Then cond = true; count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then count = count+1; } condition1 = count == 0 or (count >= 1 and (MarketPosition == -1 or (MarketPosition == 0 and IsExitName("bbx",1) == false))); condition2 = count == 0 or (count >= 1 and (MarketPosition == 1 or (MarketPosition == 0 and IsExitName("ssx",1) == false))); if Condition1 == true and value1> value2 and value3 > value3[1] Then buy("b"); if Condition2 == true and value1<value2 and value3 < value3[1] Then sell("s"); if MarketPosition == 1 and value3 < value3[1] and cond == false Then ExitLong("bx"); if MarketPosition == 1 and value2 < value2[1] and cond == true Then ExitLong("bbx"); if MarketPosition == -1 and value3 > value3[1] and cond == false Then ExitShort("sx"); if MarketPosition == -1 and value2 > value2[1] and cond == true Then ExitShort("ssx"); 즐거운 하루되세요 > 비츠로 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 아래식에서 청산식중 데이타2 참조로 ADX(13)이 40이상일때부턴 bbx,ssx만 적용이 되도록 부탁드립니다. 일단 40이 돌파되면 40아래로 떨어져도 무조건 bbx,ssx만 적용을 합니다. 40 돌파되전엔 bx, sx만 체결되도록 부탁드립니다. 또 하나더 추가하자면 bPt1 sPT1처럼 bbx,ssx도 청산되면 무포지션에서 반대로만 진입이 되도록 부탁드립니다. Input : shortPeriod(5), longPeriod(20), period(36); var : cnt(0),count(0); value1 = ema(C, shortPeriod); value2 = ema(C, longPeriod); value3= ema(C, Period); count = 0; for cnt = 0 to 10{ if sdate == EntryDate(cnt) Then count = count+1; } condition1 = count == 0 or (count >= 1 and (MarketPosition == -1 or (MarketPosition == 0 and IsExitName("bPt1",1) == false))); condition2 = count == 0 or (count >= 1 and (MarketPosition == 1 or (MarketPosition == 0 and IsExitName("sPT1",1) == false))); if Condition1 == true and value1> value2 and value3 > value3[1] Then buy("b"); if Condition2 == true and value1<value2 and value3 < value3[1] Then sell("s"); if MarketPosition == 1 and value3 < value3[1] Then ExitLong("bx"); if MarketPosition == 1 and value2 < value2[1] Then ExitLong("bbx"); if MarketPosition == -1 and value3 > value3[1] Then ExitShort("sx"); if MarketPosition == -1 and value2 > value2[1] Then ExitShort("ssx"); if MarketPosition !=0 Then{ ExitLong("bPT1",atLimit,EntryPrice+1);#진입가+1포인트 매수청산 ExitShort("SPT1",AtLimit,EntryPrice-1);#진입가-1포인트 매도청산 }