커뮤니티
오늘의 마지막 질문입니다. ^^
2013-08-08 17:47:30
191
글번호 66257
제가 문의 드렸던 내용으로 아래의 수식을 만들어 주셨는데요.
1. 그럼 혹시 아래의 수식만 입력하고 실행하면 시스템트레이딩이 바로 되는건가요~?
2. 메뉴얼을 확인해보니 If조건문은 봉이 완성될때 라고 나와있는데
그럼 아래의 300원이 올랐을때 매도 하는게 신호는 300원이 올랐을때 나오고
주문은 봉이 완성될때 나가는건가요~?
3. 300원 상승한 가격에 도달했을때 매도가 나가고 추후에 300원 상승한 가격에
다시 도달해도 매매는 딱 한번만 이루어지는거죠~?
================================================================================
if MarketPosition <= 0 and stime < 150000 Then
Sell("s",atlimit,dayopen+300,10);
if MarketPosition >= 0 and stime < 150000 Then
buy("b",atlimit,dayopen-300,10);
if MarketPosition <= 0 and stime < 150000 Then
Sell("s",atlimit,dayopen+500,10);
if MarketPosition >= 0 and stime < 150000 Then
buy("b",atlimit,dayopen-500,10);
if MarketPosition == 1 Then{
if stime == 145900 Then
exitlong("bx1",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150000 Then
exitlong("bx2",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150100 Then
exitlong("bx3",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
exitlong("bx4",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
exitlong("bx5",AtMarket);
}
if MarketPosition == -1 Then{
if stime == 145900 Then
ExitShort("sx1",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150000 Then
ExitShort("sx2",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150100 Then
ExitShort("sx3",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
ExitShort("sx4",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
ExitShort("sx5",AtMarket);
}
답변 1
예스스탁 예스스탁 답변
2013-08-08 18:39:44
안녕하세요
예스스탁입니다.
1.
예 시스템 트레이딩 설정창에서
자동주문으로 선택하시고 계좌번호와 비밀번호 셋팅하시면
됩니다.
2.
해당 식은 9시~15시 사이의 봉이 완성이되면
다음봉의 시세가 지정한 가격 이상이나 이하를 기록하면해 즉시 주문나갑니다.
즉 if조건만족하면 다음봉에서 가격만족하면 즉시 나가게 됩니다
당일 첫봉에서는 신호가 발생하지 않으니
되도록 작은 주기의 차트에 적용하셔야 합니다.
3.
조건만 만족하면 계속 발생하게 됩니다.
하루에 한번씩만 신호를 발생하게 하고자 하시면 아래와 같이 수정하시면 됩니다.
식상에 2개의 가격대의 진입조건이 있습니다. 500은 제외했습니다.
시가 대비 500도 적용하고자 하시면
따라 시스템 만드셔서 아래식에서 300을 500으로만 변경하시면 됩니다.
var : cnt(0),scount(0),bcount(0);
scount = 0;
bcount = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) and IsEntryName("s",cnt) == true Then
scount = scount+1;
if sdate == EntryDate(cnt) and IsEntryName("b",cnt) == true Then
bcount = bcount+1;
}
if MarketPosition <= 0 and stime < 150000 and scount < 1 Then
Sell("s",atlimit,dayopen+300,10);
if MarketPosition >= 0 and stime < 150000 and scount < 1 Then
buy("b",atlimit,dayopen-300,10);
if MarketPosition == 1 Then{
if stime == 145900 Then
exitlong("bx1",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150000 Then
exitlong("bx2",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150100 Then
exitlong("bx3",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
exitlong("bx4",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
exitlong("bx5",AtMarket);
}
if MarketPosition == -1 Then{
if stime == 145900 Then
ExitShort("sx1",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150000 Then
ExitShort("sx2",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150100 Then
ExitShort("sx3",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
ExitShort("sx4",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
ExitShort("sx5",AtMarket);
}
즐거운 하루되세요
> jarlye 님이 쓴 글입니다.
> 제목 : 오늘의 마지막 질문입니다. ^^
> 제가 문의 드렸던 내용으로 아래의 수식을 만들어 주셨는데요.
1. 그럼 혹시 아래의 수식만 입력하고 실행하면 시스템트레이딩이 바로 되는건가요~?
2. 메뉴얼을 확인해보니 If조건문은 봉이 완성될때 라고 나와있는데
그럼 아래의 300원이 올랐을때 매도 하는게 신호는 300원이 올랐을때 나오고
주문은 봉이 완성될때 나가는건가요~?
3. 300원 상승한 가격에 도달했을때 매도가 나가고 추후에 300원 상승한 가격에
다시 도달해도 매매는 딱 한번만 이루어지는거죠~?
================================================================================
if MarketPosition <= 0 and stime < 150000 Then
Sell("s",atlimit,dayopen+300,10);
if MarketPosition >= 0 and stime < 150000 Then
buy("b",atlimit,dayopen-300,10);
if MarketPosition <= 0 and stime < 150000 Then
Sell("s",atlimit,dayopen+500,10);
if MarketPosition >= 0 and stime < 150000 Then
buy("b",atlimit,dayopen-500,10);
if MarketPosition == 1 Then{
if stime == 145900 Then
exitlong("bx1",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150000 Then
exitlong("bx2",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150100 Then
exitlong("bx3",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
exitlong("bx4",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
exitlong("bx5",AtMarket);
}
if MarketPosition == -1 Then{
if stime == 145900 Then
ExitShort("sx1",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150000 Then
ExitShort("sx2",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150100 Then
ExitShort("sx3",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
ExitShort("sx4",AtMarket,def,"",int(MaxContracts*0.2),1);
if stime == 150200 Then
ExitShort("sx5",AtMarket);
}
이전글