Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aitradingbotspro/cryto-trading-ai-assistant
/ functions
Functions
93 in github.com/aitradingbotspro/cryto-trading-ai-assistant
⨍
Functions
93
◇
Types & classes
26
↳
Endpoints
11
↓ 28 callers
Function
iso
(minsAgo: number)
dashboard/src/mockData.ts:7
↓ 7 callers
Function
get_settings
()
app/config.py:45
↓ 7 callers
Function
mockDelay
(ms = 200)
dashboard/src/mockData.ts:240
↓ 4 callers
Method
_get_client
(self)
modules/exchange_connector/bybit.py:31
↓ 4 callers
Method
_get_client
(self)
modules/exchange_connector/binance.py:31
↓ 4 callers
Function
formatUsd
(n: number)
dashboard/src/pages/Trades.tsx:26
↓ 4 callers
Function
withFallback
(real: () => Promise<T>, mock: () => T)
dashboard/src/api.ts:71
↓ 3 callers
Function
get_connector
(exchange: str)
app/guardian.py:21
↓ 3 callers
Function
load
(isRefresh = false)
dashboard/src/pages/Trades.tsx:38
↓ 3 callers
Function
load
(isRefresh = false)
dashboard/src/pages/Alerts.tsx:21
↓ 2 callers
Function
_run_guardian_and_persist
Load settings from DB, run guardian, persist alerts and trade.
app/main.py:119
↓ 2 callers
Function
getMockChartData
()
dashboard/src/mockData.ts:278
↓ 2 callers
Method
get_account_snapshot
(self)
modules/exchange_connector/bybit.py:41
↓ 2 callers
Function
get_risk_rules
(db: AsyncSession, user_id: str = USER_ID)
app/db/repository.py:23
↓ 2 callers
Function
get_settings
(db: AsyncSession, user_id: str = USER_ID)
app/db/repository.py:18
↓ 2 callers
Function
send_alerts
Send all alerts to Telegram and Discord.
app/guardian.py:63
↓ 2 callers
Function
send_telegram_alert
Send a single alert to Telegram. Returns True if sent.
modules/alerts/telegram_alerts.py:11
↓ 1 callers
Function
appendMockChartPoint
(series: ChartPoint[])
dashboard/src/mockData.ts:283
↓ 1 callers
Function
buildInitialChartData
()
dashboard/src/mockData.ts:256
↓ 1 callers
Function
check
()
dashboard/src/App.tsx:61
↓ 1 callers
Function
check_daily_drawdown
Alert if daily PnL (e.g. from exchange or stored session) exceeds max daily loss %. Caller should pass daily_pnl (negative = loss). account.e
modules/risk_engine/drawdown_monitor.py:9
↓ 1 callers
Function
check_leverage
Alert if leverage exceeds max allowed.
modules/risk_engine/leverage_check.py:9
↓ 1 callers
Function
check_position_risk
Check if this trade violates max risk per trade or position size vs balance.
modules/risk_engine/position_risk.py:9
↓ 1 callers
Function
detect_emotional_patterns
Analyze recent_trades + current_trade for emotional patterns. - Revenge: many trades shortly after a loss. - Overtrading: too many trades
modules/emotion_detector/behavior_model.py:11
↓ 1 callers
Function
formatDate
(iso: string)
dashboard/src/pages/Trades.tsx:17
↓ 1 callers
Function
formatRelativeTime
(iso: string)
dashboard/src/pages/Alerts.tsx:6
↓ 1 callers
Function
generate_trade_feedback
Generate feedback for a closed trade. Can be extended with ML later. For now uses heuristics: R-multiple if exit/entry known, size vs typical
modules/ai_analysis/trade_feedback.py:18
↓ 1 callers
Function
getAccount
(exchange: string)
dashboard/src/api.ts:136
↓ 1 callers
Function
getAlerts
(limit = 100)
dashboard/src/api.ts:112
↓ 1 callers
Function
getMockCandles
(count = 60)
dashboard/src/mockData.ts:313
↓ 1 callers
Function
getSettings
()
dashboard/src/api.ts:84
↓ 1 callers
Function
getTrades
(exchange?: string, limit = 100)
dashboard/src/api.ts:123
↓ 1 callers
Function
get_engine
()
app/database.py:11
↓ 1 callers
Method
get_open_positions
(self)
modules/exchange_connector/bybit.py:61
↓ 1 callers
Method
get_recent_trades
(self, symbol: Optional[str] = None, limit: int = 50)
modules/exchange_connector/bybit.py:89
↓ 1 callers
Function
health
()
dashboard/src/api.ts:162
↓ 1 callers
Function
init_db
Create tables. Call on startup.
app/database.py:34
↓ 1 callers
Function
list_alerts
(db: AsyncSession, limit: int = 100)
app/db/repository.py:79
↓ 1 callers
Function
list_trades
( db: AsyncSession, exchange: Optional[str] = None, limit: int = 100, )
app/db/repository.py:125
↓ 1 callers
Function
load
()
dashboard/src/pages/Risk.tsx:19
↓ 1 callers
Function
on_market_scan
Run market risk scanner and optionally send alerts.
app/guardian.py:103
↓ 1 callers
Function
on_trade_opened
Main entry: call when a new trade is opened. Optionally fetches account from exchange.
app/guardian.py:70
↓ 1 callers
Function
putSettings
(risk?: Partial<RiskSettings>, strategy?: Partial<StrategySettings>)
dashboard/src/api.ts:95
↓ 1 callers
Function
run_guardian_checks
Run full pipeline: risk, leverage, drawdown, strategy, emotion. Returns list of alerts (caller or this function can send them).
app/guardian.py:30
↓ 1 callers
Function
scan_market_risk
Scan market conditions before entry. Returns result + alerts if high risk.
modules/ai_analysis/market_risk_scanner.py:20
↓ 1 callers
Function
send_discord_alert
Send a single alert to Discord via webhook. Returns True if sent.
modules/alerts/discord_alerts.py:10
↓ 1 callers
Function
store_alert
(db: AsyncSession, alert: GuardianAlert)
app/db/repository.py:64
↓ 1 callers
Function
store_trade
(db: AsyncSession, trade: Trade)
app/db/repository.py:104
↓ 1 callers
Function
tickMockCandle
(candles: Candle[])
dashboard/src/mockData.ts:336
↓ 1 callers
Function
upsert_settings
( db: AsyncSession, risk_rule: Optional[RiskRule] = None, strategy_name: Optional[str] = None,
app/db/repository.py:35
↓ 1 callers
Function
validate_trade_against_rules
Check if the trade matches strategy entry rules using market_context. market_context can include: rsi, near_support, btc_trend, etc.
modules/strategy_validator/rule_engine.py:27
Function
Alerts
()
dashboard/src/pages/Alerts.tsx:16
Function
App
()
dashboard/src/App.tsx:56
Function
CandlestickChart
()
dashboard/src/components/CandlestickChart.tsx:8
Function
IconAlerts
()
dashboard/src/App.tsx:16
Function
IconList
()
dashboard/src/App.tsx:34
Function
IconLogo
()
dashboard/src/App.tsx:47
Function
IconShield
()
dashboard/src/App.tsx:26
Function
Risk
()
dashboard/src/pages/Risk.tsx:6
Function
Trades
()
dashboard/src/pages/Trades.tsx:30
Method
__init__
( self, api_key: Optional[str] = None, api_secret: Optional[str] = None, testn
modules/exchange_connector/bybit.py:15
Method
__init__
( self, api_key: Optional[str] = None, api_secret: Optional[str] = None, testn
modules/exchange_connector/binance.py:15
Method
__init__
( self, entry_conditions: Optional[Dict[str, Any]] = None, exit_conditions: Optional[D
modules/strategy_validator/rule_engine.py:13
Function
_trade_to_snapshot
(t: Trade)
app/db/repository.py:87
Function
api_get_account
Get account snapshot from exchange (for dashboard).
app/main.py:205
Function
api_get_positions
Get open positions (for dashboard).
app/main.py:217
Function
api_get_settings
Get current risk and strategy settings (for dashboard).
app/main.py:229
Function
api_list_alerts
List recent alerts (for dashboard feed).
app/main.py:278
Function
api_list_trades
List stored trades (for dashboard history).
app/main.py:296
Function
api_market_scan
Run market risk scan (liquidation cluster, funding, volatility).
app/main.py:169
Function
api_on_trade_opened
Simulate or forward a trade open event. Runs risk + strategy + emotion checks and sends alerts. Persists alerts and trade for the dashboard.
app/main.py:151
Function
api_put_settings
Update risk and/or strategy settings.
app/main.py:253
Function
api_trade_feedback
Get AI feedback for a closed trade.
app/main.py:186
Method
exchange_name
(self)
modules/exchange_connector/bybit.py:28
Method
exchange_name
(self)
modules/exchange_connector/binance.py:28
Method
exchange_name
(self)
modules/exchange_connector/base.py:16
Function
getPositions
(exchange: string)
dashboard/src/api.ts:147
Method
get_account_snapshot
(self)
modules/exchange_connector/binance.py:41
Method
get_account_snapshot
Current balance and equity.
modules/exchange_connector/base.py:20
Method
get_current_price
(self, symbol: str)
modules/exchange_connector/bybit.py:120
Method
get_current_price
(self, symbol: str)
modules/exchange_connector/binance.py:110
Method
get_current_price
Current mark/mid price for the symbol.
modules/exchange_connector/base.py:35
Function
get_db
()
app/database.py:29
Method
get_open_positions
(self)
modules/exchange_connector/binance.py:57
Method
get_open_positions
All open positions (converted to Trade models).
modules/exchange_connector/base.py:25
Method
get_recent_trades
(self, symbol: Optional[str] = None, limit: int = 50)
modules/exchange_connector/binance.py:85
Method
get_recent_trades
Recent closed trades for behavior and feedback.
modules/exchange_connector/base.py:30
Function
handleResize
()
dashboard/src/components/CandlestickChart.tsx:63
Function
health
()
app/main.py:115
Function
lifespan
(app: FastAPI)
app/main.py:93
Function
save
()
dashboard/src/pages/Risk.tsx:40
Function
send_telegram_alert_sync_fallback
Fallback using sync run if needed.
modules/alerts/telegram_alerts.py:37
Function
webhook_trade
Receive new trade from exchange webhook or TradingView alert. Runs full guardian pipeline and persists alerts + trade.
app/main.py:324