Fix export path for candle function (#964)

Co-authored-by: James Maslek <james@macbook-pro.myfiosgateway.com>
This commit is contained in:
jmaslek
2021-11-19 13:01:33 -05:00
committed by GitHub
parent 6978fbed3d
commit 203133b8b9
3 changed files with 19 additions and 10 deletions

0
exports/stocks/raw_data/.gitkeep vendored Normal file
View File

View File

@@ -707,7 +707,7 @@ def export_data(
func_name : str
Name of the command that invokes this function
df : pd.Dataframe
Datframe containing the data
Dataframe of data to save
"""
if export_type:
export_dir = dir_path.replace("gamestonk_terminal", "exports")

View File

@@ -1,4 +1,8 @@
"""Stock Context Controller"""
__docformat__ = "numpy"
import argparse
import os
from typing import List
from datetime import datetime, timedelta
@@ -12,8 +16,15 @@ from gamestonk_terminal.common import newsapi_view
from gamestonk_terminal.helper_funcs import (
b_is_stock_market_open,
check_positive,
export_data,
get_flair,
parse_known_args_and_warn,
valid_date,
MENU_GO_BACK,
MENU_QUIT,
MENU_RESET,
try_except,
system_clear,
)
from gamestonk_terminal.menu import session
from gamestonk_terminal.stocks.stocks_helper import (
@@ -24,14 +35,6 @@ from gamestonk_terminal.stocks.stocks_helper import (
process_candle,
)
from gamestonk_terminal.helper_funcs import (
valid_date,
MENU_GO_BACK,
MENU_QUIT,
MENU_RESET,
try_except,
system_clear,
)
from gamestonk_terminal.common.quantitative_analysis import qa_view
# pylint: disable=R1710,import-outside-toplevel
@@ -319,10 +322,16 @@ Market {('CLOSED', 'OPEN')[b_is_stock_market_open()]}
print("No ticker loaded. First use `load {ticker}`\n")
return
export_data(
ns_parser.export,
os.path.join(os.path.dirname(os.path.abspath(__file__)), "raw_data"),
f"{self.ticker}",
self.stock,
)
if ns_parser.raw:
qa_view.display_raw(
df=self.stock,
export=ns_parser.export,
sort=ns_parser.sort,
des=ns_parser.descending,
num=ns_parser.num,