오늘 항셍거래에서 수식차트에서는 신호가 나오는데, 보내주신 수식을 적용해서 시스템 트레이딩을 하면 신호도 안나오고 거래가 이루어지지 않았습니다.
그래서 문의 드렸습니다.
사진을 첨부하오니 확인 부탁드립니다.
감사합니다~~^^
> 에리카 님이 쓴 글입니다.
> 제목 : 문의
> 항상감사합니다
1수식을 넣으면 챠트상신호도 나오고
거래내역도 나옵니다
2수식은 1수식을 구체화 한 수식입니다
오늘 해외챠트적용시
신호도 거래내용도 나오지않습니다
차이점이나 수정내용 부탁드립니다.
1수식]
Input : Length(20), D1(2);
# 매수/매도청산
If CrossUP(H,BollBandUp(20, 2)) then
Buy();
# 매도/매수청산
If CrossDown(L,BollBandDown(20, 2)) then
Sell();
2수식]input : StartTime(101800),EndTime(114000);
input : Length(20), D1(2);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(3);
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("bp.",1) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl.",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);
ExitLong("bp.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl.",AtStop,C-PriceScale*손절1,"",1,1);
}
If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
ExitShort("sp.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl.",AtStop,C+PriceScale*손절1,"",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);
}
}
예스스탁
예스스탁 답변
2021-10-12 14:31:33
안녕하세요
예스스탁입니다.
수식에서는 시간을 지정할 때는 stime으로 사용하게 됩니다.
plot1(stime);
위 내용을 지표식으로 작성해 차트에 적용해서
각 봉의 시간을 확인해 보시면 차트에 표시되는 시간과 stime에 차이가 있는 것을 확인할 수 있습니다.
해외선물 차트는 차트에 표시되는 시간이 해당봉의 시작시세나 끝시세의 시간이 아니고
해당봉이 완성되는 [다음봉의 시가시간]이 [현재봉에 표시]가 됩니다.
선물사들이 봉에 시간을 표시하는 규칙이라 저희가 따로 변경할 수는 없습니다.
예를 들어 3분봉 차트에서
10시18분으로 차트에 표시되는 봉은
실제 10시15분00초(stime)~10시17분59초(time)의 데이타를 모아서 그리지만
다음봉의 시가가 10시18분이므로 10시18분봉으로 표시가 됩니다.
하지만 수식에서는 stime을 이용하므로
시간 지정시에 stime을 확인하시고 시간을 지정해 주셔야 합니다.
올려주신식에서는 starttime을 101500으로 지정해 주시면
기본식과 동일한 위치에 신호가 발생합니다.
즐거운 하루되세요
> 에리카 님이 쓴 글입니다.
> 제목 : Re : 문의
>
오늘 항셍거래에서 수식차트에서는 신호가 나오는데, 보내주신 수식을 적용해서 시스템 트레이딩을 하면 신호도 안나오고 거래가 이루어지지 않았습니다.
그래서 문의 드렸습니다.
사진을 첨부하오니 확인 부탁드립니다.
감사합니다~~^^
> 에리카 님이 쓴 글입니다.
> 제목 : 문의
> 항상감사합니다
1수식을 넣으면 챠트상신호도 나오고
거래내역도 나옵니다
2수식은 1수식을 구체화 한 수식입니다
오늘 해외챠트적용시
신호도 거래내용도 나오지않습니다
차이점이나 수정내용 부탁드립니다.
1수식]
Input : Length(20), D1(2);
# 매수/매도청산
If CrossUP(H,BollBandUp(20, 2)) then
Buy();
# 매도/매수청산
If CrossDown(L,BollBandDown(20, 2)) then
Sell();
2수식]input : StartTime(101800),EndTime(114000);
input : Length(20), D1(2);
input : 익절1(30),손절1(30),청산구분시간(103000),익절2(50),손절2(30),익절연속횟수(3),손절연속횟수(3);
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("bp.",1) or IsExitName("bp1",1) or IsExitName("bp2",21) or
IsExitName("sp.",1) or IsExitName("sp1",1) or IsExitName("sp2",1) Then
profit = profit+1;
Else
profit = 0;
if IsExitName("bl.",1) or IsExitName("bl1",1) or IsExitName("bl2",1) or
IsExitName("sl.",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);
ExitLong("bp.",AtLimit,C+PriceScale*익절1,"",1,1);
ExitLong("bl.",AtStop,C-PriceScale*손절1,"",1,1);
}
If CrossDown(L,Var2) and C < O and profit < 익절연속횟수 and loss < 손절연속횟수 then
{
Sell("s",OnClose,DEF,1);
ExitShort("sp.",AtLimit,C-PriceScale*익절1,"",1,1);
ExitShort("sl.",AtStop,C+PriceScale*손절1,"",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);
}
}