커뮤니티
26536관련
2012-10-07 11:04:05
309
글번호 55352
전략실행챠트 실시간 에서는 정상적인 신호사 발생하지만
시뮬레이션 챠트에서는 신호가 안 잡히는 이유는 뭘까요?
답변 1
예스스탁 예스스탁 답변
2012-10-08 13:50:53
안녕하세요
예스스탁입니다.
함수의 기준값이 외부변수(price)로 되어 있기 때문입니다.
아래식 적용하시면 됩니다.
Input: Length(6), Const(1.2), ChanPcnt(.6),KTCNUM(5);
Var : KCU(0), KCL(0), ChanRng(0), AvgVal(0), AvgRange(0), SetBar(0), CountL(0), CountS(0);
var : MP(0),BuySetup(0),SellSetUp(0),EntriesToday(0),cnt(0);
if DATE <> DATE[1] then {
BuySetup = 0;
SellSetuP= 0;
}
MP= MARKETPOSITION;
IF MP == 1 THEN BuySetup = 1;
IF MP == -1 THEN SellSetup = 1;
EntriesToday = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
EntriesToday = EntriesToday +1;
}
#{Assignments of Keltner calculations}
AvgVal = Average(c, Length);
AvgRange = Average(TrueRange, Length);
KCU = AvgVal + AvgRange * Const;
KCL = AvgVal - AvgRange * Const;
ChanRng = (KCU - KCL) / 2;
#{Accumulates to count the bars after the SetUps below}
CountL = CountL + 1;
CountS = CountS + 1;
#{Buy Criteria Evaluation}
IF crossup(c, KCU) Then {
SetBar = High;
CountL = 1;
}
#{Sell Criteria Evaluation}
IF CrossDown(c,KCL) Then {
SetBar = Low;
CountS = 1;
}
If EntriesToday < 2 AND TIME < 145000 then {
IF MP <> 1 AND bUYsETUP==0 AND c > KCU AND CountL <= KTCNUM Then
Buy("b",AtStop,SetBar + (ChanRng * ChanPcnt));
}
#{Trailing Stops}
input : ATRLength(20),Chand(2.7),YOYO(2.3);
VAR : highPoint(0),LowPoint(0);
If MP == 1 Then{
HighPoint = Highest(High,barsSinceEntry +1);
exitlong("buyTStop",AtStop,HighPoint - Chand * ATR(ATRLength));
exitlong("BuyYoYStop",AtStop,Close - YoYo * ATR(ATRLength));
}
SetStopEndofday(145800);
즐거운 하루되세요
> ciao 님이 쓴 글입니다.
> 제목 : 26536관련
> 전략실행챠트 실시간 에서는 정상적인 신호사 발생하지만
시뮬레이션 챠트에서는 신호가 안 잡히는 이유는 뭘까요?