커뮤니티
문의드립니다.
2014-07-23 15:41:21
153
글번호 77026
일봉으로 쭉 청산을 하지 않고 롤오버 시물레이션을 돌려보려고 하는데 신호가 발생하지 않아서 질문드립니다.
1. 국내장에서 일봉으로 시물레이션을 돌려보려는데 신호가 발생하도록 부탁드립니다.
청산하지않고 쭉 가져가는 형식으로 해보려고 합니다.
원래 봉이 완성되어야지 신호가 발생하지않습니까? 그럼 일봉으로 진행할때는 장이 종료가되야지 봉이 완성되는데 그럼 실제로 매매를 하려면 몇시 몇분에 시스템이 진입을 하는겁니까?
2. 그럼 예스글로벌을 통해 해외장에서는 다른 시간제약을 걸어줘야 합니까?
var : T1(0),T2(0),T3(0);
var : X(0),W(0),cnt(0),count(0),NP(0),PreNP(0),dayPL(0);
input : dayentry(4),당일손실(-1.4),loss(100),Profit(100);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
NP = NetProfit;
if date != date[1] Then{
Condition1 = False;
PreNP = NP[1];
}
dayPL = (NP-PreNP)+PositionProfit;
T1=ema(Close,2);
T2=ema(Close,3);
T3=ma(Close,4);
X = min(T1,T2);
W = iff(T3[1]<T3,X,T3);
if Condition1 == false and T1 > W and T1[1] <= W[1] and dayindex > 0 Then
Condition1 = true;
if Condition1 == false and T1 <= W and T1[1] > W[1] and dayindex > 0 Then
Condition1 = true;
if count < dayentry and dayPL > 당일손실 Then{
if T1 > W and dayindex > 0 and Condition1 == true Then{
if count == 0 or
(count >= 1 and MarketPosition == -1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) Then{
buy();
}
}
if T1 <= W and dayindex > 0 and Condition1 == true then {
if count == 0 or
(count >= 1 and MarketPosition == 1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) Then{
sell();
}
}
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
// SetStopEndofday(150000);
if MarketPosition == 1 and T1 <= W Then
ExitLong("daybx2",Atstop,EntryPrice+(당일손실-DayPL));
if MarketPosition == -1 and T1 > W Then
ExitShort("daysx2",Atstop,EntryPrice-(당일손실-DayPL));
if MarketPosition == 1 and T1 <= W Then
ExitLong();
if MarketPosition == -1 and T1 > W Then
ExitShort();
답변 1
예스스탁 예스스탁 답변
2014-07-24 14:21:30
안녕하세요
예스스탁입니다.
1.
봉완성은 다음봉 시가가 수신될때 입니다.
일봉차트이면 다음봉 시가수신될때 주문이 발생합니다.
또한 올리신 식은 분봉용식입니다.
수식안에 당일 봉수 및 시간등이 사용되므로 분봉에서만 적요할수 있습니다.
일봉에서는 적용할수 없는 내용입니다.
2.
기존식는 하루의 기준을 0시를 기준으로 합니다.
해외선물의 경우 거래소에서 영업일을 판단하는 시간이 다릅니다.
아래 두 지표를 적용해 보시면 시초가가 변경되는 시간을 확인할 수 있습니다.
#봉시간
plot1(stime);
#시초가
plot1(dayopen);
첨부된 파일은 유로Fx의 시장시간기준(거래소시간)과 한국시간기준으로
차트를 셋팅했을때의 장시작 시간입니다.
차트의 기준시간 설정과 종목에 따라 시간이 다르므로
차트에 위 지표식 2개 적용해 확인하시고 시간 지정하셔야 합니다.
아래식은 유로fx기준이고 기준시간은 한국시간으로 했을 경우입니다.
input : dayentry(4),당일손실틱수(50),loss(100),Profit(100);
var : T1(0),T2(0),T3(0);
var : X(0),W(0),cnt(0),count(0),NP(0),PreNP(0),dayPL(0),Didx(0);
var : 당일손실(0);
당일손실 = -(PriceScale*당일손실틱수);
NP = NetProfit;
if stime == 070000 or (stime > 070000 and stime[1] < 070000) Then{
count = 0;
Condition1 = False;
PreNP = NP[1];
Didx = 0;
}
Didx = Didx+1;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
dayPL = (NP-PreNP)+PositionProfit;
T1=ema(Close,2);
T2=ema(Close,3);
T3=ma(Close,4);
X = min(T1,T2);
W = iff(T3[1]<T3,X,T3);
if Condition1 == false and T1 > W and T1[1] <= W[1] and Didx > 0 Then
Condition1 = true;
if Condition1 == false and T1 <= W and T1[1] > W[1] and Didx > 0 Then
Condition1 = true;
if count < dayentry and dayPL > 당일손실 Then{
if T1 > W and Didx > 0 and Condition1 == true Then{
if count == 0 or
(count >= 1 and MarketPosition == -1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) Then{
buy();
}
}
if T1 <= W and Didx > 0 and Condition1 == true then {
if count == 0 or
(count >= 1 and MarketPosition == 1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) Then{
sell();
}
}
}
SetStopProfittarget(Profit*PriceScale,PointStop);
SetStopLoss(loss*PriceScale,PointStop);
// SetStopEndofday(150000);
if MarketPosition == 1 and T1 <= W Then
ExitLong("daybx2",Atstop,EntryPrice+(당일손실-DayPL));
if MarketPosition == -1 and T1 > W Then
ExitShort("daysx2",Atstop,EntryPrice-(당일손실-DayPL));
if MarketPosition == 1 and T1 <= W Then
ExitLong();
if MarketPosition == -1 and T1 > W Then
ExitShort();
즐거운 하루되세요
> 마코 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 일봉으로 쭉 청산을 하지 않고 롤오버 시물레이션을 돌려보려고 하는데 신호가 발생하지 않아서 질문드립니다.
1. 국내장에서 일봉으로 시물레이션을 돌려보려는데 신호가 발생하도록 부탁드립니다.
청산하지않고 쭉 가져가는 형식으로 해보려고 합니다.
원래 봉이 완성되어야지 신호가 발생하지않습니까? 그럼 일봉으로 진행할때는 장이 종료가되야지 봉이 완성되는데 그럼 실제로 매매를 하려면 몇시 몇분에 시스템이 진입을 하는겁니까?
2. 그럼 예스글로벌을 통해 해외장에서는 다른 시간제약을 걸어줘야 합니까?
var : T1(0),T2(0),T3(0);
var : X(0),W(0),cnt(0),count(0),NP(0),PreNP(0),dayPL(0);
input : dayentry(4),당일손실(-1.4),loss(100),Profit(100);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
NP = NetProfit;
if date != date[1] Then{
Condition1 = False;
PreNP = NP[1];
}
dayPL = (NP-PreNP)+PositionProfit;
T1=ema(Close,2);
T2=ema(Close,3);
T3=ma(Close,4);
X = min(T1,T2);
W = iff(T3[1]<T3,X,T3);
if Condition1 == false and T1 > W and T1[1] <= W[1] and dayindex > 0 Then
Condition1 = true;
if Condition1 == false and T1 <= W and T1[1] > W[1] and dayindex > 0 Then
Condition1 = true;
if count < dayentry and dayPL > 당일손실 Then{
if T1 > W and dayindex > 0 and Condition1 == true Then{
if count == 0 or
(count >= 1 and MarketPosition == -1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != 1) Then{
buy();
}
}
if T1 <= W and dayindex > 0 and Condition1 == true then {
if count == 0 or
(count >= 1 and MarketPosition == 1) Or
(Count >= 1 and MarketPosition == 0 and MarketPosition(1) != -1) Then{
sell();
}
}
}
SetStopProfittarget(Profit,PointStop);
SetStopLoss(loss,PointStop);
// SetStopEndofday(150000);
if MarketPosition == 1 and T1 <= W Then
ExitLong("daybx2",Atstop,EntryPrice+(당일손실-DayPL));
if MarketPosition == -1 and T1 > W Then
ExitShort("daysx2",Atstop,EntryPrice-(당일손실-DayPL));
if MarketPosition == 1 and T1 <= W Then
ExitLong();
if MarketPosition == -1 and T1 > W Then
ExitShort();
다음글
이전글