첨부 이미지
그림1
아래의 수식을 시뮬레이션 해보았습니다.
당일누적손실틱수를 160틱으로 잡아보았습니다.
그런데 160틱에서 손절되는게 아니고 봉이 완성될때까지 기다렸다가 시그널이 발생되는거 같습니다.
명령어를 Atstop으로 해서 당연히 되는줄 알았는데 아닌거 같아서요 ~
160틱에서 stop되게 하려면 무엇을 바꿔야 하는지 좀 알려주시면 감사하겠습니다.
- 아 래 -
Inputs: Length(9), StdDev(2), Bars(2);
Variables: BBTop(0),BBBot(0);
Input : 당일누적수익틱수(500),당일누적손실틱수(160);
input : starttime(100000),endtime(200000);
VARS: Tcond(false),N1(0),dayPl(0),당일누적수익(0),당일누적손실(0),Xcond(false),stok(0),stod(0);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("매수청산");
if MarketPosition == -1 Then
ExitShort("매도청산");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Xcond = false;
N1 = NetProfit;
Tcond = true;
}
당일누적수익 = PriceScale*당일누적수익틱수;
당일누적손실 = PriceScale*당일누적손실틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일누적수익 or daypl <= -당일누적손실 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
}
if MarketPosition == 1 then{
ExitLong("매수수익",atlimit,EntryPrice+((당일누적수익-daypl)/CurrentContracts));
ExitLong("매수손실",AtStop,EntryPrice-((당일누적손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("매도수익",atlimit,EntryPrice-((당일누적수익-daypl)/CurrentContracts));
ExitShort("매도손실",AtStop,EntryPrice+((당일누적손실+daypl)/CurrentContracts));
}
BBTop = BollBandup(Length, StdDev);
BBBot = BollBanddown(Length, StdDev);
If Tcond == true and Xcond == False and CountIF(Close < BBBot, Bars) == Bars Then
Buy("매수", AtStop, BBBot);
If Tcond == true and Xcond == False and CountIF(Close > BBTop, Bars) == Bars Then
Sell("매도", AtStop, BBTop);
답변 1
예스스탁
예스스탁 답변
2021-04-20 09:23:34
안녕하세요
예스스탁입니다.
1
해당 수식들 봉미완성에 발생하는 신호가 맞습니다.
첨부하신 그림에 보시면 매수손실 신호가 봉의 저가부근에서 발생한것을 확인하실수 있습니다.
신호가 발생한 봉의 옆에 조그만 세모표시가 신호가 발생한 위치입니다.
2
리포트의 신호의 날짜시간은 마우스로 봉 지정시 표시되는 날짜시간으로
신호가 발생한 봉이 대표날짜와 시간입니다.
신호가 발생한 가격의 날짜와 시간은 아닙니다.
3
리포트의 손익은 설정창 수수료와 슬리피지 설정이 적용됩니다.
해당 값을 0으로 하시면 손실이 160으로 표시되게 됩니다
즐거운 하루되세요
> 승부사1 님이 쓴 글입니다.
> 제목 : 볼린저 밴드 수식 점검 문의드립니다.
> 아래의 수식을 시뮬레이션 해보았습니다.
당일누적손실틱수를 160틱으로 잡아보았습니다.
그런데 160틱에서 손절되는게 아니고 봉이 완성될때까지 기다렸다가 시그널이 발생되는거 같습니다.
명령어를 Atstop으로 해서 당연히 되는줄 알았는데 아닌거 같아서요 ~
160틱에서 stop되게 하려면 무엇을 바꿔야 하는지 좀 알려주시면 감사하겠습니다.
- 아 래 -
Inputs: Length(9), StdDev(2), Bars(2);
Variables: BBTop(0),BBBot(0);
Input : 당일누적수익틱수(500),당일누적손실틱수(160);
input : starttime(100000),endtime(200000);
VARS: Tcond(false),N1(0),dayPl(0),당일누적수익(0),당일누적손실(0),Xcond(false),stok(0),stod(0);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("매수청산");
if MarketPosition == -1 Then
ExitShort("매도청산");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Xcond = false;
N1 = NetProfit;
Tcond = true;
}
당일누적수익 = PriceScale*당일누적수익틱수;
당일누적손실 = PriceScale*당일누적손실틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일누적수익 or daypl <= -당일누적손실 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
}
if MarketPosition == 1 then{
ExitLong("매수수익",atlimit,EntryPrice+((당일누적수익-daypl)/CurrentContracts));
ExitLong("매수손실",AtStop,EntryPrice-((당일누적손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("매도수익",atlimit,EntryPrice-((당일누적수익-daypl)/CurrentContracts));
ExitShort("매도손실",AtStop,EntryPrice+((당일누적손실+daypl)/CurrentContracts));
}
BBTop = BollBandup(Length, StdDev);
BBBot = BollBanddown(Length, StdDev);
If Tcond == true and Xcond == False and CountIF(Close < BBBot, Bars) == Bars Then
Buy("매수", AtStop, BBBot);
If Tcond == true and Xcond == False and CountIF(Close > BBTop, Bars) == Bars Then
Sell("매도", AtStop, BBTop);