커뮤니티
수정부탁합니다
2013-03-13 10:04:24
248
글번호 60638
아래의 식이 검증은 완료되었는데 신호가 안나오네요..수정부탁드립니다.
Inputs : LRLen(20), AvgLen(15), MomLen(10), Pcnt(0.5);
Vars : Price(0), XLinReg(0), Mom(0), SetBarH(0), SetBarL(0), SetBarS(0), CountL(0), CountS(0);
#assignment of exponential linear regression and momentum
XLinReg = Ema(LRS(Price, LRLen), AvgLen);
Mom = Ema(Momentum(Price), MomLen);
Price = Close;
#accumulates to count the bars after the setups below
CountL = CountL + 1;
CountS = CountS + 1;
#assignment of system entry/exit criteria
Condition1 = XLinReg > XLinReg[1];
Condition2 = Mom < 0 and Mom > Mom[1];
Condition3 = XLinReg < XLinReg[1];
Condition4 = Mom > 0 and Mom < Mom[1];
#check criteria and generate buy order if criteria have been met within 4 bars
if (XLinReg > XLinReg[1]) and (Mom < 0 and Mom > Mom[1]) then begin
if CountL == 1 or CountL > 4 then begin
SetBarL = High;
CountL = 1;
end
if CountL <= 4 then begin
Value1 = Pcnt * (SetBarL - XLinReg);
Buy("Long", atstop, SetBarL + Value1);
end
end
#check criteria and generate sell order if criteria have been met within 4 bars
if (XLinReg < XLinReg[1]) and (Mom > 0 and Mom < Mom[1]) then begin
if CountS == 1 or CountS > 4 then begin
SetBarS = Low;
CountS = 1;
end
if CountS <= 4 then begin
Value1 = Pcnt * (SetBarS - XLinReg);
Sell("Short", atstop, SetBarS - Value1);
end
end
#trailing stops
if (XLinReg < XLinReg[1]) and (Low < Lowest(Low, 4)[1]) then begin
ExitLong("X", atstop, Low- (Pcnt * ATR(10)));
end
if (XLinReg > XLinReg[1]) and (High > Highest(High, 4)[1]) then begin
ExitShort("Y", atstop, High + (Pcnt * ATR(10)));
end
답변 1
예스스탁 예스스탁 답변
2013-03-13 15:37:43
안녕하세요
예스스탁입니다.
검증은 문법에 대한 검증입니다.
문법상 오류가 없는 부분이고 신호발생과는 관계가 없습니다.
신호가 발생하지 않으면 조건에 만족하는 봉이 없다는 내용입니다.
작성된 식이 TS식을 변환한 식 같습니다. 원본 TS식을 올려주시기 바랍니다.
즐거운 하루되세요
> 필승0701 님이 쓴 글입니다.
> 제목 : 수정부탁합니다
> 아래의 식이 검증은 완료되었는데 신호가 안나오네요..수정부탁드립니다.
Inputs : LRLen(20), AvgLen(15), MomLen(10), Pcnt(0.5);
Vars : Price(0), XLinReg(0), Mom(0), SetBarH(0), SetBarL(0), SetBarS(0), CountL(0), CountS(0);
#assignment of exponential linear regression and momentum
XLinReg = Ema(LRS(Price, LRLen), AvgLen);
Mom = Ema(Momentum(Price), MomLen);
Price = Close;
#accumulates to count the bars after the setups below
CountL = CountL + 1;
CountS = CountS + 1;
#assignment of system entry/exit criteria
Condition1 = XLinReg > XLinReg[1];
Condition2 = Mom < 0 and Mom > Mom[1];
Condition3 = XLinReg < XLinReg[1];
Condition4 = Mom > 0 and Mom < Mom[1];
#check criteria and generate buy order if criteria have been met within 4 bars
if (XLinReg > XLinReg[1]) and (Mom < 0 and Mom > Mom[1]) then begin
if CountL == 1 or CountL > 4 then begin
SetBarL = High;
CountL = 1;
end
if CountL <= 4 then begin
Value1 = Pcnt * (SetBarL - XLinReg);
Buy("Long", atstop, SetBarL + Value1);
end
end
#check criteria and generate sell order if criteria have been met within 4 bars
if (XLinReg < XLinReg[1]) and (Mom > 0 and Mom < Mom[1]) then begin
if CountS == 1 or CountS > 4 then begin
SetBarS = Low;
CountS = 1;
end
if CountS <= 4 then begin
Value1 = Pcnt * (SetBarS - XLinReg);
Sell("Short", atstop, SetBarS - Value1);
end
end
#trailing stops
if (XLinReg < XLinReg[1]) and (Low < Lowest(Low, 4)[1]) then begin
ExitLong("X", atstop, Low- (Pcnt * ATR(10)));
end
if (XLinReg > XLinReg[1]) and (High > Highest(High, 4)[1]) then begin
ExitShort("Y", atstop, High + (Pcnt * ATR(10)));
end