커뮤니티

행복; 시스템식 작성 바랍니다

프로필 이미지
행복한가방
2017-08-27 05:39:20
162
글번호 112259
답변완료
한국의 금융산업 발전을 위해 불철주야 애쓰시는 귀하의 노고를 높이 평가합니다 시스템식 관련입니다 Q&A 54458번에 대한 답변 << 아래 >> 와 같이 잘 받았습니다 ======<< 아래 시작 >>=============================== input : 총투자금(10000000); if MarketPosition == 0 and sdate == 20161221 and C > 48000 then buy("b1",OnClose,def,Floor((총투자금*0.20)/c)); if MarketPosition == 1 Then{ if sdate >= 20161221 and MaxEntries < 5 Then{ buy("b2",AtStop,49400,Floor((총투자금*0.19)/C)); buy("b3",AtStop,50000,Floor((총투자금*0.18)/C)); buy("b4",AtStop,50600,Floor((총투자금*0.17)/C)); buy("b5",AtStop,51100,Floor((총투자금*0.16)/C)); } if MaxEntries == 1 then exitlong("bx1",AtStop,highest(H,BarsSinceEntry)*0.90); if MaxEntries == 2 then exitlong("bx2",AtStop,highest(H,BarsSinceEntry)*0.88); if MaxEntries == 3 then exitlong("bx3",AtStop,highest(H,BarsSinceEntry)*0.86); if MaxEntries == 4 then exitlong("bx4",AtStop,highest(H,BarsSinceEntry)*0.84); if MaxEntries == 5 and 조건E then exitlong("bx5"); } ======<< 아래 끝 >>=============================== << 아래 >>를 < 다음 >과 같이 약간 변형하여 LG전자에 적용하였습니다 - 주기; 일봉 - 종목; LG전자 ======<< 다음 시작 >>=============================== if MarketPosition == 0 and sdate == 20151020 and C > 46800 then buy("b1",OnClose,def,722); if MarketPosition == 1 Then{ if sdate >= 20151020 and MaxEntries < 5 Then{ buy("b2",AtStop,47947,308); buy("b3",AtStop,49061,308); buy("b4",AtStop,50169,308); buy("b5",AtStop,51275,308); } if MaxEntries == 1 then exitlong("bx1",AtStop,highest(H,BarsSinceEntry)*0.790); if MaxEntries == 2 then exitlong("bx2",AtStop,highest(H,BarsSinceEntry)*0.688); if MaxEntries == 3 then exitlong("bx3",AtStop,highest(H,BarsSinceEntry)*0.586); if MaxEntries == 4 then exitlong("bx4",AtStop,highest(H,BarsSinceEntry)*0.484); if MaxEntries == 5 and C > 100000 Then exitlong("bx5"); } ======<< 다음 끝 >>=============================== 그랬더니, 2015년 10월 20일에 1차 매수 후 2차, 3차, 4차, 5차 매수가 2015년 10월 21일에 매수되지 않고 하루 지난 2015년 10월 22일에 매수가 됩니다~ 어떻게 수정 해야 하나요?
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-08-28 14:01:48

안녕하세요 예스스탁입니다. atstop이 봉완성시 셋팅되어 다음봉을 감시하므로 첫진입과 동일날짜에도 셋팅되게 수정했습니다. if MarketPosition == 0 and sdate == 20151020 and C > 46800 then{ Condition1 = true; buy("b1",OnClose,def,722); } if Condition1 == true and MaxEntries < 5 Then{ buy("b2",AtStop,47947,308); buy("b3",AtStop,49061,308); buy("b4",AtStop,50169,308); buy("b5",AtStop,51275,308); } if MarketPosition == 1 Then{ if MaxEntries == 1 then exitlong("bx1",AtStop,highest(H,BarsSinceEntry)*0.790); if MaxEntries == 2 then exitlong("bx2",AtStop,highest(H,BarsSinceEntry)*0.688); if MaxEntries == 3 then exitlong("bx3",AtStop,highest(H,BarsSinceEntry)*0.586); if MaxEntries == 4 then exitlong("bx4",AtStop,highest(H,BarsSinceEntry)*0.484); if MaxEntries == 5 and C > 100000 Then exitlong("bx5"); } 즐거운 하루되세요 > 행복한가방 님이 쓴 글입니다. > 제목 : 행복; 시스템식 작성 바랍니다 > 한국의 금융산업 발전을 위해 불철주야 애쓰시는 귀하의 노고를 높이 평가합니다 시스템식 관련입니다 Q&A 54458번에 대한 답변 << 아래 >> 와 같이 잘 받았습니다 ======<< 아래 시작 >>=============================== input : 총투자금(10000000); if MarketPosition == 0 and sdate == 20161221 and C > 48000 then buy("b1",OnClose,def,Floor((총투자금*0.20)/c)); if MarketPosition == 1 Then{ if sdate >= 20161221 and MaxEntries < 5 Then{ buy("b2",AtStop,49400,Floor((총투자금*0.19)/C)); buy("b3",AtStop,50000,Floor((총투자금*0.18)/C)); buy("b4",AtStop,50600,Floor((총투자금*0.17)/C)); buy("b5",AtStop,51100,Floor((총투자금*0.16)/C)); } if MaxEntries == 1 then exitlong("bx1",AtStop,highest(H,BarsSinceEntry)*0.90); if MaxEntries == 2 then exitlong("bx2",AtStop,highest(H,BarsSinceEntry)*0.88); if MaxEntries == 3 then exitlong("bx3",AtStop,highest(H,BarsSinceEntry)*0.86); if MaxEntries == 4 then exitlong("bx4",AtStop,highest(H,BarsSinceEntry)*0.84); if MaxEntries == 5 and 조건E then exitlong("bx5"); } ======<< 아래 끝 >>=============================== << 아래 >>를 < 다음 >과 같이 약간 변형하여 LG전자에 적용하였습니다 - 주기; 일봉 - 종목; LG전자 ======<< 다음 시작 >>=============================== if MarketPosition == 0 and sdate == 20151020 and C > 46800 then buy("b1",OnClose,def,722); if MarketPosition == 1 Then{ if sdate >= 20151020 and MaxEntries < 5 Then{ buy("b2",AtStop,47947,308); buy("b3",AtStop,49061,308); buy("b4",AtStop,50169,308); buy("b5",AtStop,51275,308); } if MaxEntries == 1 then exitlong("bx1",AtStop,highest(H,BarsSinceEntry)*0.790); if MaxEntries == 2 then exitlong("bx2",AtStop,highest(H,BarsSinceEntry)*0.688); if MaxEntries == 3 then exitlong("bx3",AtStop,highest(H,BarsSinceEntry)*0.586); if MaxEntries == 4 then exitlong("bx4",AtStop,highest(H,BarsSinceEntry)*0.484); if MaxEntries == 5 and C > 100000 Then exitlong("bx5"); } ======<< 다음 끝 >>=============================== 그랬더니, 2015년 10월 20일에 1차 매수 후 2차, 3차, 4차, 5차 매수가 2015년 10월 21일에 매수되지 않고 하루 지난 2015년 10월 22일에 매수가 됩니다~ 어떻게 수정 해야 하나요?