커뮤니티
시스템식 재차 문의
2012-08-10 12:06:24
295
글번호 53658
안녕하세요. 저번 답변은 잘 봤습니다. wrongsig 문제는 잘 해결되었습니다.
감사합니다.
그런데 한가지 문제가 있어서 다시 질문드리게 되었습니다.
pic1을 보시면 아시겠지만 9월 24일 bwex로 매도 청산이 된 후에 다시 'trendsell'로
인해 매도 포지션을 취함을 알 수 있습니다.
그렇지만 전문가님께서 수정한 식이 아래와 같은데
Input : Highperiod(48),period(20),af(0.005), maxAF(0.1),loss(2),D(2),PeriodR(7);
var : PriceROC(0),BBTop(0), BBMid(0), BBBot(0),Bwidth(0),StoK(0),StoD(0),Relative(0);
var1 = SAR(af,maxAF);
BBTop = BollBandUp(Period,D);
BBMid = ma(C,Period);
BBBot = BollBandDown(Period,D);
BWidth = ((BBTop - BBBot)/ BBMid);
Relative = RSI(PeriodR);
If (marketposition == 0 and Isexitname("endvolatil2",1) == false) or
(marketposition != 0 and Isentryname("trendbuy") == false and Isexitname("endvolatil2",1) == false) then {
If (Relative[1] >= 70 and Relative < Relative[1]) then sell("sell1");}
If (marketposition == 0 and Isexitname("endvolatil1",1) == false) or
(marketposition != 0 and entryname != "trendsell" and Isexitname("endvolatil1",1) == false) then {
If Relative[1] <= 30 and Relative >= 30 then buy("buy1");}
If (marketposition == 0 ) or (marketposition != 1 and entryname != "buy1" and entryname != "sell1") then {
If var1 < c then buy("trendbuy");
}
if MarketPosition == 1 then{
If var1 > c then exitlong("endtrend1",onclose,def, "trendbuy");
if BarsSinceEntry(0) == 2 and c[2] > c then exitlong("wrongsig2",onclose,def,"trendbuy");
}
If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition != -1 and entryname != "buy1" and entryname != "sell1") then {
If var1 > c then sell("trendsell");
}
if MarketPosition == -1 Then{
If var1 < c then exitshort("endtrend2",onclose,def,"trendsell");
If BarsSinceEntry(0) == 3 and c[3] < c then exitshort("wrongsig",onclose,def,"trendsell");
If Bwidth[1] == Highest(Bwidth,Highperiod) and Bwidth[1] > Bwidth then exitshort("bwex",onclose,def,"trendsell");
}
여기서 보면
If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition != -1 and entryname != "buy1" and entryname != "sell1") then {
If var1 > c then sell("trendsell");
}
이 구절이 의미하는 바가 최근에 'bwex'로 청산을 했다면 'trendsell'을 하지 말아라
라는 의미입니다. 때문에 이게 잘 반영된 것 같지 않아서 이 문제를 해결하기 위해선
어떻게 해야할지 다시 질문드립니다.
친절한 답변에 언제나 감사드립니다.
- 1. 54020_pic1.png (0.13 MB)
답변 1
예스스탁 예스스탁 답변
2012-08-10 15:37:22
안녕하세요
예스스탁입니다.
해당신호는
(marketposition == 0 and Isexitname("bwex",1) == false)
조건이 아닌 or 뒤의
(marketposition != -1 and entryname != "buy1" and entryname != "sell1")
조건때문에 발생하게 되는 신호입니다.
즉 진입식이
현재 무포지션이고 직전청산명이 bwex가 아니거나
혹은
현재 매도포지션이 아니고 진입명이 buy1이나 sell1이 아닌 조건이
만족하기에 진입하는 것입니다.
조건이 A or B이면 2개중에 하나라도 만족하면 되므로
해당 내용은 조건 내용을 변경하셔야 합니다.
(marketposition == 0 and Isexitname("bwex",1) == false)
로 무포지션일때의 조건을 지정하셨으므로
(marketposition == 1 and entryname != "buy1")
로 변경하여 매수포지션 상태일때만 지정하시면 됩니다.
sell은 피라미딩을 설정하지 않는한 매도포지션 상태에서는
발동자체를 하지 않으므로 실제 entryname != "sell1" 부분은 의미가 없는 내용입니다.
buy("trendbuy")매수식의 조건도 위의 내용을 감안해 수정했습니다.
아래는 수정한 식입니다.
Input : Highperiod(48),period(20),af(0.005), maxAF(0.1),loss(2),D(2),PeriodR(7);
var : PriceROC(0),BBTop(0), BBMid(0), BBBot(0),Bwidth(0),StoK(0),StoD(0),Relative(0);
var1 = SAR(af,maxAF);
BBTop = BollBandUp(Period,D);
BBMid = ma(C,Period);
BBBot = BollBandDown(Period,D);
BWidth = ((BBTop - BBBot)/ BBMid);
Relative = RSI(PeriodR);
If (marketposition == 0 and Isexitname("endvolatil2",1) == false) or
(marketposition != 0 and Isentryname("trendbuy") == false and Isexitname("endvolatil2",1) == false) then {
If (Relative[1] >= 70 and Relative < Relative[1]) then sell("sell1");}
If (marketposition == 0 and Isexitname("endvolatil1",1) == false) or
(marketposition != 0 and entryname != "trendsell" and Isexitname("endvolatil1",1) == false) then {
If Relative[1] <= 30 and Relative >= 30 then buy("buy1");}
If (marketposition == 0 ) or (marketposition == -1 and entryname != "sell1") then {
If var1 < c then buy("trendbuy");
}
if MarketPosition == 1 then{
If var1 > c then exitlong("endtrend1",onclose,def, "trendbuy");
if BarsSinceEntry(0) == 2 and c[2] > c then exitlong("wrongsig2",onclose,def,"trendbuy");
}
If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition == 1 and entryname != "buy1") then {
If var1 > c then sell("trendsell");
}
if MarketPosition == -1 Then{
If var1 < c then exitshort("endtrend2",onclose,def,"trendsell");
If BarsSinceEntry(0) == 3 and c[3] < c then exitshort("wrongsig",onclose,def,"trendsell");
If Bwidth[1] == Highest(Bwidth,Highperiod) and Bwidth[1] > Bwidth then exitshort("bwex",onclose,def,"trendsell");
}
즐거운 하루되세요
> cwc1988 님이 쓴 글입니다.
> 제목 : 시스템식 재차 문의
>
안녕하세요. 저번 답변은 잘 봤습니다. wrongsig 문제는 잘 해결되었습니다.
감사합니다.
그런데 한가지 문제가 있어서 다시 질문드리게 되었습니다.
pic1을 보시면 아시겠지만 9월 24일 bwex로 매도 청산이 된 후에 다시 'trendsell'로
인해 매도 포지션을 취함을 알 수 있습니다.
그렇지만 전문가님께서 수정한 식이 아래와 같은데
Input : Highperiod(48),period(20),af(0.005), maxAF(0.1),loss(2),D(2),PeriodR(7);
var : PriceROC(0),BBTop(0), BBMid(0), BBBot(0),Bwidth(0),StoK(0),StoD(0),Relative(0);
var1 = SAR(af,maxAF);
BBTop = BollBandUp(Period,D);
BBMid = ma(C,Period);
BBBot = BollBandDown(Period,D);
BWidth = ((BBTop - BBBot)/ BBMid);
Relative = RSI(PeriodR);
If (marketposition == 0 and Isexitname("endvolatil2",1) == false) or
(marketposition != 0 and Isentryname("trendbuy") == false and Isexitname("endvolatil2",1) == false) then {
If (Relative[1] >= 70 and Relative < Relative[1]) then sell("sell1");}
If (marketposition == 0 and Isexitname("endvolatil1",1) == false) or
(marketposition != 0 and entryname != "trendsell" and Isexitname("endvolatil1",1) == false) then {
If Relative[1] <= 30 and Relative >= 30 then buy("buy1");}
If (marketposition == 0 ) or (marketposition != 1 and entryname != "buy1" and entryname != "sell1") then {
If var1 < c then buy("trendbuy");
}
if MarketPosition == 1 then{
If var1 > c then exitlong("endtrend1",onclose,def, "trendbuy");
if BarsSinceEntry(0) == 2 and c[2] > c then exitlong("wrongsig2",onclose,def,"trendbuy");
}
If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition != -1 and entryname != "buy1" and entryname != "sell1") then {
If var1 > c then sell("trendsell");
}
if MarketPosition == -1 Then{
If var1 < c then exitshort("endtrend2",onclose,def,"trendsell");
If BarsSinceEntry(0) == 3 and c[3] < c then exitshort("wrongsig",onclose,def,"trendsell");
If Bwidth[1] == Highest(Bwidth,Highperiod) and Bwidth[1] > Bwidth then exitshort("bwex",onclose,def,"trendsell");
}
여기서 보면
If (marketposition == 0 and Isexitname("bwex",1) == false) or (marketposition != -1 and entryname != "buy1" and entryname != "sell1") then {
If var1 > c then sell("trendsell");
}
이 구절이 의미하는 바가 최근에 'bwex'로 청산을 했다면 'trendsell'을 하지 말아라
라는 의미입니다. 때문에 이게 잘 반영된 것 같지 않아서 이 문제를 해결하기 위해선
어떻게 해야할지 다시 질문드립니다.
친절한 답변에 언제나 감사드립니다.