Skip to content

Instantly share code, notes, and snippets.

import copy
import logging
import sys
import notifiers
from notifiers.exceptions import NotifierException
from concurrent.futures import ThreadPoolExecutor
class NotificationHandler(logging.Handler):
@Yvictor
Yvictor / shioaji.cpp
Created July 23, 2020 08:05
ShioajiCpp4Tutorial
#include <unistd.h>
#include "solClient.h"
#include "shioaji.h"
void expose_api_func(){
solClient_initialize(SOLCLIENT_LOG_DEFAULT_FILTER, NULL);
std::cout << "user our library expose function.\n"
"inside this library use solclient library.\n";
}
@Yvictor
Yvictor / Makefile
Last active July 23, 2020 07:36
ShioajiCpp4Tutorial
CPPFLAGS=-std=c++11 -Wall
CPPFLAGS_SHARED=$(CPPFLAGS) -shared -fPIC
SOLCLIENT_FOLDER=$(shell pwd)/solclient-7.14.0.8/
CPPFLAGS_SOL=-I $(SOLCLIENT_FOLDER)include/solclient -L $(SOLCLIENT_FOLDER)lib -lsolclient -lstdc++ -lpthread
CPPFLAGS_SOL_STATIC_LINK=-I $(SOLCLIENT_FOLDER)include/solclient $(SOLCLIENT_FOLDER)lib/libsolclient.a -lstdc++ -lpthread -lrt
all: shioaji simple
prepare-solace-lib:
curl -L https://products.solace.com/download/C_API_LINUX64 -o solclient.tar.gz
@Yvictor
Yvictor / main.cpp
Created July 23, 2020 05:15
ShioajiCpp4Tutorial
#include "shioaji.h"
int main(){
expose_api_func();
}
@Yvictor
Yvictor / shioaji.cpp
Created July 23, 2020 05:15
ShioajiCpp4Tutorial
#include "shioaji.h"
void expose_api_func(){
std::cout << "user our library expose function\n";
}
@Yvictor
Yvictor / shioaji.h
Created July 23, 2020 05:03
ShioajiCpp4Tutorial
#include <iostream>
void expose_api_func();
@Yvictor
Yvictor / Makefile
Created July 23, 2020 03:22
ShioajiCpp4Tutorial Makefile
simple:
g++ main.cpp -o simple
clean:
- rm simple
@Yvictor
Yvictor / main.cpp
Created July 23, 2020 03:12
simple main example
#include <iostream>
int main(){
std::cout << "simple executable program.\n";
}
import pandas as pd
import msgpack
import zlib
with open(f'/data/dataset/qc/msgpack/TXF20190703.msgpack', 'rb') as f:
rawdata = msgpack.loads(zlib.decompress(f.read()), raw=False)
df_bidask = pd.DataFrame(rawdata['Q/TFE/TXFI9'])
df_bidask[df_bidask['Simtrade'] != 1][['Date', 'Time', 'AskPrice', 'AskVolume', 'BidPrice', 'BidVolume']]
@Yvictor
Yvictor / sj_tony.py
Created July 15, 2019 01:59
shioaji quote tony version code review
import shioaji as sj
import pandas as pd
import sys
import os
import datetime
from datetime import datetime as datetime2
from threading import Timer
'''user_information & barminute'''
min_k=1