Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ airflow_home
env
node_modules/*
Honey.txt
node_modules
4 changes: 2 additions & 2 deletions chess_piece/app_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ def return_runningbee_gif__save(title="Saved", width=33, gif=runaway_bee_gif):
local_gif(gif_path=gif)
st.success(title)

def cust_graph(username, api, x_axis, y_axis, theme_options, refresh_button=False, refresh_sec=8, return_type=None, prod=False, symbols=["SPY"], graph_height=300, key='graph'):
def cust_graph(username, api, x_axis, y_axis, theme_options, refresh_button=False, refresh_sec=8, return_type=None, prod=False, symbols=["SPY"], graph_height=300, key='graph', toggles=['a', 'b', 'c']):
st_custom_graph(
api=api,
x_axis={
'field': x_axis
},

toggles=toggles,
y_axis=y_axis,
theme_options=theme_options,
refresh_button=refresh_button,
Expand Down
145 changes: 75 additions & 70 deletions chess_piece/fastapi_queen.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,84 +639,86 @@ def update_queenking_chessboard(username, prod, selected_row):
return grid_row_button_resp(description=status)

def get_queen_orders_json(client_user, username, prod, toggle_view_selection):

try:
if toggle_view_selection.lower() == 'queen':
ORDERS = init_queenbee(client_user, prod, queen=True).get('QUEEN')
else:
ORDERS = init_queenbee(client_user, prod, orders=True).get('ORDERS')
def update_order_rules(d):
try:
d['sell_date'] = d['sell_date'].strftime('%m/%d/%Y %H:%M')
return d
except Exception as e:
return d

try:
if toggle_view_selection.lower() == 'queen':
ORDERS = init_queenbee(client_user, prod, queen=True).get('QUEEN')
else:
ORDERS = init_queenbee(client_user, prod, orders=True).get('ORDERS')

if type(ORDERS) != dict:
print("NO ORDERS")
return pd.DataFrame().to_json()
if type(ORDERS) != dict:
print("NO ORDERS")
return pd.DataFrame().to_json()

df = ORDERS['queen_orders']
df = ORDERS['queen_orders']

if type(df) != pd.core.frame.DataFrame:
return pd.DataFrame().to_json()
if type(df) != pd.core.frame.DataFrame:
return pd.DataFrame().to_json()

if len(df) == 1:
print("init queen")
return pd.DataFrame().to_json()
if len(df) == 1:
print("init queen")
return pd.DataFrame().to_json()

# Colors
k_colors = streamlit_config_colors()
default_text_color = k_colors['default_text_color'] # = '#59490A'
default_font = k_colors['default_font'] # = "sans serif"
default_yellow_color = k_colors['default_yellow_color'] # = '#C5B743'
# Colors
k_colors = streamlit_config_colors()
default_text_color = k_colors['default_text_color']
default_font = k_colors['default_font']
default_yellow_color = k_colors['default_yellow_color']

sell_options = sell_button_dict_items()
df['sell_option'] = [sell_options for _ in range(df.shape[0])]
sell_options = sell_button_dict_items()
df['sell_option'] = [sell_options for _ in range(df.shape[0])]

df = df[df['client_order_id']!='init']
df = df.fillna('000')
df = df[df['ticker_time_frame']!='000'] ## who are you?? WORKERBEE
# print(df_)
df['ttf_symbol'] = df['ticker_time_frame'].apply(lambda x: return_symbol_from_ttf(x))

df["money"] = pd.to_numeric(df["money"], errors='coerce')
df["honey"] = pd.to_numeric(df["honey"], errors='coerce')
df["honey"] = round(df["honey"] * 100,2)
df["money"] = round(df["money"],0)
# df['color_row'] = np.where(df['honey'] > 0, default_yellow_color, "#ACE5FB")
df['color_row_text'] = np.where(df['honey'] > 0, default_text_color, default_text_color)
df['color_row'] = df['honey'].apply(lambda x: generate_shade(x, wave=False))
df['sell_reason'] = df['sell_reason'].astype(str)
df['time_frame'] = df['ticker_time_frame'].apply(lambda x: ttf_grid_names(x, symbol=True))

df = filter_gridby_timeFrame_view(df, toggle_view_selection)

if toggle_view_selection == 'today':
df = split_today_vs_prior(df, timestamp='datetime').get('df_today')
# else:
# qos_view=['running', 'running_close', 'running_open']
# df = df[df['queen_order_state'].isin(qos_view)]

for ttf in df.index:
symbol = df.at[ttf, 'symbol']
sell_qty = df.at[ttf, 'qty_available']
sell_option = sell_button_dict_items(symbol, sell_qty)
df.at[ttf, 'sell_option'] = sell_option
df = df[df['client_order_id'] != 'init']
df = df.fillna('000')
df = df[df['ticker_time_frame'] != '000']
df['ttf_symbol'] = df['ticker_time_frame'].apply(return_symbol_from_ttf)

# sort
sort_colname = 'cost_basis_current'
df = df.sort_values(sort_colname, ascending=False)

# # Totals Index
df.loc['Total', 'money'] = df['money'].sum()
df.loc['Total', 'honey'] = df['honey'].sum()
# df.loc['Total', 'datetime'] = ''
df.loc['Total', 'cost_basis'] = df['cost_basis'].sum()
df.loc['Total', 'cost_basis_current'] = df['cost_basis_current'].sum()
newIndex=['Total']+[ind for ind in df.index if ind!='Total']
df=df.reindex(index=newIndex)
df["money"] = pd.to_numeric(df["money"], errors='coerce')
df["honey"] = pd.to_numeric(df["honey"], errors='coerce')
df["honey"] = round(df["honey"] * 100, 2)
df["money"] = round(df["money"], 0)
df['color_row_text'] = default_text_color
df['color_row'] = df['honey'].apply(lambda x: generate_shade(x, wave=False))
df['sell_reason'] = df['sell_reason'].astype(str)
df['time_frame'] = df['ticker_time_frame'].apply(lambda x: ttf_grid_names(x, symbol=True))

json_data = df.to_json(orient='records')
return json_data
except Exception as e:
print('hey now')
print_line_of_error()
df = filter_gridby_timeFrame_view(df, toggle_view_selection)

if toggle_view_selection == 'today':
df = split_today_vs_prior(df, timestamp='datetime').get('df_today')

for ttf in df.index:
symbol = df.at[ttf, 'symbol']
sell_qty = df.at[ttf, 'qty_available']
sell_option = sell_button_dict_items(symbol, sell_qty)
df.at[ttf, 'sell_option'] = sell_option

# Apply update_order_rules to order_rules column
df['order_rules'] = df['order_rules'].apply(lambda cell: update_order_rules(cell) if isinstance(cell, dict) else cell)

# Sort
sort_colname = 'cost_basis_current'
df = df.sort_values(sort_colname, ascending=False)

# Totals Index
df.loc['Total', 'money'] = df['money'].sum()
df.loc['Total', 'honey'] = df['honey'].sum()
df.loc['Total', 'cost_basis'] = df['cost_basis'].sum()
df.loc['Total', 'cost_basis_current'] = df['cost_basis_current'].sum()
newIndex = ['Total'] + [ind for ind in df.index if ind != 'Total']
df = df.reindex(index=newIndex)

json_data = df.to_json(orient='records')
return json_data
except Exception as e:
print('hey now')
print_line_of_error()


def queen_wavestories__get_macdwave(client_user, prod, symbols, toggle_view_selection, return_type='waves', revrec=None):
Expand Down Expand Up @@ -978,8 +980,11 @@ def return_waveview_fillers(waveview):
df = pd.concat([df_total, df])
df.at['Total', 'symbol'] = 'Total'
for star in star_names().keys():
df[f'{star}_value'] = df[f'{star}_value'].fillna(0)
df.at['Total', f'{star}_state'] = '${:,.0f}'.format(round(sum(df[f'{star}_value'])))
try:
df[f'{star}_value'] = df[f'{star}_value'].fillna(0)
df.at['Total', f'{star}_state'] = '${:,.0f}'.format(round(sum(df[f'{star}_value'])))
except Exception as e:
print(e)


json_data = df.to_json(orient='records')
Expand Down
2 changes: 2 additions & 0 deletions chess_piece/king.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ def kingdom__grace_to_find_a_Queen(prod=True):
users_allowed_queen_email.append("stefanstapinski@yahoo.com")
users_allowed_queen_email.append("sven0227@gmail.com")
users_allowed_queen_email.append("nitinrohan17@gmail.com")
users_allowed_queen_email.append("m.kobzar19@gmail.com")
users_allowed_queen_email.append("nimbus2219@gmail.com")

users_allowed_queen_emailname__db = {clientusername: return_db_root(client_username=clientusername) for clientusername in users_allowed_queen_email}
KING['users_allowed_queen_emailname__db'] = users_allowed_queen_emailname__db
Expand Down
17 changes: 9 additions & 8 deletions custom_graph_v1/frontend/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"files": {
"main.js": "./static/js/main.09c0b9bc.chunk.js",
"main.js.map": "./static/js/main.09c0b9bc.chunk.js.map",
"main.js": "./static/js/main.6a0d078a.chunk.js",
"main.js.map": "./static/js/main.6a0d078a.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.c62f2575.js",
"runtime-main.js.map": "./static/js/runtime-main.c62f2575.js.map",
"static/css/2.00129a64.chunk.css": "./static/css/2.00129a64.chunk.css",
"static/js/2.83943ae3.chunk.js": "./static/js/2.83943ae3.chunk.js",
"static/js/2.83943ae3.chunk.js.map": "./static/js/2.83943ae3.chunk.js.map",
"static/js/2.b8a17ab8.chunk.js": "./static/js/2.b8a17ab8.chunk.js",
"static/js/2.b8a17ab8.chunk.js.map": "./static/js/2.b8a17ab8.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.60777872b27e059be0944c45b943c20e.js": "./precache-manifest.60777872b27e059be0944c45b943c20e.js",
"precache-manifest.a6f63cd72f009410b683a163389710e1.js": "./precache-manifest.a6f63cd72f009410b683a163389710e1.js",
"service-worker.js": "./service-worker.js",
"static/css/2.00129a64.chunk.css.map": "./static/css/2.00129a64.chunk.css.map",
"static/js/2.83943ae3.chunk.js.LICENSE.txt": "./static/js/2.83943ae3.chunk.js.LICENSE.txt"
"static/js/2.b8a17ab8.chunk.js.LICENSE.txt": "./static/js/2.b8a17ab8.chunk.js.LICENSE.txt",
"static/js/main.6a0d078a.chunk.js.LICENSE.txt": "./static/js/main.6a0d078a.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.c62f2575.js",
"static/css/2.00129a64.chunk.css",
"static/js/2.83943ae3.chunk.js",
"static/js/main.09c0b9bc.chunk.js"
"static/js/2.b8a17ab8.chunk.js",
"static/js/main.6a0d078a.chunk.js"
]
}
2 changes: 1 addition & 1 deletion custom_graph_v1/frontend/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><title>Streamlit Component</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Streamlit Component"/><meta name="clipboard-write" content="allow"><link rel="stylesheet" href="bootstrap.min.css"/><link href="./static/css/2.00129a64.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,l,a=t[0],i=t[1],p=t[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(f&&f(t);s.length;)s.shift()();return u.push.apply(u,p||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,a=1;a<r.length;a++){var i=r[a];0!==o[i]&&(n=!1)}n&&(u.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},o={1:0},u=[];function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="./";var a=this.webpackJsonpstreamlit_custom_graph=this.webpackJsonpstreamlit_custom_graph||[],i=a.push.bind(a);a.push=t,a=a.slice();for(var p=0;p<a.length;p++)t(a[p]);var f=i;r()}([])</script><script src="./static/js/2.83943ae3.chunk.js"></script><script src="./static/js/main.09c0b9bc.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><title>Streamlit Component</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Streamlit Component"/><meta name="clipboard-write" content="allow"><link rel="stylesheet" href="bootstrap.min.css"/><link href="./static/css/2.00129a64.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,l,a=t[0],i=t[1],p=t[2],c=0,s=[];c<a.length;c++)l=a[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(f&&f(t);s.length;)s.shift()();return u.push.apply(u,p||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,a=1;a<r.length;a++){var i=r[a];0!==o[i]&&(n=!1)}n&&(u.splice(t--,1),e=l(l.s=r[0]))}return e}var n={},o={1:0},u=[];function l(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,l),r.l=!0,r.exports}l.m=e,l.c=n,l.d=function(e,t,r){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(l.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)l.d(r,n,function(t){return e[t]}.bind(null,n));return r},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="./";var a=this.webpackJsonpstreamlit_custom_graph=this.webpackJsonpstreamlit_custom_graph||[],i=a.push.bind(a);a.push=t,a=a.slice();for(var p=0;p<a.length;p++)t(a[p]);var f=i;r()}([])</script><script src="./static/js/2.b8a17ab8.chunk.js"></script><script src="./static/js/main.6a0d078a.chunk.js"></script></body></html>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "e19d22b65777a9231d81518166d6cb19",
"url": "./index.html"
},
{
"revision": "5a9d39d2da1799945ff8",
"url": "./static/css/2.00129a64.chunk.css"
},
{
"revision": "5a9d39d2da1799945ff8",
"url": "./static/js/2.b8a17ab8.chunk.js"
},
{
"revision": "3bf6e040acd9083f3c50aceae8695be3",
"url": "./static/js/2.b8a17ab8.chunk.js.LICENSE.txt"
},
{
"revision": "25ab43908e1a86104183",
"url": "./static/js/main.6a0d078a.chunk.js"
},
{
"revision": "4e0e34f265fae8f33b01b27ae29d9d6f",
"url": "./static/js/main.6a0d078a.chunk.js.LICENSE.txt"
},
{
"revision": "79f28757b163e4b3af61",
"url": "./static/js/runtime-main.c62f2575.js"
}
]);
4 changes: 2 additions & 2 deletions custom_graph_v1/frontend/build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"./precache-manifest.60777872b27e059be0944c45b943c20e.js"
"./precache-manifest.a6f63cd72f009410b683a163389710e1.js"
);

self.addEventListener('message', (event) => {
Expand All @@ -35,5 +35,5 @@ workbox.precaching.precacheAndRoute(self.__precacheManifest, {});

workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("./index.html"), {

blacklist: [/^\/_/,/\/[^\/?]+\.[^\/]+$/],
blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/],
});
3 changes: 0 additions & 3 deletions custom_graph_v1/frontend/build/static/js/2.83943ae3.chunk.js

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions custom_graph_v1/frontend/build/static/js/2.b8a17ab8.chunk.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ object-assign
*/

/*!
* jQuery JavaScript Library v3.7.1
* jQuery JavaScript Library v3.7.0
* https://jquery.com/
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2023-08-28T13:37Z
* Date: 2023-05-11T18:29Z
*/

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

/**
* @license
* Copyright 2018-2021 Streamlit Inc.
Expand Down

Large diffs are not rendered by default.

Loading