예스스탁
예스스탁 답변
2021-10-20 12:30:18
안녕하세요
예스스탁입니다.
1
차트에 볼린져밴드를 적용해서 수식의 조건 내용과 비교해 보시기 바랍니다.
매도조건은 CrossDown(L,Var2) and C < O 로
저가가 전봉은 볼밴하단 위에 있어야 하고 현재봉은 음봉으로 저가가 볼밴하단 아래에 있어야 조건이 충족됩니다.
올리신 오른쪽 그림에서 2개봉 중
첫봉은 도지봉이라 조건에 충족되지 않고
두번째봉은 음봉이지만 전봉이 이미 저가가 볼밴하단 아래이므로 신호가 발생하지 않습니다.
2
해당봉에 신호가 발생하게 하는 방법은 두번째봉은 crossdown에 조건에 충족되지 않으므로
첫봉도지에서 신호가 발생하게 하는 방법뿐이 없습니다.
도지봉은 전봉종가대비 같거나 크면 양봉도지, 전봉종가대비 낮으면 음봉도지로 표현됩니다.
매수는 양봉이거나 양봉도지, 매도는 음봉이거나 음봉도지일때 신호가 발생하게 수정해 드립니다.
또한 3분봉 차트에서 도지인 첫봉의 stime은 101200입니다.
starttime도 101200으로 변경해 드립니다.
3
input : StartTime(101200),EndTime(114000);
input : Length(20), D1(2);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(2);
var : Tcond(false),profit(0),loss(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp1.",1) or IsExitName("bp2.",21) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp1.",1) or IsExitName("sp2.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl1.",1) or IsExitName("bl2.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl1.",1) or IsExitName("sl2.",1) or IsExitName("sl1",1) or IsExitName("sl2",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and (c > o or (C==O and C >= C[1])) and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl1.",AtStop,C-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2.",AtLimit,C+PriceScale*익절2,"",1,1);
ExitLong("bl2.",AtStop,C-PriceScale*손절2,"",1,1);
}
}
If CrossDown(L,Var2) and (C < O or (C==O and C < C[1])) and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl1.",AtStop,C+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2.",AtLimit,C-PriceScale*익절2,"",1,1);
ExitShort("sl2.",AtStop,C+PriceScale*손절2,"",1,1);
}
}
}
if MarketPosition == 1 Then
{
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*익절1,"",1,1);
ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*익절2,"",1,1);
ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2,"",1,1);
}
}
if MarketPosition == -1 Then
{
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절1,"",1,1);
ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절2,"",1,1);
ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2,"",1,1);
}
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
즐거운 하루되세요
> 에리카 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 처음 수식에서 추가 하다보니 차트상 달라진 것이 있습니다.
이전 수식차트와 현재 수식 차트를 올려드리니 확인 부탁드립니다.
감사합니다.
아래는
현재 시스템 차트 수식입니다.
input : StartTime(101500),EndTime(114000);
input : Length(20), D1(2);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(2);
var : Tcond(false),profit(0),loss(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
profit = 0;
loss = 0;
}
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("bp1.",1) or IsExitName("bp2.",21) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp1.",1) or IsExitName("sp2.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl1.",1) or IsExitName("bl2.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl1.",1) or IsExitName("sl2.",1) or IsExitName("sl1",1) or IsExitName("sl2",1) Then
loss = loss+1;
Else
loss = 0;
}
var1 = BollBandUp(Length,D1);
var2 = BollBandDown(Length,D1);
if Tcond == true Then
{
If CrossUP(H,var1) and c > o and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Buy("b",OnClose,DEF,1);
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl1.",AtStop,C-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2.",AtLimit,C+PriceScale*익절2,"",1,1);
ExitLong("bl2.",AtStop,C-PriceScale*손절2,"",1,1);
}
}
If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl1.",AtStop,C+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2.",AtLimit,C-PriceScale*익절2,"",1,1);
ExitShort("sl2.",AtStop,C+PriceScale*손절2,"",1,1);
}
}
}
if MarketPosition == 1 Then
{
if sTime >= StartTime and sTime < 청산구분시간 Then
{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*익절1,"",1,1);
ExitLong("bl1",AtStop,EntryPrice-PriceScale*손절1,"",1,1);
}
if sTime >= 청산구분시간 and sTime < Endtime Then
{
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*익절2,"",1,1);
ExitLong("bl2",AtStop,EntryPrice-PriceScale*손절2,"",1,1);
}
}
if MarketPosition == -1 Then
{
if sTime >= StartTime and sTime < 103000 Then
{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*익절1,"",1,1);
ExitShort("sl1",AtStop,EntryPrice+PriceScale*손절1,"",1,1);
}
if sTime >= 103000 and sTime < Endtime Then
{
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*익절2,"",1,1);
ExitShort("sl2",AtStop,EntryPrice+PriceScale*손절2,"",1,1);
}
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}