Rename gr_hist command to grhist (#585)

* rename grhist command

* Update README.md
This commit is contained in:
DidierRLopes
2021-08-01 10:56:46 +01:00
committed by GitHub
parent a0acdfb13f
commit 8cd51d607e
3 changed files with 9 additions and 8 deletions

View File

@@ -26,7 +26,7 @@ This menu aims to give insight on options. Options can cause significant share p
* Plot volume and open interest
* [hist](#hist)
* Plot option history [Source: Tradier.com]
* [gr_hist](#gr_hist)
* [grhist](#grhist)
* Plot historical option greek [Source: ops.syncretism.io]
@@ -184,11 +184,11 @@ Note that the chain ID can be obtained by using `chains -d symbol`
![hist](https://user-images.githubusercontent.com/18151143/126855841-6884b19b-63c8-4746-a63f-82ad1a523c0c.png)
## gr_hist <a name="gr_hist"></a>
## grhist <a name="grhist"></a>
Plot historical option greeks. Data from ops.syncretism.io
```python
usage: gr_hist [-s STRIKE] [--put] [-g {iv,gamma,theta,vega,delta,rho,premium}] [--chain CHAIN_ID] [--raw] [--export {csv,json,xlsx}] [-h]
usage: grhist [-s STRIKE] [--put] [-g {iv,gamma,theta,vega,delta,rho,premium}] [--chain CHAIN_ID] [--raw] [--export {csv,json,xlsx}] [-h]
```
* -s/--strike: Strike to show history for
* -g/--greek: Greek to get data for. Can be {iv,gamma,theta,vega,delta,rho}. Also can be premium
@@ -198,6 +198,6 @@ usage: gr_hist [-s STRIKE] [--put] [-g {iv,gamma,theta,vega,delta,rho,premium}]
* --export: Export file. Can be {csv, json, xlsx}.
```python
(✨) (op)> gr_hist -s 145 --put -g delta
(✨) (op)> grhist -s 145 --put -g delta
```
![gr_hist](https://user-images.githubusercontent.com/18151143/126881002-c516d94b-5c87-43b1-9e16-dce304795e1c.png)

View File

@@ -47,7 +47,7 @@ class OptionsController:
"oi",
"hist",
"chains",
"gr_hist",
"grhist",
]
def __init__(self, ticker: str):
@@ -97,7 +97,7 @@ class OptionsController:
print(" vol plot volume [Tradier/YF]")
print(" voi plot volume and open interest [Tradier/YF]")
print(" hist plot option history [Tradier")
print(" gr_hist plot option greek history [Syncretism]")
print(" grhist plot option greek history [Syncretism]")
print("")
def switch(self, an_input: str):
@@ -243,7 +243,8 @@ class OptionsController:
options.calls, options.puts, self.ticker, self.selected_date, parsed
)
def call_gr_hist(self, other_args: List[str]):
def call_grhist(self, other_args: List[str]):
"""Process grhist command"""
syncretism_view.historical_greeks(self.ticker, self.selected_date, other_args)

View File

@@ -252,7 +252,7 @@ def historical_greeks(ticker: str, expiry: str, other_args: List[str]):
parser = argparse.ArgumentParser(
add_help=False,
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="gr_hist",
prog="grhist",
description="Plot historical option greeks.",
)