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',
#! /usr/bin/python
# -*- coding: utf-8 -*-
import requests
import sys
import os
import time
import sqlite3
from bs4 import BeautifulSoup
import pandas as pd
#! /usr/bin/python
# -*- coding: utf-8 -*-
import requests
import sys
import os
import time
import sqlite3
from bs4 import BeautifulSoup
import pandas as pd
#!/usr/bin/env python
#!encoding=utf-8
import matplotlib.pyplot as plt
import numpy as np
def f(t):
return np.exp(-t) * np.cos(2 * np.pi * t)
if __name__ == '__main__' :
t1 = np.arange(0, 5, 0.1)
#include <sys/types.h>
#include <unistd.h>
int fork_1()
{
int childpid;
int i;
if (fork() == 0) {
//child process