All user configuration lives in config.py and .env.
List of Fyers-format symbols to subscribe to via WebSocket.
SYMBOLS = ["NSE:SBIN-EQ", "NSE:RELIANCE-EQ"]Format:
EXCHANGE:SYMBOL-SEGMENT(e.g.,NSE:SBIN-EQfor NSE equity)
The fully qualified Python path to the strategy class to load at startup.
# Load the sample EMA crossover strategy
ACTIVE_STRATEGY = "strategy.sample_ema_crossover.EMACrossoverStrategy"
# No strategy — system will only collect data
ACTIVE_STRATEGY = NoneLoaded from .env via python-dotenv:
| Variable | Description |
|---|---|
TOTP_KEY |
Your Fyers TOTP key for 2FA |
CLIENT_ID |
Fyers API client ID (e.g., XXXXXXXX-100) |
SECRET_KEY |
Fyers API secret key |
PIN |
Your Fyers account PIN |
USERNAME |
Your Fyers account username/ID |
Create a .env file in the project root:
TOTP_KEY=YOUR_TOTP_KEY
CLIENT_ID=YOUR_CLIENT_ID
SECRET_KEY=YOUR_SECRET_KEY
PIN=YOUR_PIN
USERNAME=YOUR_USERNAME| Constant | Value | Description |
|---|---|---|
MARKET_OPEN |
09:15 |
IST market open time |
MARKET_CLOSE |
15:30 |
IST market close time |
ENCRYPTION_KEY |
bytes |
Fernet key for encrypting stored tokens |
The CandleCache in data/__init__.py can be configured with:
cache = CandleCache(interval=300, resolution="5")| Parameter | Default | Description |
|---|---|---|
interval |
300 |
Candle duration in seconds |
resolution |
"5" |
Fyers API resolution string ("1", "5", "15", "30", "60", "D") |
To change the candle timeframe, modify data/__init__.py:
# Example: 15-minute candles
cache = CandleCache(interval=900, resolution="15")