커뮤니티
TS 수식 문의드립니다.
2013-09-03 14:57:11
108
글번호 67136
TS를 하루에 여러번 사용한다고 가정하고 식을 만들어보았습니다.
1) TS-ON을 시간으로 세번정도를 나누기.
예를들면 9시~10시15 10시15분~13시50분 13시50분 이후...
2) 또 다른 TS-ON 배분하는 경우: 수익을 기준으로
예를들면 -10%, 0.5%, 1%,1.5%, 2%이상..
아래와 같이 식을 만들었는데, 이 식으로 하니 뒷 타임에 식이 안 먹는거 같아요.
수식이 맞는지 확인 부탁드립니다.
##############################################################################
## Trailing Stop
##############################################################################
input : first_on(4),first_cut(4), second_on(2.5), second_cut(2.5), third_on(999),third_cut(999) ;
if stime >= 090000 then
SetStopTrailing(first_cut,first_on,PercentStop,0);
if stime >= 101500 then //중국장 시작
SetStopTrailing(second_cut,second_on,PercentStop,0);
if stime >= 123000 then //일본장 오후장 시작
SetStopTrailing(third_cut,third_on,PercentStop,0);
###########################################
## 선물 1분봉
## 슬리피지 및 수수료 :1틱(0.05Point)
## 2007.1~2012.12.30 : 연평균 포인트
###########################################
Input : St_time(90000),Fn_time(144500) ;
var : b_ent(0), s_ent(0) ;
b_ent=0;
s_ent=0;
if sDate==exitdate(1) then Begin
if EntryName(1)=="buy" Then b_ent=b_ent+1;
if entryname(1)=="sell" Then s_ent=s_ent+1;
end;
##############################################################################
## 진입
##############################################################################
Var50 = (Bids-Asks)/(Bids+Asks);
If MarketPosition == 0 and sTime >=St_time Then
if b_ent < 1 and var50 > 0.2 Then Buy("buy",OnClose,def,1);
if s_ent < 1 and var50 < -0.2 Then Sell("sell",OnClose,def,1);
##############################################################################
## 당일청산
##############################################################################
SetStopEndofday(Fn_time);
##############################################################################
## Trailing Stop
##############################################################################
input : first_on(4),first_cut(4), second_on(2.5), second_cut(2.5), third_on(999),third_cut(999) ;
if stime >= 090000 then
SetStopTrailing(first_cut,first_on,PercentStop,0);
if stime >= 101500 then //중국장 시작
SetStopTrailing(second_cut,second_on,PercentStop,0);
if stime >= 123000 then //일본장 오후장 시작
SetStopTrailing(third_cut,third_on,PercentStop,0);
#---Position Profit에 따라 단계별 TS---------------------------------------------
//input : first_on1(1),first_cut1(3), second_on1(3), second_cut1(3), third_on1(5),third_cut1(1) ;
//
//if PositionProfit() >= 1 then
// SetStopTrailing(first_cut1,first_on1,PointStop,0);
//
//if PositionProfit() >= 3 then
// SetStopTrailing(first_cut1,first_on1,PointStop,0);
////
//if PositionProfit() >= 5 then
// SetStopTrailing(first_cut1,first_on1,PointStop,0);
답변 1
예스스탁 예스스탁 답변
2013-09-04 09:22:07
안녕하세요
예스스탁입니다.
수식은 위에서 아래로 읽어 들어가게 됩니다.
작성하신 식은 항상 제일 위의 트레일링스탑이 적용이 됩니다.
현재 시간이 10시 30분이면 if stime >= 090000 then 조건도 만족을 하므로
첫번째 트레일링스탑이 먼저 셋팅이 됩니다.
아래와 같이 서로 조건이 겹치기 않게 작성해 주셔야 합니다.
#1
input : first_on(4),first_cut(4), second_on(2.5), second_cut(2.5), third_on(999),third_cut(999) ;
if stime >= 090000 and stime < 101500 then
SetStopTrailing(first_cut,first_on,PercentStop,0);
if stime >= 101500 and stime < 123000 then //중국장 시작
SetStopTrailing(second_cut,second_on,PercentStop,0);
if stime >= 123000 then //일본장 오후장 시작
SetStopTrailing(third_cut,third_on,PercentStop,0);
#2
input : first_on1(1),first_cut1(3), second_on1(3), second_cut1(3), third_on1(5),third_cut1(1) ;
if PositionProfit() >= 1 and PositionProfit < 3 then
SetStopTrailing(first_cut1,first_on1,PointStop,0);
if PositionProfit() >= 3 and PositionProfit < 5 then
SetStopTrailing(first_cut1,first_on1,PointStop,0);
if PositionProfit() >= 5 then
SetStopTrailing(first_cut1,first_on1,PointStop,0);
즐거운 하루되세요
> stella 님이 쓴 글입니다.
> 제목 : TS 수식 문의드립니다.
> TS를 하루에 여러번 사용한다고 가정하고 식을 만들어보았습니다.
1) TS-ON을 시간으로 세번정도를 나누기.
예를들면 9시~10시15 10시15분~13시50분 13시50분 이후...
2) 또 다른 TS-ON 배분하는 경우: 수익을 기준으로
예를들면 -10%, 0.5%, 1%,1.5%, 2%이상..
아래와 같이 식을 만들었는데, 이 식으로 하니 뒷 타임에 식이 안 먹는거 같아요.
수식이 맞는지 확인 부탁드립니다.
##############################################################################
## Trailing Stop
##############################################################################
input : first_on(4),first_cut(4), second_on(2.5), second_cut(2.5), third_on(999),third_cut(999) ;
if stime >= 090000 then
SetStopTrailing(first_cut,first_on,PercentStop,0);
if stime >= 101500 then //중국장 시작
SetStopTrailing(second_cut,second_on,PercentStop,0);
if stime >= 123000 then //일본장 오후장 시작
SetStopTrailing(third_cut,third_on,PercentStop,0);
###########################################
## 선물 1분봉
## 슬리피지 및 수수료 :1틱(0.05Point)
## 2007.1~2012.12.30 : 연평균 포인트
###########################################
Input : St_time(90000),Fn_time(144500) ;
var : b_ent(0), s_ent(0) ;
b_ent=0;
s_ent=0;
if sDate==exitdate(1) then Begin
if EntryName(1)=="buy" Then b_ent=b_ent+1;
if entryname(1)=="sell" Then s_ent=s_ent+1;
end;
##############################################################################
## 진입
##############################################################################
Var50 = (Bids-Asks)/(Bids+Asks);
If MarketPosition == 0 and sTime >=St_time Then
if b_ent < 1 and var50 > 0.2 Then Buy("buy",OnClose,def,1);
if s_ent < 1 and var50 < -0.2 Then Sell("sell",OnClose,def,1);
##############################################################################
## 당일청산
##############################################################################
SetStopEndofday(Fn_time);
##############################################################################
## Trailing Stop
##############################################################################
input : first_on(4),first_cut(4), second_on(2.5), second_cut(2.5), third_on(999),third_cut(999) ;
if stime >= 090000 then
SetStopTrailing(first_cut,first_on,PercentStop,0);
if stime >= 101500 then //중국장 시작
SetStopTrailing(second_cut,second_on,PercentStop,0);
if stime >= 123000 then //일본장 오후장 시작
SetStopTrailing(third_cut,third_on,PercentStop,0);
#---Position Profit에 따라 단계별 TS---------------------------------------------
//input : first_on1(1),first_cut1(3), second_on1(3), second_cut1(3), third_on1(5),third_cut1(1) ;
//
//if PositionProfit() >= 1 then
// SetStopTrailing(first_cut1,first_on1,PointStop,0);
//
//if PositionProfit() >= 3 then
// SetStopTrailing(first_cut1,first_on1,PointStop,0);
////
//if PositionProfit() >= 5 then
// SetStopTrailing(first_cut1,first_on1,PointStop,0);
다음글
이전글