커뮤니티
수식
2012-10-04 12:46:05
377
글번호 55291
아래의 식을 예스랭귀지로 변환 부탁드리겠습니다, 감사합니다
Inputs: Price(Close), Length(6), Const(1.2), ChanPcnt(.6),KTCNUM(5);
Vars: KCU(0), KCL(0), ChanRng(0), AvgVal(0), AvgRange(0), SetBar(0), CountL(0), CountS(0);
var : MP(0),BuySetup(0),SellSetUp(0);
if DATE <> DATE[1] then begin
BuySetup = 0;
SellSetuP= 0;
end;
MP= MARKETPOSITION;
IF MP = 1 THEN BuySetup = 1;
IF MP = -1 THEN SellSetup = 1;
{Assignments of Keltner calculations}
AvgVal = Average(Price, 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 Price Crosses Above KCU Then Begin
SetBar = High;
CountL = 1;
End;
{Sell Criteria Evaluation}
IF Price Crosses Below KCL Then Begin
SetBar = Low;
CountS = 1;
End;
If EntriesToday(DATE) < 2 AND TIME < 1450 then BEGIN
IF MP<> 1 AND bUYsETUP=0 AND Price > KCU AND CountL <= KTCNUM Then
Buy Next Bar at SetBar + (ChanRng * ChanPcnt) Stop;
end;
{Trailing Stops}
input : ATRLength(20),Chand(2.7),YOYO(2.3);
VAR : highPoint(0),LowPoint(0);
If MP = 1 Then BEGIN
HighPoint = Highest(High,barsSinceEntry +1);
exitlong("buyTStop") at HighPoint - Chand * AvgTrueRange(ATRLength) stop;
exitlong("BuyYoYStop") at Close - YoYo * AvgTrueRange(ATRLength) stop;
End;
If MP = 1 And Time > 1458 Then begin
exitlong ("BuyTimeOut") ;
end;
답변 4
예스스탁 예스스탁 답변
2012-10-05 09:49:52
안녕하세요
예스스탁입니다.
Input: Price(Close), 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(Price, 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(Price, KCU) Then {
SetBar = High;
CountL = 1;
}
#{Sell Criteria Evaluation}
IF CrossDown(Price,KCL) Then {
SetBar = Low;
CountS = 1;
}
If EntriesToday < 2 AND TIME < 145000 then {
IF MP <> 1 AND bUYsETUP==0 AND Price > 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 님이 쓴 글입니다.
> 제목 : 수식
> 아래의 식을 예스랭귀지로 변환 부탁드리겠습니다, 감사합니다
Inputs: Price(Close), Length(6), Const(1.2), ChanPcnt(.6),KTCNUM(5);
Vars: KCU(0), KCL(0), ChanRng(0), AvgVal(0), AvgRange(0), SetBar(0), CountL(0), CountS(0);
var : MP(0),BuySetup(0),SellSetUp(0);
if DATE <> DATE[1] then begin
BuySetup = 0;
SellSetuP= 0;
end;
MP= MARKETPOSITION;
IF MP = 1 THEN BuySetup = 1;
IF MP = -1 THEN SellSetup = 1;
{Assignments of Keltner calculations}
AvgVal = Average(Price, 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 Price Crosses Above KCU Then Begin
SetBar = High;
CountL = 1;
End;
{Sell Criteria Evaluation}
IF Price Crosses Below KCL Then Begin
SetBar = Low;
CountS = 1;
End;
If EntriesToday(DATE) < 2 AND TIME < 1450 then BEGIN
IF MP<> 1 AND bUYsETUP=0 AND Price > KCU AND CountL <= KTCNUM Then
Buy Next Bar at SetBar + (ChanRng * ChanPcnt) Stop;
end;
{Trailing Stops}
input : ATRLength(20),Chand(2.7),YOYO(2.3);
VAR : highPoint(0),LowPoint(0);
If MP = 1 Then BEGIN
HighPoint = Highest(High,barsSinceEntry +1);
exitlong("buyTStop") at HighPoint - Chand * AvgTrueRange(ATRLength) stop;
exitlong("BuyYoYStop") at Close - YoYo * AvgTrueRange(ATRLength) stop;
End;
If MP = 1 And Time > 1458 Then begin
exitlong ("BuyTimeOut") ;
end;
ciao
2012-10-05 10:37:02
답변 감사드립니다///
수식을 적용해 보니 신호가 나오지 않습니다...
뭐가 문제인지요?
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식
> 안녕하세요
예스스탁입니다.
Input: Price(Close), 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(Price, 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(Price, KCU) Then {
SetBar = High;
CountL = 1;
}
#{Sell Criteria Evaluation}
IF CrossDown(Price,KCL) Then {
SetBar = Low;
CountS = 1;
}
If EntriesToday < 2 AND TIME < 145000 then {
IF MP <> 1 AND bUYsETUP==0 AND Price > 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 님이 쓴 글입니다.
> 제목 : 수식
> 아래의 식을 예스랭귀지로 변환 부탁드리겠습니다, 감사합니다
Inputs: Price(Close), Length(6), Const(1.2), ChanPcnt(.6),KTCNUM(5);
Vars: KCU(0), KCL(0), ChanRng(0), AvgVal(0), AvgRange(0), SetBar(0), CountL(0), CountS(0);
var : MP(0),BuySetup(0),SellSetUp(0);
if DATE <> DATE[1] then begin
BuySetup = 0;
SellSetuP= 0;
end;
MP= MARKETPOSITION;
IF MP = 1 THEN BuySetup = 1;
IF MP = -1 THEN SellSetup = 1;
{Assignments of Keltner calculations}
AvgVal = Average(Price, 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 Price Crosses Above KCU Then Begin
SetBar = High;
CountL = 1;
End;
{Sell Criteria Evaluation}
IF Price Crosses Below KCL Then Begin
SetBar = Low;
CountS = 1;
End;
If EntriesToday(DATE) < 2 AND TIME < 1450 then BEGIN
IF MP<> 1 AND bUYsETUP=0 AND Price > KCU AND CountL <= KTCNUM Then
Buy Next Bar at SetBar + (ChanRng * ChanPcnt) Stop;
end;
{Trailing Stops}
input : ATRLength(20),Chand(2.7),YOYO(2.3);
VAR : highPoint(0),LowPoint(0);
If MP = 1 Then BEGIN
HighPoint = Highest(High,barsSinceEntry +1);
exitlong("buyTStop") at HighPoint - Chand * AvgTrueRange(ATRLength) stop;
exitlong("BuyYoYStop") at Close - YoYo * AvgTrueRange(ATRLength) stop;
End;
If MP = 1 And Time > 1458 Then begin
exitlong ("BuyTimeOut") ;
end;
예스스탁 예스스탁 답변
2012-10-05 10:50:34
안녕하세요
예스스탁입니다.
해당식 차트에 적용한 리포트 입니다.
정상적으로 신호 발생합니다.
연결선물 5분봉 차트(5000개봉)입니다.
즐거운 하루되세요
> ciao 님이 쓴 글입니다.
> 제목 : Re : Re : 수식
> 답변 감사드립니다///
수식을 적용해 보니 신호가 나오지 않습니다...
뭐가 문제인지요?
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식
> 안녕하세요
예스스탁입니다.
Input: Price(Close), 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(Price, 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(Price, KCU) Then {
SetBar = High;
CountL = 1;
}
#{Sell Criteria Evaluation}
IF CrossDown(Price,KCL) Then {
SetBar = Low;
CountS = 1;
}
If EntriesToday < 2 AND TIME < 145000 then {
IF MP <> 1 AND bUYsETUP==0 AND Price > 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 님이 쓴 글입니다.
> 제목 : 수식
> 아래의 식을 예스랭귀지로 변환 부탁드리겠습니다, 감사합니다
Inputs: Price(Close), Length(6), Const(1.2), ChanPcnt(.6),KTCNUM(5);
Vars: KCU(0), KCL(0), ChanRng(0), AvgVal(0), AvgRange(0), SetBar(0), CountL(0), CountS(0);
var : MP(0),BuySetup(0),SellSetUp(0);
if DATE <> DATE[1] then begin
BuySetup = 0;
SellSetuP= 0;
end;
MP= MARKETPOSITION;
IF MP = 1 THEN BuySetup = 1;
IF MP = -1 THEN SellSetup = 1;
{Assignments of Keltner calculations}
AvgVal = Average(Price, 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 Price Crosses Above KCU Then Begin
SetBar = High;
CountL = 1;
End;
{Sell Criteria Evaluation}
IF Price Crosses Below KCL Then Begin
SetBar = Low;
CountS = 1;
End;
If EntriesToday(DATE) < 2 AND TIME < 1450 then BEGIN
IF MP<> 1 AND bUYsETUP=0 AND Price > KCU AND CountL <= KTCNUM Then
Buy Next Bar at SetBar + (ChanRng * ChanPcnt) Stop;
end;
{Trailing Stops}
input : ATRLength(20),Chand(2.7),YOYO(2.3);
VAR : highPoint(0),LowPoint(0);
If MP = 1 Then BEGIN
HighPoint = Highest(High,barsSinceEntry +1);
exitlong("buyTStop") at HighPoint - Chand * AvgTrueRange(ATRLength) stop;
exitlong("BuyYoYStop") at Close - YoYo * AvgTrueRange(ATRLength) stop;
End;
If MP = 1 And Time > 1458 Then begin
exitlong ("BuyTimeOut") ;
end;
ciao
2012-10-05 10:58:12
전략실행챠트 실시간 에서는 정상적인 신호사 발생하지만
시뮬레이션 챠트에서는 신호가 안 잡히는 이유는 뭘까요?
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : Re : Re : 수식
> 안녕하세요
예스스탁입니다.
해당식 차트에 적용한 리포트 입니다.
정상적으로 신호 발생합니다.
연결선물 5분봉 차트(5000개봉)입니다.
즐거운 하루되세요
> ciao 님이 쓴 글입니다.
> 제목 : Re : Re : 수식
> 답변 감사드립니다///
수식을 적용해 보니 신호가 나오지 않습니다...
뭐가 문제인지요?
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식
> 안녕하세요
예스스탁입니다.
Input: Price(Close), 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(Price, 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(Price, KCU) Then {
SetBar = High;
CountL = 1;
}
#{Sell Criteria Evaluation}
IF CrossDown(Price,KCL) Then {
SetBar = Low;
CountS = 1;
}
If EntriesToday < 2 AND TIME < 145000 then {
IF MP <> 1 AND bUYsETUP==0 AND Price > 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 님이 쓴 글입니다.
> 제목 : 수식
> 아래의 식을 예스랭귀지로 변환 부탁드리겠습니다, 감사합니다
Inputs: Price(Close), Length(6), Const(1.2), ChanPcnt(.6),KTCNUM(5);
Vars: KCU(0), KCL(0), ChanRng(0), AvgVal(0), AvgRange(0), SetBar(0), CountL(0), CountS(0);
var : MP(0),BuySetup(0),SellSetUp(0);
if DATE <> DATE[1] then begin
BuySetup = 0;
SellSetuP= 0;
end;
MP= MARKETPOSITION;
IF MP = 1 THEN BuySetup = 1;
IF MP = -1 THEN SellSetup = 1;
{Assignments of Keltner calculations}
AvgVal = Average(Price, 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 Price Crosses Above KCU Then Begin
SetBar = High;
CountL = 1;
End;
{Sell Criteria Evaluation}
IF Price Crosses Below KCL Then Begin
SetBar = Low;
CountS = 1;
End;
If EntriesToday(DATE) < 2 AND TIME < 1450 then BEGIN
IF MP<> 1 AND bUYsETUP=0 AND Price > KCU AND CountL <= KTCNUM Then
Buy Next Bar at SetBar + (ChanRng * ChanPcnt) Stop;
end;
{Trailing Stops}
input : ATRLength(20),Chand(2.7),YOYO(2.3);
VAR : highPoint(0),LowPoint(0);
If MP = 1 Then BEGIN
HighPoint = Highest(High,barsSinceEntry +1);
exitlong("buyTStop") at HighPoint - Chand * AvgTrueRange(ATRLength) stop;
exitlong("BuyYoYStop") at Close - YoYo * AvgTrueRange(ATRLength) stop;
End;
If MP = 1 And Time > 1458 Then begin
exitlong ("BuyTimeOut") ;
end;