수고많으십니다.
아래 수식은 검증은 이상없다고 하는데, 데모 데이타가 전혀 안나옵니다.
어떤 문제가 있는 건가요?
input : n1(5), n(10);
input : StartTime(210000),EndTime(053000);
input : 익절틱수(80),손절틱수(0),거래횟수(10);
input : mm(50),m1(10);
var : Tcond(false), T(0), entry(0);
Array : H1[50](0),L1[50](0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
T = 0;
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if H > Highest(H,n1)[1] and C > O and entry < 거래횟수 Then
Buy("b");
if L < Lowest(L,N1)[1] and C < O and entry < 거래횟수 Then
Sell("s");
if MarketPosition == 1 Then
ExitLong("bx",AtStop,Lowest(L,n)[BarsSinceEntry]-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,Highest(H,n)[BarsSinceEntry]+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
{
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*mm Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*m1);
}
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*mm Then
ExitShort("str",AtStop,EntryPrice-PriceScale*m1);
}
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);
}
}
답변 1
예스스탁
예스스탁 답변
2021-11-26 11:40:37
안녕하세요
예스스탁입니다.
올려주신 수식을 그대로 크루드오일 1분봉에 적용해 보았지만
첨부된 그림과 같이 신호가 많이 나오고 있습니다.
차트에 조회된 봉의 갯수가 작으면 지정한 시간대의 봉이 없을수 있으므로
봉을 많이 조회해서 적용해 보시고 바랍니다.
즐거운 하루되세요
> jesten77 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 수고많으십니다.
아래 수식은 검증은 이상없다고 하는데, 데모 데이타가 전혀 안나옵니다.
어떤 문제가 있는 건가요?
input : n1(5), n(10);
input : StartTime(210000),EndTime(053000);
input : 익절틱수(80),손절틱수(0),거래횟수(10);
input : mm(50),m1(10);
var : Tcond(false), T(0), entry(0);
Array : H1[50](0),L1[50](0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
T = 0;
Tcond = true;
entry = 0;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if H > Highest(H,n1)[1] and C > O and entry < 거래횟수 Then
Buy("b");
if L < Lowest(L,N1)[1] and C < O and entry < 거래횟수 Then
Sell("s");
if MarketPosition == 1 Then
ExitLong("bx",AtStop,Lowest(L,n)[BarsSinceEntry]-PriceScale*1);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,Highest(H,n)[BarsSinceEntry]+PriceScale*1);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
{
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*mm Then
ExitLong("btr",AtStop,EntryPrice+PriceScale*m1);
}
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*mm Then
ExitShort("str",AtStop,EntryPrice-PriceScale*m1);
}
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);
}
}