커뮤니티
문의 드립니다
2017-06-05 12:40:10
116
글번호 110112
안녕하세요 문의 드립니다
input : Period1(5), Period2(20), Period3(30),시작시간(090300),당일청산시간(142000),스탑(3),len(1.7),len1(0.7),당일수익틱수(12),당일손실틱수(50);
var : 당일손실(0),NP(0),N1(0),dayPL(0),당일수익(0);
var : idx(0),entry(0),tt(0),t1(0),count(0),var1(0),var2(0),var3(0);
NP = NetProfit;
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
var1 = ma(C,Period1);
var2 = ma(C,Period2);
var3 = ma(C,Period3);
# 당일진입횟수계산
count = 0 ;
for value1 = 0 to 10 {
if entrydate(value1) == date then count = count + 1 ;
}
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then {
idx = 0;
N1 = NP;
}
dayPL = NP-N1;
if stime >= 시작시간 and count < 3 Then{
idx = idx+1;
if idx == 1 && var1 > var2
Then buy ("a");
Else
if var2 < var3 && CrossUp(var1,var2)
then buy("b");
if idx == 1 && var1 < var2
Then sell("c");
Else
if var2 > var3 && crossdown(var1,var2)
Then sell("e");
}
if MarketPosition == 1 then { if highest(H,barssinceentry+1) >= EntryPrice + (len) then {
ExitLong ("수익매도청산",AtStop,highest(H,barssinceentry)- (len1));}}
if MarketPosition == -1 then { if lowest(l,barssinceentry+1) <= EntryPrice-(len) then {
ExitShort ("수익매수청산",AtStop,lowest(l,barssinceentry)+(len1));}}
SetStopLoss(스탑,PointStop);
SetStopEndofday(당일청산시간);
1,
수익 매도 청산후 고점을한번이라도 돌파하면 수익매수 청산후 저점을 한번이라도 돌파하면 매매를종료하려합니다
수식 부탁드립니다
2,
위수식중 daypl 은 청산된매매 손익인가요 ? 보유중의 변화하는 손익은 아니죠 ?
3,
예스 자동정정주문시 슬리피지를 진입 청산 각각 0.025 적절한가요 ?
신호가격보다 불리하게 체결이 많은듯해서요 감사합니다
답변 1
예스스탁 예스스탁 답변
2017-06-05 13:14:36
안녕하세요
예스스탁입니다.
1.
input : Period1(5), Period2(20), Period3(30),시작시간(090300),당일청산시간(142000),스탑(3),len(1.7),len1(0.7),당일수익틱수(12),당일손실틱수(50);
var : 당일손실(0),NP(0),N1(0),dayPL(0),당일수익(0),Xcond(false);
var : idx(0),entry(0),tt(0),t1(0),count(0),var1(0),var2(0),var3(0);
NP = NetProfit;
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
var1 = ma(C,Period1);
var2 = ma(C,Period2);
var3 = ma(C,Period3);
# 당일진입횟수계산
count = 0 ;
for value1 = 0 to 10 {
if entrydate(value1) == date then count = count + 1 ;
}
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then {
idx = 0;
N1 = NP;
Xcond = false;
}
dayPL = NP-N1;
if ExitDate(1) == sdate and IsExitName("수익매도청산",1) == true and dayhigh > dayhigh[1] Then
Xcond = true;
if ExitDate(1) == sdate and IsExitName("수익매수청산",1) == true and daylow < daylow[1] Then
Xcond = true;
if stime >= 시작시간 and count < 3 and Xcond == false Then{
idx = idx+1;
if idx == 1 && var1 > var2
Then buy ("a");
Else
if var2 < var3 && CrossUp(var1,var2)
then buy("b");
if idx == 1 && var1 < var2
Then sell("c");
Else
if var2 > var3 && crossdown(var1,var2)
Then sell("e");
}
if MarketPosition == 1 then { if highest(H,barssinceentry+1) >= EntryPrice + (len) then {
ExitLong ("수익매도청산",AtStop,highest(H,barssinceentry)- (len1));}}
if MarketPosition == -1 then { if lowest(l,barssinceentry+1) <= EntryPrice-(len) then {
ExitShort ("수익매수청산",AtStop,lowest(l,barssinceentry)+(len1));}}
SetStopLoss(스탑,PointStop);
SetStopEndofday(당일청산시간);
2
청산된매매 손익입니다.
진행중인 포지션의 손익은 포함되지 않습니다.
진행중인 포지션 손익도 포함하고자 하시면
아래와 같이 작성하시면 됩니다.
dayPL = NP-N1+PositionProfit;
즐거운 하루되세요
> 비상8 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> 안녕하세요 문의 드립니다
input : Period1(5), Period2(20), Period3(30),시작시간(090300),당일청산시간(142000),스탑(3),len(1.7),len1(0.7),당일수익틱수(12),당일손실틱수(50);
var : 당일손실(0),NP(0),N1(0),dayPL(0),당일수익(0);
var : idx(0),entry(0),tt(0),t1(0),count(0),var1(0),var2(0),var3(0);
NP = NetProfit;
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
var1 = ma(C,Period1);
var2 = ma(C,Period2);
var3 = ma(C,Period3);
# 당일진입횟수계산
count = 0 ;
for value1 = 0 to 10 {
if entrydate(value1) == date then count = count + 1 ;
}
if stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간) Then {
idx = 0;
N1 = NP;
}
dayPL = NP-N1;
if stime >= 시작시간 and count < 3 Then{
idx = idx+1;
if idx == 1 && var1 > var2
Then buy ("a");
Else
if var2 < var3 && CrossUp(var1,var2)
then buy("b");
if idx == 1 && var1 < var2
Then sell("c");
Else
if var2 > var3 && crossdown(var1,var2)
Then sell("e");
}
if MarketPosition == 1 then { if highest(H,barssinceentry+1) >= EntryPrice + (len) then {
ExitLong ("수익매도청산",AtStop,highest(H,barssinceentry)- (len1));}}
if MarketPosition == -1 then { if lowest(l,barssinceentry+1) <= EntryPrice-(len) then {
ExitShort ("수익매수청산",AtStop,lowest(l,barssinceentry)+(len1));}}
SetStopLoss(스탑,PointStop);
SetStopEndofday(당일청산시간);
1,
수익 매도 청산후 고점을한번이라도 돌파하면 수익매수 청산후 저점을 한번이라도 돌파하면 매매를종료하려합니다
수식 부탁드립니다
2,
위수식중 daypl 은 청산된매매 손익인가요 ? 보유중의 변화하는 손익은 아니죠 ?
3,
예스 자동정정주문시 슬리피지를 진입 청산 각각 0.025 적절한가요 ?
신호가격보다 불리하게 체결이 많은듯해서요 감사합니다