Skip to content

Instantly share code, notes, and snippets.

@shihyu
shihyu / sj_tony.py
Created October 5, 2020 16:09 — forked from Yvictor/sj_tony.py
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
@shihyu
shihyu / SJ_quote_sample.py
Created September 30, 2020 04:25 — forked from ypochien/SJ_quote_sample.py
成交+委買賣顯示
def quote_callback(topic, data):
"""
# L/TFE/TXFF9
{'Amount': [21088.0], 'AmountSum': [1028165646.0], 'AvgPrice': [10562.513699263414],
'Close': [10544.0], 'Code': 'TXFF9', 'Date': '2019/05/16', 'DiffPrice': [-37.0],
'DiffRate': [-0.34968339476419996], 'DiffType': [4], 'High': [10574.0],
'Low': [10488.0], 'Open': 10537.0, 'TargetKindPrice': 10548.47, 'TickType': [2],
'Time': '11:15:11.911000', 'TradeAskVolSum': 52599, 'TradeBidVolSum': 53721,
'VolSum': [97341], 'Volume': [2]}
@shihyu
shihyu / twstock.py
Created August 23, 2020 10:07 — forked from gary136/twstock.py
twstock.py
import pandas as pd
import requests
import numpy as np
from io import StringIO
import time
import matplotlib.pyplot as plt
import html5lib
from datetime import datetime, timedelta
import calendar
import datetime as dt
@shihyu
shihyu / KD_self_build.py
Created July 27, 2019 18:31 — forked from dear983604/KD_self_build.py
Self-build KD value
#導入套件
%matplotlib inline
import datetime
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#專門做『技術分析』的套件
from talib import abstract
@shihyu
shihyu / Talib_practice.py
Created July 27, 2019 16:09 — forked from dear983604/Talib_practice.py
TA-Lab套件教學
#導入套件
%matplotlib inline
import datetime
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#專門做『技術分析』的套件
from talib import abstract
@shihyu
shihyu / forexfactory_econcal.py
Created July 16, 2019 16:51 — forked from pohzipohzi/forexfactory_econcal.py
A scraper for forex factory economic calendar data
from bs4 import BeautifulSoup
import requests
import datetime
import logging
import csv
def setLogger():
logging.basicConfig(level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s',
filename='logs_file',
// +-\/-+
// (+) VCC 1| |14 GND (-)
// coil 1 A00 2| |13 A10 low_pin
// coil 2 A01 3| |12 A09 high_pin
// RESET 4| |11 A08
// coil 3 A02 5| |10 A07 button_input
// A03 6| |9 A06 led_cathode
// A04 7| |8 A05 led_anode
// +----+
int low_pin = 10;
@shihyu
shihyu / ctf_tools.sh
Created February 21, 2018 08:01 — forked from AkashiSN/ctf_tools.sh
CTF tool installation script.
#!/bin/bash
# Advance preparation
echo "source $HOME/.ctf_tool" >> $HOME/.zshrc
# Support 32-bit elf.
sudo apt install -y lib32z1
# Install other tools.
sudo apt install -y gdb binutils build-essential strace ltrace\
@shihyu
shihyu / gdb-trace.py
Created February 20, 2018 09:36 — forked from quark-zju/gdb-trace.py
Trace all function calls using gdb
#!/usr/bin/env python
try:
import gdb
inside_gdb = True
except ImportError:
inside_gdb = False
if inside_gdb:
@shihyu
shihyu / gdb-trace.py
Created February 20, 2018 09:36 — forked from Houdini/gdb-trace.py
Trace all function calls using gdb
#!/usr/bin/env python
try:
import gdb
inside_gdb = True
except ImportError:
inside_gdb = False
if inside_gdb: