s servlociStatic IPv6 Proxy
Live Sign in
Static IP Trading Suite Compute Docs Ready pages Free Notebooks
← Back to Static IP

Notebook series

37-part course + complete Dhan quickstart. Pick one.

Start here — no signup needed

Ready pagesPlain words, live stock picker 1. Read real market datayfinance, no broker account 2. Returns, vol, Sharpe, drawdownThe numbers courses skip 3. Backtest without fooling yourselfLookahead bias & real costs 4. Capstone: your own strategyReal tickers, start to finish 5. Correlation and pairsHeatmap, rolling corr, not a hedge 6. Prediction vs naiveBeat zero-return first 7. Portfolio analyticsWeights, frontier, drawdown 8. Prophet + Drive labScorecards and three projectors

Broker-integration learning path

1. Compare broker APIs18 first-party API sources 2. Compute 50 indicatorsOne dependency-light engine 3. Connect broker candlesNormalize once, reuse everywhere 4. Alert safelyDe-duplicate, risk-check, dry-run

Setup

00Get Your Static IP & Verify It 01ServLoci SDK Quickstart

Broker auth

02Broker Auth: Zerodha (Kite Connect) 03Broker Auth: Dhan 04Broker Auth: Groww 05Broker Auth: Fyers

Options math

06Black-Scholes Pricing & Greeks 07Option Payoff & Breakeven Calculator

Strategy templates

08Strategy: Straddle & Strangle 09Strategy: Vertical Spreads 10Strategy: Iron Condor

Live data

11Live Option Chain Fetch 12Implied Volatility Skew

Backtesting

13Historical Data for Backtesting 14Backtest: Weekly Short Straddle

Risk & execution

15Position Sizing & Risk Management 16Order Management System 17Paper Trading Loop 18Signal-to-Order Pipeline 19Capstone: End-to-End Algo Bot

Broker APIs & indicators

20Indian Broker API Landscape 21Top 50 Technical Indicators 22Broker Data to Indicator Pipeline 23Alerts and ServLoci Dispatch

Stock Market School (yfinance, no signup)

24Reading the Market with yfinance 25Returns, Volatility & the Numbers Courses Skip 26Fundamental Analysis with Real Filings 27Technical Indicators, Tested Honestly 28Options, Priced Against Reality 29Backtesting Without Fooling Yourself 30Position Sizing, Risk of Ruin & Trading Psychology 31Capstone: Build Your Own Strategy End to End 32Stock Correlation, Clusters and Pairs 33Return Prediction Baselines (Beat Naive First) 34Portfolio Analytics: Weights, Frontier, Drawdown 35Prophet, Drive Lab & Three Projectors

More

36TradeDash Add-On Data API 37Complete Colab Quickstart: Dhan + Static IP

Broker Auth: Fyers

Open in Colab View source Ready pages

Broker Auth: Fyers¶

Open In Colab

Authenticate and place a demo order via the FYERS API over your static IP.

Part 05 of 37 in the ServLoci algo/options trading notebook series — full index in notebooks/README.md.

Setup¶

# Get your dedicated static IPv6 + SOCKS5 credentials free:
#   https://comm.servloci.in/register        (or /auth/google?free=1 for an instant trial)
# Your api_key / api_secret pair shows up in the portal after signup:
#   https://comm.servloci.in/user
!pip install -q "requests[socks]"
!curl -sL https://comm.servloci.in/sdk/servloci.py -o servloci.py

import os
from servloci import ServLoci

SERVLOCI_API_KEY = os.environ.get("SERVLOCI_API_KEY", "dhan:1000000001")   # broker:client_id
SERVLOCI_API_SECRET = os.environ.get("SERVLOCI_API_SECRET", "")            # from the portal — leave blank to run this notebook in demo mode

sl = None
if SERVLOCI_API_SECRET:
    sl = ServLoci(api_key=SERVLOCI_API_KEY, api_secret=SERVLOCI_API_SECRET)
    print("ServLoci configured:", sl.host, sl.port)
else:
    print("SERVLOCI_API_SECRET not set — running in demo mode (no live proxy calls).")

Support level: Confirmation flow for individual and family accounts — FYERS support verifies the requesting IP before enabling API trading.

Indian broker APIs authenticate trading sessions with an OAuth-style two-step handshake, not a single long-lived key. You redirect the user (in practice, yourself) to a broker login page, the broker redirects back with a short-lived request_token, and you exchange that token — together with your app's api_secret — for an access_token that's valid for actual order calls. The api_key/api_secret pair identifies your app; the access_token identifies an authenticated session and, at every broker covered here, expires at end of trading day regardless of activity. That forced daily re-login is a deliberate session-security control, common across SEBI-regulated broker APIs, so a stolen access token has a shelf life measured in hours, not indefinitely.

FYERS sits between Kite's instant self-service and Dhan's ticket queue: API access is enabled per app, but support verifies the requesting IP before switching it on, including for family/sub-accounts trading under one umbrella. FYERS also publishes a WebSocket feed alongside the REST API, which matters once you move from polling (notebook 11) to a lower-latency data path.

if sl:
    sl.attach()  # BEFORE importing fyers-apiv3 — it creates a requests.Session at import time
    from fyers_apiv3 import fyersModel

    fyers = fyersModel.FyersModel(client_id=os.environ.get("FYERS_CLIENT_ID", ""),
                                   token=os.environ.get("FYERS_ACCESS_TOKEN", ""), is_async=False)
    print("Fyers client ready")
    # order = fyers.place_order(data={"symbol": "NSE:INFY-EQ", "qty": 1, "type": 2,
    #                                  "side": 1, "productType": "INTRADAY"})
else:
    print("Demo mode — set SERVLOCI_API_SECRET above to run this against your Fyers account.")

Install the broker SDK separately: !pip install -q fyers-apiv3. Full whitelist steps: https://comm.servloci.in/docs/brokers.


« Previous: Broker Auth: Groww
Next: Black-Scholes Pricing & Greeks »

Try the concepts above interactively: Options Strategy Builder · Docs · Get your static IP