sjtrade
Project description
sjtrade
shioaji day trade
Install
pip install sjtrade
Get started
Init Shioaji and SjTrader
import shioaji as sj
import sjtrade
api = sj.Shioaji()
accounts = api.login(**login_kws)
sjtrader = sjtrade.SJTrader(api)
Preview Position
sjtrade.io.file.read_position(sjtrader.position_filepath)
Set entry_pct stop_profit_pct stop_loss_pct
sjtrader.entry_pct = 0.05
sjtrader.stop_profit_pct = 0.095
sjtrader.stop_loss_pct = 0.09
Start sjtrader
sjtrader.start()
What do sjtrader start actually do
sjtrader.start??
Signature: sjtrader.start()
Source:
def start(self):
positions = read_position(self._position_filepath)
self.api.set_order_callback(self.order_deal_handler)
sleep_until(8, 45)
self.place_entry_order(positions, self.entry_pct)
sleep_until(8, 54, 59)
self.api.quote.set_on_tick_stk_v1_callback(self.cancel_preorder_handler)
sleep_until(8, 59, 55)
self.api.quote.set_on_tick_stk_v1_callback(self.intraday_handler)
sleep_until(13, 25, 59)
self.open_position_cover()
File: ~/.pyenv/versions/miniconda3-latest/lib/python3.7/site-packages/sjtrade/trader.py
Type: method
Developer's guide
flit install -s
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sjtrade-0.1.1.tar.gz
(12.1 kB
view hashes)