Skip to content

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"

3. Configuration Step

  1. Navigate to your .fyers_store folder (or your custom root).
  2. Create a subfolder named config.
  3. Place your cache.yaml, state.yaml, and fyers_credentials.yaml files inside that config folder.

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)

...

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