User Setup Guide: Fyers Store
This guide will help you install and configure the fyers-store library for use in your trading strategies.
1. Installation
Install the library via pip. If you are using Backtrader, include the [bt] extra:
# Basic installation
pip install .
# Installation with Backtrader support
pip install ".[bt]"
2. Default File Locations
By default, fyers-store keeps all data, logs, and configurations in your user home directory to keep your project folder clean.
- Windows:
C:\Users\<YourName>\.fyers_store\ - Linux/Mac:
~/.fyers_store/
How to override the location
If you want to store data elsewhere (e.g., on a different drive), set the FYERS_STORE_ROOT environment variable:
# Windows (PowerShell)
$env:FYERS_STORE_ROOT = "D:\TradingData"
# Linux/Mac
export FYERS_STORE_ROOT="/mnt/trading_data"
For production safety, set FYERS_STRICT_CONFIG=1 to require explicit config paths and disable default fallbacks.
3. Configuration Step
- Navigate to your
.fyers_storefolder (or your custom root). - Create a subfolder named
config. - Place your
cache.yaml,state.yaml, andfyers_credentials.yamlfiles inside thatconfigfolder.
4. Trading Environment (Safety First)
The library includes a safety guardrail to prevent accidental orders.
- DEV (Default): No real orders allowed. Use this for testing.
- PAPER: For use with simulation environments.
- LIVE: Required for actual capital risk.
You can set this in your cache.yaml or state.yaml config files, or via environment variables.
5. Authentication (Getting Started)
The bundled credentials template uses placeholders only (no real secrets). Update your local
fyers_credentials.yaml with real values or point FYERS_CREDENTIALS_YAML at your private file.
...
6. Troubleshooting & Health Check
If something goes wrong:
1. Check the logs: ~/.fyers_store/logs/fyers_store.log
2. Actionable Errors: The library will tell you exactly which file is missing and where it looked.
3. Health Check: Run store.health_check() in your script to see connection statuses and file paths.
Setup Guide Version 1.1