From 8cd51d607e6a560d7ca06ba49b081d708b8fc48d Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Sun, 1 Aug 2021 10:56:46 +0100 Subject: [PATCH] Rename gr_hist command to grhist (#585) * rename grhist command * Update README.md --- gamestonk_terminal/options/README.md | 8 ++++---- gamestonk_terminal/options/op_controller.py | 7 ++++--- gamestonk_terminal/options/syncretism_view.py | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gamestonk_terminal/options/README.md b/gamestonk_terminal/options/README.md index 0e66e05003b..62e4da33ecc 100644 --- a/gamestonk_terminal/options/README.md +++ b/gamestonk_terminal/options/README.md @@ -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 +## grhist 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) diff --git a/gamestonk_terminal/options/op_controller.py b/gamestonk_terminal/options/op_controller.py index f2fd9589560..ffa55a2a96e 100644 --- a/gamestonk_terminal/options/op_controller.py +++ b/gamestonk_terminal/options/op_controller.py @@ -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) diff --git a/gamestonk_terminal/options/syncretism_view.py b/gamestonk_terminal/options/syncretism_view.py index 9a515e63653..2f4d38e7554 100644 --- a/gamestonk_terminal/options/syncretism_view.py +++ b/gamestonk_terminal/options/syncretism_view.py @@ -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.", )