커뮤니티

문의드립니다.

프로필 이미지
엠제이
2012-09-20 23:36:48
276
글번호 54923
답변완료
아래의 수식이 있다고 했을때 매수일과 매수일+1일에 해당 가격이 오면 3분할 매수를 하도록 해 놓았습니다. 파라미딩은 다른진입신호만 허용으로 셋팅해 놓은 상태입니다. 그리고 평균 매수가의 3%부터 순차적으로 매도하게 되어 있습니다. 현재는 매수1,매수2,매수3에 대해서 매수일+1일에 매수청산이 이루어진 경우 또 다시 매수를 하고 있습니다. 매수1, 매수2, 매수3은 해당 가격에 여러번 오더라도 이틀동안 한번씩만 매수가 되었으면 합니다. 수식 보완 부탁드리겠습니다. 감사합니다. if sdate >= 매수일 and date != date[1] Then var1 = var1+1; if (MarketPosition== 0 or (MarketPosition == 1 and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1)) Then { if var1 >= 1 and var1 <= 2 then { Buy("매수1", AtLimit, 매수가격1, 매수수량1); Buy("매수2", AtLimit, 매수가격2, 매수수량2); Buy("매수3", AtLimit, 매수가격3, 매수수량3); } } if MarketPosition == 1 then { if CurrentContracts > CurrentContracts[1] Then{ if CodeCategory == 1 and BasePrice < 50000 Then 매도수량 = int(int(CurrentContracts*0.2)/10)*10; Else 매도수량 = int(CurrentContracts*0.2); } exitlong("수익1",atlimit,AvgEntryPrice*1.03,"",매도수량,1); exitlong("수익2",atlimit,AvgEntryPrice*1.05,"",매도수량,1); exitlong("수익3",atlimit,AvgEntryPrice*1.07,""); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-09-21 17:41:44

안녕하세요 예스스탁입니다. 직전에 청산이 발생하면 청산일 다음날 부터 진입하도록 수정했습니다. if sdate >= 매수일 and (TotalTrades == 0 or (TotalTrades >= 1 and sdate > ExitDate(1))) and (MarketPosition== 0 or (MarketPosition == 1 and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1)) then{ Buy("매수1", AtLimit, 매수가격1, 매수수량1); Buy("매수2", AtLimit, 매수가격2, 매수수량2); Buy("매수3", AtLimit, 매수가격3, 매수수량3); } if MarketPosition == 1 then { if CurrentContracts > CurrentContracts[1] Then{ if CodeCategory == 1 and BasePrice < 50000 Then 매도수량 = int(int(CurrentContracts*0.2)/10)*10; Else 매도수량 = int(CurrentContracts*0.2); } exitlong("수익1",atlimit,AvgEntryPrice*1.03,"",매도수량,1); exitlong("수익2",atlimit,AvgEntryPrice*1.05,"",매도수량,1); exitlong("수익3",atlimit,AvgEntryPrice*1.07,""); } 즐거운 하루되세요 > 엠제이 님이 쓴 글입니다. > 제목 : 문의드립니다. > 아래의 수식이 있다고 했을때 매수일과 매수일+1일에 해당 가격이 오면 3분할 매수를 하도록 해 놓았습니다. 파라미딩은 다른진입신호만 허용으로 셋팅해 놓은 상태입니다. 그리고 평균 매수가의 3%부터 순차적으로 매도하게 되어 있습니다. 현재는 매수1,매수2,매수3에 대해서 매수일+1일에 매수청산이 이루어진 경우 또 다시 매수를 하고 있습니다. 매수1, 매수2, 매수3은 해당 가격에 여러번 오더라도 이틀동안 한번씩만 매수가 되었으면 합니다. 수식 보완 부탁드리겠습니다. 감사합니다. if sdate >= 매수일 and date != date[1] Then var1 = var1+1; if (MarketPosition== 0 or (MarketPosition == 1 and countif(CurrentContracts < CurrentContracts[1],BarsSinceEntry) < 1)) Then { if var1 >= 1 and var1 <= 2 then { Buy("매수1", AtLimit, 매수가격1, 매수수량1); Buy("매수2", AtLimit, 매수가격2, 매수수량2); Buy("매수3", AtLimit, 매수가격3, 매수수량3); } } if MarketPosition == 1 then { if CurrentContracts > CurrentContracts[1] Then{ if CodeCategory == 1 and BasePrice < 50000 Then 매도수량 = int(int(CurrentContracts*0.2)/10)*10; Else 매도수량 = int(CurrentContracts*0.2); } exitlong("수익1",atlimit,AvgEntryPrice*1.03,"",매도수량,1); exitlong("수익2",atlimit,AvgEntryPrice*1.05,"",매도수량,1); exitlong("수익3",atlimit,AvgEntryPrice*1.07,""); }