답변완료
문의 드립니다.
수고하십니다.
서로 다른 컴퓨터에서 발생한 신호를 동일하게 유지 하고 싶습니다.
1. 갑 이라는 컴퓨터 A계좌(account 1 or account2) 에서 발생한 신호 또는 잔고 확인후
2. 을 이라는 컴퓨터 B계좌(account 3) 에서 동일하게 잔고 또는 동일하게 매매하고 싶습니다.
답변을 찾아보니 이래저래 찾아보니 ..아래와 같이 구현하면 가능할런지요?
그럼 좋은 답변 부탁드리겠습니다.
============================================================================================
//각 주문을 매수/매도 5호가로 주문내게 수정했습니다.
//Account1 (시스템 거래)
//Account2 (손매매)
//Account3 (앞의 두계좌 연동),
//아래는 1분 단위로 Account1계좌를 원장과 동기화하는 내용입니다
function Main_OnStart()
{
Main.SetTimer(1, 100)
}
function Main_OnTimer(nEventID)
{
if(nEventID == 1)
{
//Main.MessageList("타이머 발생");
Main.RefreshAccount(Account1.number);
}
}
//체결이벤트 발생
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);
}
}
}
}
2015-07-27
1817
글번호 223586
답변완료
특정 이벤트가 발생하면 계좌잔고의 모든 종목을 청산하는 수식
제가 손으로 선물 옵션 합성포지션을 구축합니다.
그래서 예를 들자면 잔고에
선물 매수 1계약 ,
콜245 매수 1계약 , 콜247 매도 1계약 ,
풋245 매수 1계약 , 풋242 매도 1계약을 가지고 있습니다.
이경우 14시 40분이 되면 잔고의 모든 계약을 자동으로 청산하는
예스스팟 식을 알고 싶습니다.
부탁드립니다.
더운데 건강 조심하시고, 오늘도 좋은 하루 되세요. ^^
2015-07-26
1813
글번호 223583
답변완료
글자색 지정
YT , yes spot 프로그램을 만들어 주셔서 감사히 잘 쓰고 있습니다.
의문이 해결이 안되어 문의 드립니다.
1. Main.MessageLog("Put 가격 : ");
이 부분을 빨강 , 핑크 , 파랑 , 하늘색 으로 각각 표시하고 싶습니다. SetColorText(col, row, color) 를 사용해서 할 수 있나요? 예시 부탁 드립니다.
2, 글자크기나 두께도 설정 할 수 있나요?
요청 드립니다 ~~~~
2015-07-23
1678
글번호 223578