Skip to content

Instantly share code, notes, and snippets.

@Yvictor
Yvictor / shioaji_quote_simple.py
Created April 8, 2019 12:24
the most simple shioaji quote api usage example
import shioaji as sj
api = sj.Shioaji(simulation=False)
person_id, passwd = 'your person id', 'your password'
api.login(person_id, passwd)
@sj.on_quote
def on_quote(topic, quote_dict):
print(topic, quote_dict)
@Yvictor
Yvictor / execAt.js
Created November 18, 2018 05:42
exec js script at specific time
execTime = new Date(2018, 10, 18, 15, 0, 0)
btn = document.querySelector(".winlink.detailSwitch")
setTimeout(() => {
btn.click()
console.log(new Date().getMilliseconds(), Date())
}, execTime.getTime() - new Date().getTime())
@Yvictor
Yvictor / IB_python_api_install.md
Last active December 4, 2018 04:30
IB python api install
  • wget http://interactivebrokers.github.io/downloads/twsapi_macunix.973.02.zip
  • unzip twsapi_macunix.973.02.zip
  • cd IBJts/source/pythonclient
  • python setup.py install
  • cd ../../samples/Python/Testbed/
  • python Program.py -p 4002
@Yvictor
Yvictor / keras_model_example.py
Created June 12, 2017 16:04
keras model example
from keras.layers import Convolution2D, MaxPooling2D, Dense, Dropout, Activation, Flatten, Input
from keras.models import Model
from keras.optimizers import RMSprop
batchsize = 64
conv_num_filters_1 = 16
conv_num_filters_2 = 32
conv_num_filters_3 = 32