shaikhmarketing commited on
Commit
7880be8
·
verified ·
1 Parent(s): 13c1a42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -1,4 +1,3 @@
1
- %%writefile app.py
2
  import streamlit as st
3
  import ccxt
4
  import pandas as pd
@@ -19,7 +18,7 @@ def get_live_usdt_dominance():
19
  except Exception as e:
20
  return 0.0, 0.0
21
 
22
- # --- 1. Kaggle Heavy Compute Backend ---
23
  @st.cache_resource
24
  def train_spot_model(symbol):
25
  exchange = ccxt.bitget()
@@ -72,7 +71,7 @@ def train_spot_model(symbol):
72
  def analyze_live_market(symbol, model, features):
73
  exchange = ccxt.bitget()
74
 
75
- ohlcv = exchange.fetch_ohlcv(symbol, '1h', limit=100) # Pulled more candles for a better chart view
76
  df = pd.DataFrame(ohlcv, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
77
  df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
78
 
@@ -102,12 +101,11 @@ def analyze_live_market(symbol, model, features):
102
  invalidation_level = limit_entry * 0.99
103
  take_profit = limit_entry * 1.02
104
 
105
- # Return the dataframe as well so we can plot it
106
  return current_price, confidence, limit_entry, invalidation_level, take_profit, market_state, live_imbalance, df
107
 
108
  # --- 3. Streamlit UI ---
109
  st.set_page_config(page_title="AI Spot Sniper", layout="wide")
110
- st.title("🎯 Kaggle AI Spot Sniper Terminal")
111
 
112
  TOP_50_PAIRS = [
113
  'BTC/USDT', 'ETH/USDT', 'SOL/USDT', 'BNB/USDT', 'XRP/USDT', 'ADA/USDT',
 
 
1
  import streamlit as st
2
  import ccxt
3
  import pandas as pd
 
18
  except Exception as e:
19
  return 0.0, 0.0
20
 
21
+ # --- 1. Cloud Compute Backend ---
22
  @st.cache_resource
23
  def train_spot_model(symbol):
24
  exchange = ccxt.bitget()
 
71
  def analyze_live_market(symbol, model, features):
72
  exchange = ccxt.bitget()
73
 
74
+ ohlcv = exchange.fetch_ohlcv(symbol, '1h', limit=100)
75
  df = pd.DataFrame(ohlcv, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume'])
76
  df['timestamp'] = pd.to_datetime(df['timestamp'], unit='ms')
77
 
 
101
  invalidation_level = limit_entry * 0.99
102
  take_profit = limit_entry * 1.02
103
 
 
104
  return current_price, confidence, limit_entry, invalidation_level, take_profit, market_state, live_imbalance, df
105
 
106
  # --- 3. Streamlit UI ---
107
  st.set_page_config(page_title="AI Spot Sniper", layout="wide")
108
+ st.title("🎯 AI Spot Sniper Terminal")
109
 
110
  TOP_50_PAIRS = [
111
  'BTC/USDT', 'ETH/USDT', 'SOL/USDT', 'BNB/USDT', 'XRP/USDT', 'ADA/USDT',