커뮤니티

거래가 발생하지 않는 구간이 생겨서요.

프로필 이미지
루시
2009-05-21 13:59:39
636
글번호 22337
답변완료

첨부 이미지

구현하기 어렵다는 필터는 시스템1에 필요한 거라서 시스템2만으로 시뮬을 해 보았는데요. 그림과 같이 장기간 거래가 발생하지 않는 구간이 생기네요. 분명히 고가를 돌파한 것 같은데 왜 진입을 하지 않는지 궁금합니다. 보내주신 식 중에서 다음 부분을 수정했습니다. if MarketPosition == 0 and CurrentEntries == 0 Then{ buy("b",AtStop,Highest(H,55)+PriceScale,unit); Sell("s",AtStop,Lowest(L,55)-PriceScale,unit); # H로 되어 있기에 L 로 바꾸었습니다.
시스템
답변 3
프로필 이미지

예스스탁

2009-05-21 15:25:34

관리자님에 의해 삭제된 답변입니다.
프로필 이미지

루시

2009-05-21 15:25:54

다시 만들어 주신 시스템 1으로 시뮬을 해 보았습니다. 그런데 마찬가지로 거래가 없는 구간이 장기간 발생하고, input 값의 최초 자본을 2억으로 하였더니 매수 구간이 다르게 발생하더라구요. 자금은 unit 값에만 영향을 미치고 진입시점에는 영향을 미치지 않도록 작성해 주신 것 같은데 왜 그런 현상이 발생하는지 모르겠습니다. 각각 1억일때와 2억일때입니다. > 루시 님이 쓴 글입니다. > 제목 : 거래가 발생하지 않는 구간이 생겨서요. > 구현하기 어렵다는 필터는 시스템1에 필요한 거라서 시스템2만으로 시뮬을 해 보았는데요. 그림과 같이 장기간 거래가 발생하지 않는 구간이 생기네요. 분명히 고가를 돌파한 것 같은데 왜 진입을 하지 않는지 궁금합니다. 보내주신 식 중에서 다음 부분을 수정했습니다. if MarketPosition == 0 and CurrentEntries == 0 Then{ buy("b",AtStop,Highest(H,55)+PriceScale,unit); Sell("s",AtStop,Lowest(L,55)-PriceScale,unit); # H로 되어 있기에 L 로 바꾸었습니다.
프로필 이미지

루시

2009-05-21 15:27:25

그렇다면 1억과 2억으로 했을 때 제가 위 질문과 같이 진입시점이 다른 이유는 무엇일까요? 자꾸 질문 드려서 죄송합니다.^^ > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 거래가 발생하지 않는 구간이 생겨서요. > 안녕하세요 예스스탁입니다. 해당내용은 수량을 산출하는 로직에 의해 수량이 0이 나오기 때문입니다. 투입금액을 N*오십만원으로 나눈후 1%를 곱하기에 수량이 0이 나옵니다. capital을 10억으로 설정하면 해당구간에 신호가 발생합니다. 식내용은 아래와 같습니다. input : Capital(1000000000); var : N(0),unit(0),value(0),entry(0); if CurrentBar == 1 Then N = (19*ATR(20)+TrueRange)/20; Else if CurrentBar > 1 Then N = (19*N[1]+TrueRange)/20; Else N = 0; value = (Capital+(NetProfit*BigPointValue)); if value > Capital*0.9 Then entry = Capital; if value <= Capital*0.9 Then entry = Capital*(0.8^1); if value <= (Capital*(0.8^1))*0.9 Then entry = (Capital*(0.8^2)); if value <= (Capital*(0.8^2))*0.9 Then entry = (Capital*(0.8^3)); if value <= (Capital*(0.8^3))*0.9 Then entry = (Capital*(0.8^4)); if value <= (Capital*(0.8^4))*0.9 Then entry = (Capital*(0.8^5)); if value <= (Capital*(0.8^5))*0.9 Then entry = (Capital*(0.8^6)); if value <= (Capital*(0.8^6))*0.9 Then entry = (Capital*(0.8^7)); if value <= (Capital*(0.8^7))*0.9 Then entry = (Capital*(0.8^8)); if value <= (Capital*(0.8^8))*0.9 Then entry = (Capital*(0.8^9)); unit = int((entry/(N*BigPointValue)*0.01)); if MarketPosition == 0 and CurrentEntries == 0 Then{ buy("b",AtStop,Highest(H,55)+PriceScale,unit); Sell("s",AtStop,Lowest(L,55)-PriceScale,unit); } if MarketPosition == 1 then{ if CurrentEntries == 1 Then buy("b1",AtStop,EntryPrice+(N[BarsSinceEntry]/2)*1,unit); if CurrentEntries == 2 Then buy("b2",AtStop,EntryPrice+(N[BarsSinceEntry]/2)*2,unit); if CurrentEntries == 3 Then buy("b3",AtStop,EntryPrice+(N[BarsSinceEntry]/2)*3,unit); } if MarketPosition == -1 then{ if CurrentEntries == 1 Then Sell("s1",AtStop,EntryPrice-(N[BarsSinceEntry]/2)*1,unit); if CurrentEntries == 2 Then Sell("s2",AtStop,EntryPrice-(N[BarsSinceEntry]/2)*2,unit); if CurrentEntries == 3 Then Sell("s3",AtStop,EntryPrice-(N[BarsSinceEntry]/2)*3,unit); } MessageLog("%.2f %.2f",entry,unit); if MarketPosition == 1 Then{ value1 = EntryPrice-N[BarsSinceEntry]*2; value2 = N[BarsSinceEntry]/2; exitlong("BP",AtStop,Lowest(L,20)-PriceScale); if CurrentEntries == 1 Then exitlong("bx1",AtStop,value1); if CurrentEntries == 2 Then exitlong("bx2",AtStop,value1+value2*1); if CurrentEntries == 3 Then exitlong("bx3",AtStop,value1+value2*2); if CurrentEntries == 4 Then exitlong("bx4",AtStop,value1+value2*3); } if MarketPosition == -1 Then{ value3 = EntryPrice+N[BarsSinceEntry]*2; value4 = N[BarsSinceEntry]/2; ExitShort("SP",AtStop,Highest(H,20)+PriceScale); if CurrentEntries == 1 Then ExitShort("sx1",AtStop,value3); if CurrentEntries == 2 Then ExitShort("sx2",AtStop,value3-value4*1); if CurrentEntries == 3 Then ExitShort("sx3",AtStop,value3-value4*2); if CurrentEntries == 4 Then ExitShort("sx4",AtStop,value3-value4*3); } 즐거운 하루되세요 > 루시 님이 쓴 글입니다. > 제목 : 거래가 발생하지 않는 구간이 생겨서요. > 구현하기 어렵다는 필터는 시스템1에 필요한 거라서 시스템2만으로 시뮬을 해 보았는데요. 그림과 같이 장기간 거래가 발생하지 않는 구간이 생기네요. 분명히 고가를 돌파한 것 같은데 왜 진입을 하지 않는지 궁금합니다. 보내주신 식 중에서 다음 부분을 수정했습니다. if MarketPosition == 0 and CurrentEntries == 0 Then{ buy("b",AtStop,Highest(H,55)+PriceScale,unit); Sell("s",AtStop,Lowest(L,55)-PriceScale,unit); # H로 되어 있기에 L 로 바꾸었습니다.