TopicTrading Software
Backtesting, broker APIs and market-data tooling. Engineering only, never advice.
Short answer: To make Python force IPv4 in requests, set urllib3.util.connection.HAS_IPV6 = False, or mount an HTTPAdapter that binds source_address to ('0.0.0.0', 0). aiohttp uses family=AF_INET and httpx uses local_address='0.0.0.0'.
Read the full answer
Short answer: A Pine Script separate pane is controlled by one setting: overlay in indicator() or strategy(). overlay=false puts the whole script in its own pane, overlay=true uses the price chart, and in v6 force_overlay=true sends single drawings to the chart.
Read the full answer
Short answer: To calculate exponential moving average in Python, sort prices oldest to newest and run df['close'].ewm(span=N, adjust=False).mean(). That applies EMA_t = alpha*price_t + (1-alpha)*EMA_{t-1} with alpha = 2/(N+1).
Read the full answer
Short answer: True daily short interest data is not free, because it is not public at all: firms report open short positions to FINRA only twice a month. The closest free substitutes are FINRA's daily short sale volume files and twice-monthly short interest.
Read the full answer
Short answer: yfinance close vs adjusted close comes down to auto_adjust: it now defaults to True, so Close is already adjusted and Adj Close is dropped. Pass auto_adjust=False to get Yahoo's Close plus Adj Close.
Read the full answer
Short answer: Pine Script default_qty_value cannot be read at runtime: no built-in variable exposes it or the Properties tab Order size. Create your own inputs for size mode and value, compute qty in code, and pass it to strategy.entry(qty=...).
Read the full answer
Short answer: To yfinance suppress output, first find the channel: modern versions log through the 'yfinance' logger, so logging.getLogger('yfinance').setLevel(logging.CRITICAL) silences 404 messages, while download() also needs progress=False for the bar.
Read the full answer
Short answer: A tqdm progress bar new line on every update means something broke its carriage-return redraw: a bar wider than the terminal, a console without \r support, stray prints, or a bar created inside the loop or callback.
Read the full answer
Short answer: Algorithmic trading strategy lifespan has no universal constant: published anomaly returns fell about 26% out-of-sample and 58% post-publication, while HFT edges can vanish in days to months and slow factors fade over years.
Read the full answer
Short answer: The best database for tick data backtesting at 0.5 to 1TB is usually not a database: zstd-compressed Parquet files partitioned by date and symbol, queried with DuckDB or Polars. Use ClickHouse or QuestDB only for multi-user or live ingestion.
Read the full answer
Short answer: L2 vs L3 market data differs in granularity: L2 (market by price) aggregates size per price level, while L3 (market by order) streams every individual order by ID. L3 can be aggregated into L2, but L2 can never be turned back into L3.
Read the full answer
Short answer: To close resources on an asyncio KeyboardInterrupt, put cleanup in a try/finally inside the main coroutine, where main owns every client and awaits close(). A sync except around asyncio.run() runs after the loop is gone.
Read the full answer