커뮤니티
글번호 50130 재검토 요청드립니다.
2016-10-29 11:20:28
113
글번호 103484
안녕하신 운영자님
작성해주신 수식에 의해 시물레이션 해보면 매수진입시에는 손절이 15틱 잘 맞는데 매도진입 시에는 손절이 일관적이지가 않은 것 같습니다.
2016년 10월 25일자 /26 자 사진을 첨부해 드리오니 검토 부탁드립니다.
input : 거래시간1(1), 시작시간1(200000), 끝시간1(10000),익절틱수 (36),손절틱수 (15);
input : P1(5),P2(20),N(20),X(10);
var : AA(0),BB(0),DD(0),HH(0),LL(0);
if 거래시간1 == 1 then
condition3 = (stime>=시작시간1 or stime<=끝시간1);
Else if 거래시간1 == 2 then
condition3 = (stime>=시작시간1 and stime<=끝시간1);
Else
condition3 = true;
AA = ma(C,P1);
BB = ma(C,P2);
DD = Disparity(P2);
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
BB > BB[1] and C < AA and C > BB and C < O and
DD <= 100.5 and
highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then
buy();
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
BB < BB[1] and C > AA and C < BB and C > O and
DD >= 99.5 and
highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then
Sell();
if MarketPosition == 1 Then{
HH = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수))+(PriceScale*손절틱수)*HH);
}
if MarketPosition == -1 Then{
LL = Floor((Lowest(L,BarsSinceEntry)-EntryPrice)/(PriceScale*손절틱수));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수)*LL);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
- 1. 2016-10-25.PNG (0.03 MB)
- 2. 2016-10-26.PNG (0.04 MB)
답변 1
예스스탁 예스스탁 답변
2016-10-31 10:11:16
안녕하세요
예스스탁입니다.
매도 쪽에 수익 계산이 잘못되어 있어 수정했습니다.
input : 거래시간1(1), 시작시간1(200000), 끝시간1(10000),익절틱수 (36),손절틱수 (15);
input : P1(5),P2(20),N(20),X(10);
var : AA(0),BB(0),DD(0),HH(0),LL(0);
if 거래시간1 == 1 then
condition3 = (stime>=시작시간1 or stime<=끝시간1);
Else if 거래시간1 == 2 then
condition3 = (stime>=시작시간1 and stime<=끝시간1);
Else
condition3 = true;
AA = ma(C,P1);
BB = ma(C,P2);
DD = Disparity(P2);
if dayindex == 0 Then
sell();
if MarketPosition == 1 Then{
HH = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수))+(PriceScale*손절틱수)*HH);
}
if MarketPosition == -1 Then{
LL = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수)*LL);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
즐거운 하루되세요
> 고박사122 님이 쓴 글입니다.
> 제목 : 글번호 50130 재검토 요청드립니다.
> 안녕하신 운영자님
작성해주신 수식에 의해 시물레이션 해보면 매수진입시에는 손절이 15틱 잘 맞는데 매도진입 시에는 손절이 일관적이지가 않은 것 같습니다.
2016년 10월 25일자 /26 자 사진을 첨부해 드리오니 검토 부탁드립니다.
input : 거래시간1(1), 시작시간1(200000), 끝시간1(10000),익절틱수 (36),손절틱수 (15);
input : P1(5),P2(20),N(20),X(10);
var : AA(0),BB(0),DD(0),HH(0),LL(0);
if 거래시간1 == 1 then
condition3 = (stime>=시작시간1 or stime<=끝시간1);
Else if 거래시간1 == 2 then
condition3 = (stime>=시작시간1 and stime<=끝시간1);
Else
condition3 = true;
AA = ma(C,P1);
BB = ma(C,P2);
DD = Disparity(P2);
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
BB > BB[1] and C < AA and C > BB and C < O and
DD <= 100.5 and
highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then
buy();
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
BB < BB[1] and C > AA and C < BB and C > O and
DD >= 99.5 and
highest(BB,N) >= Lowest(BB,N)+PriceScale*X Then
Sell();
if MarketPosition == 1 Then{
HH = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수))+(PriceScale*손절틱수)*HH);
}
if MarketPosition == -1 Then{
LL = Floor((Lowest(L,BarsSinceEntry)-EntryPrice)/(PriceScale*손절틱수));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수)*LL);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간1 or (stime > 끝시간1 and stime[1] < 끝시간1) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
다음글
이전글