How periza0/cashcarrybot works
This repository is a two-mode futures-arbitrage bot: the live engine processes Zerodha ticks, while the backtest engine evaluates aligned historical minute bars. Both calculate cost-of-carry fair value, compare mispricing with estimated costs, track expiry-based positions and P&L, and log signals to CSV. The README also describes instrument discovery, dividend lookup, transaction-cost filtering, and risk tracking. Source excerpts show implementation details for both engines; some broader README capabilities, such as live authentication and trade execution, are not evidenced as separate runtime components.
Main entry points: CashAndCarry.py Trade Decision · backTest.py Trade Decision
Components 23
Live Trading
- Live Engine
CashAndCarry.py - Tick Stream
CashAndCarry.py - Position State
CashAndCarry.py - Live Signal Log
CashAndCarry.py
Backtesting
- Backtest Engine
backTest.py - Historical Bars
backTest.py - Backtest State
backTest.py - Backtest Signal Log
backTest.py
Arbitrage Strategy
- Fair Value
CashAndCarry.py - Cost Estimate
CashAndCarry.py - Trade Decision
CashAndCarry.py - Risk and P&L
CashAndCarry.py - Fair Value
backTest.py - Cost Estimate
backTest.py - Trade Decision
backTest.py - Risk and P&L
backTest.py
Data Integrations
- Instrument Discovery
CashAndCarry.py - Kite Connect
- Dividend Lookup
CashAndCarry.py - Screener.in
- Backtest Instruments
backTest.py - Kite Connect
Other components
- Trader
Connections 27
- Trader → Live Engine: starts
CashAndCarry.py - Live Engine → Kite Connect: authenticates
CashAndCarry.py - Live Engine → Instrument Discovery: discovers
CashAndCarry.py - Instrument Discovery → Kite Connect: fetches instruments
CashAndCarry.py - Live Engine → Dividend Lookup: retrieves yield
CashAndCarry.py - Dividend Lookup → Screener.in: requests data
CashAndCarry.py - Live Engine → Tick Stream: starts stream
CashAndCarry.py - Tick Stream → Kite Connect: subscribes
CashAndCarry.py - Tick Stream → Fair Value: provides prices
CashAndCarry.py - Tick Stream → Trade Decision: invokes
CashAndCarry.py - Trade Decision → Fair Value: calculates value
CashAndCarry.py - Trade Decision → Cost Estimate: estimates costs
CashAndCarry.py - Trade Decision → Position State: updates position
CashAndCarry.py - Trade Decision → Risk and P&L: realizes P&L
CashAndCarry.py - Trade Decision → Live Signal Log: writes signals
CashAndCarry.py - Trader → Backtest Engine: starts
backTest.py - Backtest Engine → Backtest Instruments: uses tokens
backTest.py - Backtest Instruments → Kite Connect: fetches instruments
backTest.py - Backtest Engine → Historical Bars: fetches bars
backTest.py - Historical Bars → Kite Connect: requests history
backTest.py - Backtest Engine → Dividend Lookup: retrieves yield
backTest.py - Backtest Engine → Trade Decision: invokes
backTest.py - Trade Decision → Fair Value: calculates value
backTest.py - Trade Decision → Cost Estimate: estimates costs
backTest.py - Trade Decision → Backtest State: updates position
backTest.py - Trade Decision → Risk and P&L: realizes P&L
backTest.py - Trade Decision → Backtest Signal Log: writes signals
backTest.py