예스스탁
예스스탁 답변
2013-09-16 18:07:04
안녕하세요
예스스탁입니다.
게좌객체 3개 추가하시고 속성에서 각각 계좌번호 지정해 주시면 됩니다.
//Account1 12-31-0011(시스템 거래)
//Account2 12-31-0022(손매매)
//Account3 12-31-0033(앞의 두계좌 연동),
//체결이벤트 발생
function Main_OnNotifyFill(NotifyFill)
{
// account1이나 account2에서 체결이 발생하면
if (NotifyFill.accountNum == Account1.number ||
NotifyFill.accountNum == Account2.number)
{
//매도 체결일 경우
if (NotifyFill.orderKind == 1)
{
Account3.OrderSell(NotifyFill.code, NotifyFill.fillCount,0,1);
}
//매수 체결일 경우
if (NotifyFill.orderKind == 2)
{
Account3.OrderBuy(NotifyFill.code, NotifyFill.fillCount,0,1);
}
}
}
위와 같이 작성하시면 체결이 발생하면
해당 체결이 Account1이나 Account2 계좌이면
동일 주문을 Account3에서 발생하게 됩니다.
다른 매체에서 주문이 발생하면 체결수신이 안되므로
주의하셔야 합니다.
현재 32비트 버전이고 64비트는 지금 준비중에 있습니다.
즐거운 하루되세요
> 새로운세상 님이 쓴 글입니다.
> 제목 : 복수계좌 연동
> 안녕하세요~
다음 YesSpot 수식 부탁드리겠습니다.
12-31-0011(시스템 거래), 12-31-0022(손매매), 12-31-0033(앞의 두계좌 연동),
이렇게 총 3계좌를 운용한다고 가정했을 때
12-31-0033 계좌는 12-31-0011과 12-31-0022 계좌에서 포지션 변동이 있다면
즉시 주문이 실행되기를 원합니다.
포지션 변동은 선물,옵션 모두 해당이 되는데,
만약 옵션 변동분은 어렵다면 선물만이라도 좋습니다.
수식 및 설정부분에서 유의해야 할 사항 등이 있다면 내용 부탁드리겠습니다.
-----------------------
추가로 현재 YT 및 YesSpot은 32비트 컴퓨터에서만 가능한지요?
64비트에서는 안된다는 말을 들은 적이 있는데 맞는지 모르겠습니다.
그럼 즐거운 주말 되시고,
아울러 풍성한 추석 맞이하시기를 바라겠습니다.
감사합니다 !!!
예스스탁
예스스탁 답변
2013-09-17 10:28:27
안녕하세요
예스스탁입니다.
각 주문을 매수/매도 5호가로 주문내게 수정했습니다.
//Account1 12-31-0011(시스템 거래)
//Account2 12-31-0022(손매매)
//Account3 12-31-0033(앞의 두계좌 연동),
//체결이벤트 발생
function Main_OnNotifyFill(NotifyFill)
{
// Account1이나 Account2에서 체결이 발생하면
if (NotifyFill.accountNum == Account1.number || NotifyFill.accountNum == Account2.number)
{
//매도 체결일 경우
if (NotifyFill.orderKind == 1)
{
//선물인 경우
if (NotifyFill.code == Main.GetOrderCode(MarketData1.code))
{
//체결수량만큼 매수5호가로 매도주문
Account3.OrderSell(NotifyFill.code, NotifyFill.fillCount,MarketData1.Bid(5),0);
}
//선물이 아닐경우(선옵계좌이므로 이경우 옵션종목)
if (NotifyFill.code != Main.GetOrderCode(MarketData1.code))
{
//체겨수량만큼 매수5호가로 매도주문
Account3.OrderSell(NotifyFill.code, NotifyFill.fillCount,Option.GetBidByCode(NotifyFill.code,5),1);
}
}
//매수 체결일 경우
if (NotifyFill.orderKind == 1)
{
//선물인 경우
if (NotifyFill.code == Main.GetOrderCode(MarketData1.code))
{
//체결수량만큼 매도5호가로 매수주문
Account3.OrderBuy(NotifyFill.code, NotifyFill.fillCount,MarketData1.Ask(5),0);
}
//선물이 아닐경우(선옵계좌이므로 이경우 옵션종목)
if (NotifyFill.code != Main.GetOrderCode(MarketData1.code))
{
//체결수량만큼 매도5호가로 매수주문
Account3.OrderBuy(NotifyFill.code, NotifyFill.fillCount,Option.GetAskByCode(NotifyFill.code,5),1);
}
}
}
}
즐거운 하루되세요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 복수계좌 연동
> 안녕하세요
예스스탁입니다.
게좌객체 3개 추가하시고 속성에서 각각 계좌번호 지정해 주시면 됩니다.
//Account1 12-31-0011(시스템 거래)
//Account2 12-31-0022(손매매)
//Account3 12-31-0033(앞의 두계좌 연동),
//체결이벤트 발생
function Main_OnNotifyFill(NotifyFill)
{
// account1이나 account2에서 체결이 발생하면
if (NotifyFill.accountNum == Account1.number ||
NotifyFill.accountNum == Account2.number)
{
//매도 체결일 경우
if (NotifyFill.orderKind == 1)
{
Account3.OrderSell(NotifyFill.code, NotifyFill.fillCount,0,1);
}
//매수 체결일 경우
if (NotifyFill.orderKind == 2)
{
Account3.OrderBuy(NotifyFill.code, NotifyFill.fillCount,0,1);
}
}
}
위와 같이 작성하시면 체결이 발생하면
해당 체결이 Account1이나 Account2 계좌이면
동일 주문을 Account3에서 발생하게 됩니다.
다른 매체에서 주문이 발생하면 체결수신이 안되므로
주의하셔야 합니다.
현재 32비트 버전이고 64비트는 지금 준비중에 있습니다.
즐거운 하루되세요
> 새로운세상 님이 쓴 글입니다.
> 제목 : 복수계좌 연동
> 안녕하세요~
다음 YesSpot 수식 부탁드리겠습니다.
12-31-0011(시스템 거래), 12-31-0022(손매매), 12-31-0033(앞의 두계좌 연동),
이렇게 총 3계좌를 운용한다고 가정했을 때
12-31-0033 계좌는 12-31-0011과 12-31-0022 계좌에서 포지션 변동이 있다면
즉시 주문이 실행되기를 원합니다.
포지션 변동은 선물,옵션 모두 해당이 되는데,
만약 옵션 변동분은 어렵다면 선물만이라도 좋습니다.
수식 및 설정부분에서 유의해야 할 사항 등이 있다면 내용 부탁드리겠습니다.
-----------------------
추가로 현재 YT 및 YesSpot은 32비트 컴퓨터에서만 가능한지요?
64비트에서는 안된다는 말을 들은 적이 있는데 맞는지 모르겠습니다.
그럼 즐거운 주말 되시고,
아울러 풍성한 추석 맞이하시기를 바라겠습니다.
감사합니다 !!!