async def quote_hk(code: int): _ = Equity(code, False) return {_.yahoo_code: f'{_}'}
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.graph_objects as go from plotly.subplots import make_subplots # import pandas as pd # from datetime import datetime from fat import Equity # e1 = Equity('mrna', exchange='Nasdaq') e1 = Equity(6645, exchange='TSE') df = e1() # df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv') app = dash.Dash(__name__) app.layout = html.Div([ dcc.Checklist(id='toggle-rangeslider', options=[{ 'label': 'Include Rangeslider', 'value': 'slider' }], value=['slider']), dcc.Graph(id="graph"), ]) @app.callback(Output("graph", "figure"), [Input("toggle-rangeslider", "value")])
async def optinum_nyse(code: str): _ = Equity(code, exchange="NYSE") return _.optinum()
async def quote_nyse(code: str): _ = Equity(code, exchange="NYSE") return {_.yahoo_code: f'{_}'}
async def optinum_tse(code: str): __ = prefer_stock('TSE') if code.lower() in __.keys(): _ = Equity(__[code.lower()], exchange='TSE') return _.optinum()
async def quote_tse(code: str): __ = prefer_stock('TSE') if code.lower() in __.keys(): _ = Equity(__[code.lower()], exchange='TSE') return {_.yahoo_code: f'{_}'}
async def optinum_hk(code: int): _ = Equity(code, False) return _.optinum()