Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

begin adding order, option improvements #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions basic.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
2013-01-15 00:00:00,93.879000,93.949000,92.874000,93.078000
2013-01-16 00:00:00,93.079000,93.672000,92.458000,92.800000
2013-01-17 00:00:00,92.799000,95.011000,92.629000,94.616000
2013-01-18 00:00:00,94.617000,94.872000,94.157000,94.662000
2013-01-20 17:00:00,94.649000,94.820000,93.965000,94.155000
2013-01-21 00:00:00,94.159000,94.938000,93.726000,94.009000
2013-01-22 00:00:00,94.011000,94.284000,93.147000,93.231000
2013-01-23 00:00:00,93.229000,94.024000,92.793000,93.649000
2013-01-24 00:00:00,93.650000,94.715000,93.559000,94.489000
2013-01-25 00:00:00,94.490000,95.083000,94.472000,94.749000
2013-01-27 17:00:00,94.819000,95.007000,94.652000,94.834000
2013-01-28 00:00:00,94.835000,94.968000,94.082000,94.809000
2013-01-29 00:00:00,94.803000,95.330000,94.370000,95.248000
2013-01-30 00:00:00,95.245000,95.450000,94.255000,94.365000
2013-01-31 00:00:00,94.372000,95.799000,94.328000,95.714000
2013-02-01 00:00:00,95.715000,96.718000,95.457000,96.597000
2013-02-03 17:00:00,96.716000,96.777000,96.370000,96.572000
2013-02-04 00:00:00,96.574000,97.064000,95.968000,96.044000
2013-02-05 00:00:00,96.043000,97.426000,95.945000,97.131000
2013-02-06 00:00:00,97.133000,97.284000,96.092000,96.395000
2013-02-07 00:00:00,96.396000,97.023000,95.813000,96.145000
2013-02-08 00:00:00,96.146000,96.182000,95.124000,95.625000
2013-02-10 17:00:00,95.623000,95.744000,95.210000,95.339000
2013-02-11 00:00:00,95.336000,96.877000,95.168000,96.537000
2013-02-12 00:00:00,96.536000,96.719000,95.776000,96.214000
2013-02-13 00:00:00,96.216000,96.890000,96.114000,96.775000
2013-02-14 00:00:00,96.771000,96.964000,95.609000,95.621000
2013-02-15 00:00:00,95.622000,96.676000,95.521000,96.351000
10 changes: 10 additions & 0 deletions candlesticks.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1 1.5 2 2.4 4 6.
2 1.5 3 3.5 4 5.5
3 4.5 5 5.5 6 6.5
4 3.7 4.5 5.0 5.5 6.1
5 3.1 3.5 4.2 5 6.1
6 1 4 5.0 6 9
7 4 4 4.8 6 6.1
8 4 5 5.1 6 6.1
9 1.5 2 2.4 3 3.5
10 2.7 3 3.5 4 4.3
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "tastytrade-cli"
version = "0.4"
version = "0.5"
description = "An easy-to-use command line interface for Tastytrade!"
readme = "README.md"
requires-python = ">=3.10"
Expand All @@ -16,7 +16,7 @@ authors = [
dependencies = [
"asyncclick>=8.1.7.2",
"rich>=13.8.1",
"tastytrade>=9.3",
"tastytrade>=9.6",
]

[project.urls]
Expand All @@ -37,5 +37,10 @@ ignore = [
[project.scripts]
tt = "ttcli.app:main"

[project.optional-dependencies]
plot = [
"py-gnuplot>=1.2.1",
]

[tool.hatch.build.targets.wheel]
packages = ["ttcli"]
26 changes: 26 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os
from pygnuplot import gnuplot

g = gnuplot.Gnuplot()

# Set plotting style
g.set(
terminal="kittycairo transparent",
xdata="time",
timefmt='"%Y-%m-%d %H:%M:%S"',
xrange='["2013-01-15 00:00:00":"2013-02-15 23:59:59"]',
yrange="[*:*]",
datafile='separator ","',
palette="defined (-1 'red', 1 'green')",
cbrange="[-1:1]",
style="fill solid noborder",
boxwidth="60000 absolute",
title='"AUDJPY" textcolor rgbcolor "white"',
)
g.unset("colorbox")
os.system("clear")
g.plot(
"'basic.csv' using (strptime('%Y-%m-%d', strcol(1))):2:4:3:5:($5 < $2 ? -1 : 1) with candlesticks palette"
)
_ = input()
os.system("clear")
2 changes: 2 additions & 0 deletions ttcli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import asyncclick as click

from ttcli.option import option
from ttcli.order import order
from ttcli.portfolio import portfolio
from ttcli.trade import trade
from ttcli.utils import CONTEXT_SETTINGS, VERSION, config_path
Expand All @@ -18,6 +19,7 @@ async def app():

def main():
app.add_command(option)
app.add_command(order)
app.add_command(portfolio, name="pf")
app.add_command(trade)

Expand Down
2 changes: 2 additions & 0 deletions ttcli/data/ttcli.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ show-gamma = false
# this bypasses the date selection menu.
# default-dte = 45
[option.chain]
# the number of strikes to show
strike-count = 16
# these control whether the columns show up when running `tt option chain`
show-delta = true
show-volume = false
Expand Down
Loading
Loading