커뮤니티
필터링에 대해 문의 드립니다.
2013-05-20 11:48:27
245
글번호 63357
너무 자주 거래가 성립되어 진입 건을 축소하고자 합니다.
수식 부탁드립니다.
1. Stochastics slow에서
stochasticsK값과 stochasticsD값이 40미만이며
stochasticsK가 stochasticsD를 CROSSUP할 때 매수하고자 합니다.
단, 동일한 조건으로 직전에 발생한 매수신호와 비교하여
매수신호봉의 저가가 직전 매수신호봉의 저가보다 작을 때는
매수 진입을 걸러냅니다. (매수 포기)
2. 당일 손실거래를 n회로 제한하는 식을 부탁드립니다.
stoploss건 뿐만아니라, 청산 신호에 의한 손실 발생 건,
매수후 매도신호 발생에 의한 청산 손실 건도 포함하고자 합니다.
귀사에서 올려놓은 losscutcount 방식에 의하면 stoploss 처리된
건만 카운팅하는 것 같았습니다.
<당일 손실거래 2회 제한식>
var : count(0), Losscutcount(0);
Losscutcount == 0;
for count = 0 to 10 {
if Entrydate(count+1) == sdate and Positionprofit(count+1) < 0
then Losscutcount == Losscutcount + 1
}
if crossup(c,ma(5)) and Losscutcount < 2 then
buy("매수");
위 식을 그대로 적용하니까 반대신호에 의한 청산(손실 발생 건) 또는
청산식에 의한 손실 발생 건은 당일 손실거래 제한 건수로 포함되지
않았습니다.
반대 매매에 의한 손실 발생건 및 청산식에 의한 손실 발생 건도 포함하여
진입 제한할 수 있는 식을 부탁드립니다.
답변 1
예스스탁 예스스탁 답변
2013-05-20 21:35:03
안녕하세요
예스스탁입니다.
1.
Input : Period(12), Period1(5), Period2(5);
value1 = StochasticsK(Period,Period1);
value2 = StochasticsD(Period,Period1,Period2);
if MarketPosition(1) == 1 Then
var1 = L[BarsSinceEntry];
If CrossUP(value1, value2) and value1 < 40 and value2 < 40 Then
{
if var1 == 0 then
Buy();
if var1 > 0 and L > var1 then
Buy();
}
2. 수정한 식입니다.
var : count(0), Losscutcount(0);
Losscutcount == 0;
for count = 1 to 10 {
if Entrydate(count) == sdate and Positionprofit(count) < 0 then
Losscutcount = Losscutcount + 1;
}
if crossup(c,ma(c,5)) then{
if MarketPosition == 0 and Losscutcount < 2 Then
buy("매수1");
if MarketPosition == -1 and Losscutcount == 1 and C < EntryPrice Then
buy("매수2");
if MarketPosition == -1 and Losscutcount == 1 and C > EntryPrice Then
ExitShort();
}
if CrossDown(c,ma(c,5)) then{
if MarketPosition == 0 and Losscutcount < 2 Then
sell("매도1");
if MarketPosition == 1 and Losscutcount == 1 and C > EntryPrice Then
sell("매도2");
if MarketPosition == 1 and Losscutcount == 1 and C < EntryPrice Then
ExitLong();
}
즐거운 하루되세요
> wjfwp 님이 쓴 글입니다.
> 제목 : 필터링에 대해 문의 드립니다.
>
너무 자주 거래가 성립되어 진입 건을 축소하고자 합니다.
수식 부탁드립니다.
1. Stochastics slow에서
stochasticsK값과 stochasticsD값이 40미만이며
stochasticsK가 stochasticsD를 CROSSUP할 때 매수하고자 합니다.
단, 동일한 조건으로 직전에 발생한 매수신호와 비교하여
매수신호봉의 저가가 직전 매수신호봉의 저가보다 작을 때는
매수 진입을 걸러냅니다. (매수 포기)
2. 당일 손실거래를 n회로 제한하는 식을 부탁드립니다.
stoploss건 뿐만아니라, 청산 신호에 의한 손실 발생 건,
매수후 매도신호 발생에 의한 청산 손실 건도 포함하고자 합니다.
귀사에서 올려놓은 losscutcount 방식에 의하면 stoploss 처리된
건만 카운팅하는 것 같았습니다.
<당일 손실거래 2회 제한식>
var : count(0), Losscutcount(0);
Losscutcount == 0;
for count = 0 to 10 {
if Entrydate(count+1) == sdate and Positionprofit(count+1) < 0
then Losscutcount == Losscutcount + 1
}
if crossup(c,ma(5)) and Losscutcount < 2 then
buy("매수");
위 식을 그대로 적용하니까 반대신호에 의한 청산(손실 발생 건) 또는
청산식에 의한 손실 발생 건은 당일 손실거래 제한 건수로 포함되지
않았습니다.
반대 매매에 의한 손실 발생건 및 청산식에 의한 손실 발생 건도 포함하여
진입 제한할 수 있는 식을 부탁드립니다.
다음글