Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit80cfe05

Browse files
authored
Development (michaelchu#4)
* add setup.py and update readme* updated installation instructions and sample strategy (michaelchu#3)
1 parent134b0d7 commit80cfe05

File tree

3 files changed

+44
-13
lines changed

3 files changed

+44
-13
lines changed

‎README.md‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@ the rapid development of complex options trading strategies.
6060
* Stock Price Distribution Generator - Analyze historical stock price movements patterns to discover potential trade ideas.
6161
* Trade Scanner - Used to recommend trades based on stock price distributions
6262

63+
###Dependencies
64+
You will need Python 3.6.x. It is recommended to install[Miniconda3](https://conda.io/miniconda.html). See[requirements.txt](https://github.com/michaelchu/optopsy/blob/master/requirements.txt) for full details.
65+
66+
###Installation
67+
```
68+
pip install optopsy
69+
```
70+
6371
###Usage
72+
```
73+
python strategies/sample_strategy.py
74+
```
75+
The sample strategy can be used with[Level 3 Historical CSV Data Sample](https://www.historicaloptiondata.com/content/sample-files-0?gclid=CjwKCAjwtIXbBRBhEiwAWV-5ngKHMIxUw_rCK1DnkQpS4BUs_XQmLG09hm4SWpE9FoMJc3hb6qMPqhoCGgIQAvD_BwE) from historicaloptiondata.com.
76+
77+
In order to use it, you will need to define the struct variable to map the column names to the numerical index as per the file format.
6478

65-
Coming Soon.

‎setup.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
fromsetuptoolsimportsetup
2+
3+
setup(name='optopsy',
4+
description='Python Backtesting library for options trading strategies',
5+
long_description=open("README.md").read(),
6+
version='0.1.0',
7+
url='https://github.com/michaelchu/optopsy',
8+
author='Michael Chu',
9+
author_email='mchchu88@gmail.com',
10+
license='MIT',
11+
classifiers=[
12+
"Operating System :: OS Independent",
13+
'License :: OSI Approved :: MIT License',
14+
'Programming Language :: Python :: 3'
15+
],
16+
packages=['optopsy']
17+
)
18+

‎strategies/sample_strategy.py‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@
99
vxx_struct= (
1010
('symbol',0),
1111
('underlying_price',1),
12-
('option_symbol',2),
13-
('option_type',3),
14-
('expiration',4),
15-
('quote_date',5),
16-
('strike',6),
17-
('bid',8),
18-
('ask',9),
19-
('delta',13),
20-
('gamma',14),
21-
('theta',15),
22-
('vega',16)
12+
('option_symbol',3),
13+
('option_type',4),
14+
('expiration',5),
15+
('quote_date',6),
16+
('strike',7),
17+
('bid',9),
18+
('ask',10),
19+
('delta',17),
20+
('gamma',18),
21+
('theta',19),
22+
('vega',20)
2323
)
2424

2525

2626
defrun_strat():
2727
# fetch the option chains from our data source
28-
d=op.get('../data/VXX.csv',
28+
d=op.get('data/VXX.csv',
2929
start=date(2016,12,1),
3030
end=date(2016,12,31),
3131
struct=vxx_struct,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp