Skip to content

Latest commit

 

History

History
87 lines (59 loc) · 2.35 KB

File metadata and controls

87 lines (59 loc) · 2.35 KB

Configuration Reference

All user configuration lives in config.py and .env.


config.py

SYMBOLS

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-EQ for NSE equity)

ACTIVE_STRATEGY

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 = None

Broker Credentials

Loaded 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

.env

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

constants.py

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

CandleCache Options

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")