커뮤니티
부탁합니다
2017-01-23 16:37:04
111
글번호 106208
input : ntime(300),sig(100),Period1(5),Period2(20);
var : mav1(0),mav2(0);
var1 = Accum(iff(ma(c-c[1],ntime) > 0,1,-1) * pow((ma(pow(c-c[1],2),ntime)+1),0.5)+
pow((pow(c-c[1],2) +1),0.5) * iff(c>c[1],1,-1));
var2 = ma(var1,sig);
mav1 = ma(c, Period1);
mav2 = ma(c, Period2);
if MarketPosition <= 0 and
(crossup(var1,var2) or var1 > var2 and mav1 > mav1[1]) Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if var1 > var2 and mav1 > mav1[1] and CurrentContracts < 5 Then
buy("bb",OnClose,def,1);
if mav2 < mav2[1] then{
ExitLong("bx");
}
}
if MarketPosition >= 0 and
(CrossDown(var1,var2) or var1 < var2 and mav1 < mav1[1]) Then
sell("s",OnClose,def,1);
if MarketPosition == -1 then{
if var1 < var2 and mav1 < mav1[1] and CurrentContracts < 5 Then
sell("ss",OnClose,def,1);
if mav2 > mav2[1] Then
ExitShort("sx");
}
위식에 아래를 삽입하여 주세요
매수진입 후 평단가 대비 일괄 매수청산(8틱)
--- 매수청산 후 매수진입 조건이 만족하면 매수진입
매수진입후 평단가 대비 일관 손절(8틱)
---- 손절 후 위 시스템 정상 추진
매도진입후 평단가 대비 일괄 매도청산(8틱)
--- 매도청산 후 매도진입 조건이 만족하면 매도진입
매도진입후 평단가 대비 일관 손절(8틱)
---- 손절 후 시스템 정상 추진
아울러 input : 매수,매도 진입틱수, 매수, 매도 청약틱수 2가지 추가 부탁합니다
매번 감사합니다
답변 1
예스스탁 예스스탁 답변
2017-01-24 09:22:30
안녕하세요
예스스탁입니다.
진입틱수와 청약틱수는 어떤 의미인지 모르겠습니다.
평단가 대비 익절과 손절틱수 지정하실수 있게 작성해 드립니다.
input : ntime(300),sig(100),Period1(5),Period2(20),익절틱수(8),손절틱수(8);
var : mav1(0),mav2(0);
var1 = Accum(iff(ma(c-c[1],ntime) > 0,1,-1) * pow((ma(pow(c-c[1],2),ntime)+1),0.5)+
pow((pow(c-c[1],2) +1),0.5) * iff(c>c[1],1,-1));
var2 = ma(var1,sig);
mav1 = ma(c, Period1);
mav2 = ma(c, Period2);
if MarketPosition <= 0 and
(crossup(var1,var2) or var1 > var2 and mav1 > mav1[1]) Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if var1 > var2 and mav1 > mav1[1] and CurrentContracts < 5 Then
buy("bb",OnClose,def,1);
if mav2 < mav2[1] then{
ExitLong("bx");
}
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*익절틱수);
ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*손절틱수);
}
if MarketPosition >= 0 and
(CrossDown(var1,var2) or var1 < var2 and mav1 < mav1[1]) Then
sell("s",OnClose,def,1);
if MarketPosition == -1 then{
if var1 < var2 and mav1 < mav1[1] and CurrentContracts < 5 Then
sell("ss",OnClose,def,1);
if mav2 > mav2[1] Then
ExitShort("sx");
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*익절틱수);
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*손절틱수);
}
즐거운 하루되세요
> 남산 님이 쓴 글입니다.
> 제목 : 부탁합니다
> input : ntime(300),sig(100),Period1(5),Period2(20);
var : mav1(0),mav2(0);
var1 = Accum(iff(ma(c-c[1],ntime) > 0,1,-1) * pow((ma(pow(c-c[1],2),ntime)+1),0.5)+
pow((pow(c-c[1],2) +1),0.5) * iff(c>c[1],1,-1));
var2 = ma(var1,sig);
mav1 = ma(c, Period1);
mav2 = ma(c, Period2);
if MarketPosition <= 0 and
(crossup(var1,var2) or var1 > var2 and mav1 > mav1[1]) Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if var1 > var2 and mav1 > mav1[1] and CurrentContracts < 5 Then
buy("bb",OnClose,def,1);
if mav2 < mav2[1] then{
ExitLong("bx");
}
}
if MarketPosition >= 0 and
(CrossDown(var1,var2) or var1 < var2 and mav1 < mav1[1]) Then
sell("s",OnClose,def,1);
if MarketPosition == -1 then{
if var1 < var2 and mav1 < mav1[1] and CurrentContracts < 5 Then
sell("ss",OnClose,def,1);
if mav2 > mav2[1] Then
ExitShort("sx");
}
위식에 아래를 삽입하여 주세요
매수진입 후 평단가 대비 일괄 매수청산(8틱)
--- 매수청산 후 매수진입 조건이 만족하면 매수진입
매수진입후 평단가 대비 일관 손절(8틱)
---- 손절 후 위 시스템 정상 추진
매도진입후 평단가 대비 일괄 매도청산(8틱)
--- 매도청산 후 매도진입 조건이 만족하면 매도진입
매도진입후 평단가 대비 일관 손절(8틱)
---- 손절 후 시스템 정상 추진
아울러 input : 매수,매도 진입틱수, 매수, 매도 청약틱수 2가지 추가 부탁합니다
매번 감사합니다