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
8 changes: 8 additions & 0 deletions .vscode/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"target": "esnext",
"lib": [
"esnext"
]
}
}
54 changes: 54 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"configurations": [
{
"type": "pwa-msedge",
"name": "Launch Microsoft Edge",
"request": "launch",
"runtimeArgs": [
"--remote-debugging-port=9222"
],
"url": "c:\\Users\\Aek ProTrader\\.vscode\\extensions\\ms-edgedevtools.vscode-edge-devtools-2.0.0\\out\\startpage\\index.html", // Provide your project's url to finish configuring
"presentation": {
"hidden": true
}
},
{
"type": "pwa-msedge",
"name": "Launch Microsoft Edge in headless mode",
"request": "launch",
"runtimeArgs": [
"--headless",
"--remote-debugging-port=9222"
],
"url": "c:\\Users\\Aek ProTrader\\.vscode\\extensions\\ms-edgedevtools.vscode-edge-devtools-2.0.0\\out\\startpage\\index.html", // Provide your project's url to finish configuring
"presentation": {
"hidden": true
}
},
{
"type": "vscode-edge-devtools.debug",
"name": "Open Edge DevTools",
"request": "attach",
"url": "c:\\Users\\Aek ProTrader\\.vscode\\extensions\\ms-edgedevtools.vscode-edge-devtools-2.0.0\\out\\startpage\\index.html", // Provide your project's url to finish configuring
"presentation": {
"hidden": true
}
}
],
"compounds": [
{
"name": "Launch Edge Headless and attach DevTools",
"configurations": [
"Launch Microsoft Edge in headless mode",
"Open Edge DevTools"
]
},
{
"name": "Launch Edge and attach DevTools",
"configurations": [
"Launch Microsoft Edge",
"Open Edge DevTools"
]
}
]
}
12 changes: 12 additions & 0 deletions .vscode/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/// <reference path="c:/Users/Aek ProTrader/.vscode/extensions/nur.script-0.2.1/@types/api.global.d.ts" />
/// <reference path="c:/Users/Aek ProTrader/.vscode/extensions/nur.script-0.2.1/@types/vscode.global.d.ts" />
// @ts-check
// API: https://code.visualstudio.com/api/references/vscode-api

function activate(_context) {
window.showInformationMessage('Hello, Welcome to the Project AI!');
}

function deactivate() {}

module.exports = { activate, deactivate }
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"jupyter.jupyterServerType": "local"
}
74 changes: 74 additions & 0 deletions Halo Strategy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import streamlit as st # web development
import numpy as np # np mean, np random
import pandas as pd # read csv, df manipulation
import time # to simulate a real time data, time loop
import plotly.express as px # interactive charts


# read csv from a github repo
df = pd.read_csv("https://raw.githubusercontent.com/Lexie88rus/bank-marketing-analysis/master/bank.csv")


st.set_page_config(
page_title = 'Real-Time Trading Strategy Dashboard',
page_icon = '✅',
layout = 'wide'
)

# dashboard title

st.title("Real-Time / Live Data Science Dashboard")

# top-level filters

job_filter = st.selectbox("Select the Job", pd.unique(df['job']))


# creating a single-element container.
placeholder = st.empty()

# dataframe filter

df = df[df['job']==job_filter]

# near real-time / live feed simulation

for seconds in range(200):
#while True:

df['age_new'] = df['age'] * np.random.choice(range(1,5))
df['balance_new'] = df['balance'] * np.random.choice(range(1,5))

# creating KPIs
avg_age = np.mean(df['age_new'])

count_married = int(df[(df["marital"]=='married')]['marital'].count() + np.random.choice(range(1,30)))

balance = np.mean(df['balance_new'])

with placeholder.container():
# create three columns
kpi1, kpi2, kpi3 = st.columns(3)

# fill in those three columns with respective metrics or KPIs
kpi1.metric(label="Age ⏳", value=round(avg_age), delta= round(avg_age) - 10)
kpi2.metric(label="Married Count 💍", value= int(count_married), delta= - 10 + count_married)
kpi3.metric(label="A/C Balance $", value= f"$ {round(balance,2)} ", delta= - round(balance/count_married) * 100)

# create two columns for charts

fig_col1, fig_col2 = st.columns(2)
with fig_col1:
st.markdown("### First Chart")
fig = px.density_heatmap(data_frame=df, y = 'age_new', x = 'marital')
st.write(fig)
with fig_col2:
st.markdown("### Second Chart")
fig2 = px.histogram(data_frame = df, x = 'age_new')
st.write(fig2)
st.markdown("### Detailed Data View")
st.dataframe(df)
time.sleep(1)
#placeholder.empty()


Loading