커뮤니티
행복; 시스템식 작성 바랍니다
2017-08-30 22:37:11
108
글번호 112374
한국의 금융산업 발전을 위해 불철주야 애쓰시는 귀하의 노고를 높이 평가합니다
시스템식 관련입니다
Q&A 54578번에 대한 답변 << 아래 >> 와 같이 잘 받았습니다
======<< 아래 시작 >>===============================
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");
======<< 아래 끝 >>===============================
<< 아래 >>를 < 다음 >과 같이 약간 변형하여 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,54490,308);
buy("b5",AtStop,55994,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차 매수는 2015년 10월 21일에 정상적으로 매수되었는데
2016년 10월 22일에는 4차 매수가 3번 반복되고 5차 매수가 1번 실행되어
합이 7차례 매수가 됩니다
원래는 5번 매수가 되어야 하는데 추가로 2번 더 매수가 이루어집니다~
어떻게 수정 해야 하나요?
답변 1
예스스탁 예스스탁 답변
2017-08-31 11:35:20
안녕하세요
예스스탁입니다.
수식을 적용할때 피라미딩을
다른진입신호함허용으로 설정하고 적용하셔야 합니다.
수식도 아래와 같이 변경하셔야 합니다.
if MarketPosition == 0 and sdate == 20151020 and C > 46800 then
buy("b1",OnClose,def,722);
if sdate >= 20151020 and MaxEntries < 5 Then{
buy("b2",AtStop,47947,308);
buy("b3",AtStop,49061,308);
buy("b4",AtStop,54490,308);
buy("b5",AtStop,55994,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 54578번에 대한 답변 << 아래 >> 와 같이 잘 받았습니다
======<< 아래 시작 >>===============================
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");
======<< 아래 끝 >>===============================
<< 아래 >>를 < 다음 >과 같이 약간 변형하여 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,54490,308);
buy("b5",AtStop,55994,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차 매수는 2015년 10월 21일에 정상적으로 매수되었는데
2016년 10월 22일에는 4차 매수가 3번 반복되고 5차 매수가 1번 실행되어
합이 7차례 매수가 됩니다
원래는 5번 매수가 되어야 하는데 추가로 2번 더 매수가 이루어집니다~
어떻게 수정 해야 하나요?
다음글