Dmitry Beresnev
commited on
Commit
·
37c39e5
1
Parent(s):
e9a3944
fix tradingview links generation
Browse files
src/core/ticker_scanner/ticker_analyzer.py
CHANGED
|
@@ -229,16 +229,16 @@ class TickerAnalyzer:
|
|
| 229 |
|
| 230 |
def _generate_tradingview_mobile_link(self, ticker: str) -> str:
|
| 231 |
"""
|
| 232 |
-
Generate TradingView mobile
|
| 233 |
|
| 234 |
-
|
| 235 |
-
|
| 236 |
|
| 237 |
Args:
|
| 238 |
ticker: Stock ticker symbol
|
| 239 |
|
| 240 |
Returns:
|
| 241 |
-
TradingView mobile
|
| 242 |
"""
|
| 243 |
# Map exchange enum to TradingView exchange code
|
| 244 |
exchange_map = {
|
|
@@ -248,7 +248,7 @@ class TickerAnalyzer:
|
|
| 248 |
|
| 249 |
tv_exchange = exchange_map.get(self.exchange, self.exchange.value)
|
| 250 |
|
| 251 |
-
#
|
| 252 |
-
# Format: tradingview
|
| 253 |
-
# This
|
| 254 |
-
return f"tradingview
|
|
|
|
| 229 |
|
| 230 |
def _generate_tradingview_mobile_link(self, ticker: str) -> str:
|
| 231 |
"""
|
| 232 |
+
Generate TradingView mobile-optimized link.
|
| 233 |
|
| 234 |
+
Uses universal link format that opens in the app if installed,
|
| 235 |
+
or browser if not. This is more reliable than custom URL schemes.
|
| 236 |
|
| 237 |
Args:
|
| 238 |
ticker: Stock ticker symbol
|
| 239 |
|
| 240 |
Returns:
|
| 241 |
+
TradingView mobile-optimized URL
|
| 242 |
"""
|
| 243 |
# Map exchange enum to TradingView exchange code
|
| 244 |
exchange_map = {
|
|
|
|
| 248 |
|
| 249 |
tv_exchange = exchange_map.get(self.exchange, self.exchange.value)
|
| 250 |
|
| 251 |
+
# Use chart link with symbol parameter - works better on mobile
|
| 252 |
+
# Format: https://www.tradingview.com/chart/?symbol=NASDAQ:AAPL
|
| 253 |
+
# This is a universal link that opens in app if installed
|
| 254 |
+
return f"https://www.tradingview.com/chart/?symbol={tv_exchange}:{ticker}"
|