커뮤니티
재문의
2016-07-26 09:55:59
152
글번호 100378
48816 재문의 드렸습니다
답변 2
예스스탁 예스스탁 답변
2016-07-26 15:46:29
> 쿠루드 님이 쓴 글입니다.
> 제목 : 재문의
> 48816 재문의 드렸습니다
예스스탁 예스스탁 답변
2016-07-26 18:28:06
안녕하세요
예스스탁입니다.
input : L1(15),P1(15),L2(20),P2(20),N(5);
Var : cross(0),vol(0),T(0),EE(0),cnt(0);
var1 = ma(c,5);
var2 = ma(c,20);
#상향돌파
if crossup(var1,var2) Then{
cross = cross+ 1;
#차트 첫 3번째
if cross == 3 Then
buy("b",OnClose,def,1);
#매도진입후 매수로 스위칭 될때는 1계약 추가, 최대 N개약까지
if MarketPosition == -1 and cross >= 4 and MaxContracts < N Then
buy("sb",OnClose,def,CurrentContracts+1);
#청산후 2번쉬고 3번째 진입
if MarketPosition == 0 and MarketPosition(1) == -1 and countif(crossup(var1,var2),BarsSinceExit(1)) == 2 and cross >= 4 Then
buy("b1",OnClose,def,1);
}
#하향이탈
if CrossDown(var1,var2) Then{
cross = cross +1;
#차트 첫 3번째
if cross == 3 Then
sell("s",OnClose,def,1);
#매수진입후 매도로 스위칭 될때는 1계약 추가, 최대 N개약까지
if MarketPosition == 1 and cross >= 4 and MaxContracts < N Then
sell("bs",OnClose,def,CurrentContracts+1);
#청산후 2번쉬고 3번째 진입
if MarketPosition == 0 and MarketPosition(1) == 1 and countif(CrossDown(var1,var2),BarsSinceExit(1)) == 2 and cross >= 4 Then
sell("s1",OnClose,def,1);
}
if MarketPosition == 1 Then{
if stime >= 80000 and stime < 153000 Then{
exitlong("BL1",AtStop,EntryPrice-PriceScale*L1);
exitlong("BP1",AtLimit,EntryPrice+PriceScale*P1);
}
Else{
exitlong("BL2",AtStop,EntryPrice-PriceScale*L2);
exitlong("BP2",AtLimit,EntryPrice+PriceScale*P2);
}
}
if MarketPosition == -1 Then{
if stime >= 80000 and stime < 153000 Then{
ExitShort("SL1",AtStop,EntryPrice+PriceScale*L1);
ExitShort("SP1",AtLimit,EntryPrice-PriceScale*P1);
}
Else{
ExitShort("SL2",AtStop,EntryPrice+PriceScale*L2);
ExitShort("SP2",AtLimit,EntryPrice-PriceScale*P2);
}
}
즐거운 하루되세요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 전화주시기 바랍니다.(02-3453-1060)
>
> 쿠루드 님이 쓴 글입니다.
> 제목 : 재문의
> 48816 재문의 드렸습니다