Skip to content

Instantly share code, notes, and snippets.

@ridingtide
ridingtide / app_0001.js
Created September 10, 2015 02:07
Hapi.js로 REST API 구축하기 #1
var Hapi = require('hapi');
var server = new Hapi.Server();
// Create a server with a host and port
server.connection({
host: 'localhost',
port: 8080
});
@ridingtide
ridingtide / system_trading_0004_01.py
Created September 9, 2015 12:33
시간대별 체결 데이터 가져오기
inXAQuery = win32com.client.DispatchWithEvents("XA_DataSet.XAQuery", XAQueryEvents)
inXAQuery.LoadFromResFile("res\\t1301.res") # res 등록
inXAQuery.SetFieldData('t1301InBlock', 'shcode', 0, '001510')
inXAQuery.Request(0)
while XAQueryEvents.queryState == 0:
pythoncom.PumpWaitingMessages()
# Get FieldData
@ridingtide
ridingtide / system_trading_0004.py
Created September 9, 2015 12:25
python으로 시스템 트레이딩하기 - 시간대별 체결 데이터 가져오기
#-*-coding: utf-8 -*-
import win32com.client
import pythoncom
import sys
import time
class XASessionEvents:
logInState = 0
@ridingtide
ridingtide / system_trading_0003_01.py
Created September 9, 2015 12:18
다수 종목 조회 로직
# -- Get data --
inXAQuery = win32com.client.DispatchWithEvents("XA_DataSet.XAQuery", XAQueryEvents)
inXAQuery.LoadFromResFile("res\\t8430.res") # res 등록 (주식 종목 조회)
inXAQuery.SetFieldData("t8430InBlock", "gubun", 0, 0) # 코스피
inXAQuery.Request(0)
while XAQueryEvents.queryState == 0:
pythoncom.PumpWaitingMessages()
@ridingtide
ridingtide / system_trading_0003.py
Last active September 9, 2015 12:17
python으로 시스템 트레이딩하기 - 다수 종목 조회
#-*-coding: utf-8 -*-
import win32com.client
import pythoncom
import sys
import time
class XASessionEvents:
logInState = 0
@ridingtide
ridingtide / system_trading_0002.py
Last active September 9, 2015 11:58
python으로 시스템 트레이딩하기 - 주식, 선물 현재가 조회
#-*-coding: utf-8 -*-
import win32com.client
import pythoncom
import sys
class XASessionEvents:
logInState = 0
@ridingtide
ridingtide / system_trading_0001.py
Last active September 19, 2017 06:26
python으로 시스템 트레이딩하기 - 로그인 / 계좌 조회
#-*-coding: utf-8 -*-
import win32com.client
import pythoncom
import sys
class XASessionEvents:
logInState = 0