<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prashant Lal on Medium]]></title>
        <description><![CDATA[Stories by Prashant Lal on Medium]]></description>
        <link>https://medium.com/@Prashant.Lal?source=rss-b819d5301fc4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*47l06D9Nyei7efnn</url>
            <title>Stories by Prashant Lal on Medium</title>
            <link>https://medium.com/@Prashant.Lal?source=rss-b819d5301fc4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:12:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Prashant.Lal/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AI Architecture Beyond MLOps & LLMOps: The Rise of AgenticOps]]></title>
            <link>https://medium.com/@Prashant.Lal/ai-architecture-beyond-mlops-llmops-the-rise-of-agenticops-7ce1be5073aa?source=rss-b819d5301fc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ce1be5073aa</guid>
            <category><![CDATA[llmops]]></category>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Prashant Lal]]></dc:creator>
            <pubDate>Tue, 10 Feb 2026 19:30:14 GMT</pubDate>
            <atom:updated>2026-02-10T19:30:14.289Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The winners won’t be those who train the best models — but those who run the best agents.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*AGWQAy2Ye-d0wvER0qP_bA.png" /></figure><p>The AI ecosystem is entering a post-model-centric phase. While <strong>MLOps</strong> optimized training, deployment, and retraining of statistical models, and <strong>LLMOps</strong> extended these practices to foundation models with prompt, inference, and cost governance, neither is sufficient for <strong>autonomous, goal-driven AI systems</strong>. This gap is filled by <strong>AgenticOps</strong>.</p><p><strong>From Models to Agents</strong></p><p>Future AI systems are not single models but <strong>ensembles of agents</strong> — reasoning, planning, acting, observing, and self-correcting across tools, environments, and time. Models become <em>substrates</em>, while <strong>agency becomes the unit of orchestration</strong>.</p><p>Agentic systems introduce:</p><ul><li>Long-horizon goals instead of single inference calls</li><li>Tool use, memory, reflection, and delegation</li><li>Continuous interaction with dynamic environments</li><li>Emergent behavior from multi-agent coordination</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*_8aLPDP9aYByXLpbRwgtcA.png" /></figure><p><strong>What AgenticOps Governs</strong></p><p><strong>AgenticOps</strong> extends beyond pipelines and prompts to manage:</p><ul><li><strong>Agent lifecycle</strong>: instantiation, role assignment, evolution, retirement</li><li><strong>Cognitive workflows</strong>: planning loops, reflection cycles, decision checkpoints</li><li><strong>State &amp; memory</strong>: episodic, semantic, and procedural memory governance</li><li><strong>Autonomy controls</strong>: guardrails, trust boundaries, escalation paths</li><li><strong>Outcome assurance</strong>: goal completion, alignment, and impact monitoring</li></ul><p>In this paradigm, observability shifts from <em>model metrics</em> (loss, drift) to <em>behavioral metrics</em>:</p><ul><li>Goal success rate</li><li>Planning efficiency</li><li>Tool reliability</li><li>Coordination overhead</li><li>Human-intervention frequency</li></ul><p><strong>The Decline of Frequent Retraining</strong></p><p>As <strong>agent-native architectures</strong> and highly general models (e.g., VL-ZEPA-like multimodal, world-model-centric systems) prevail, <strong>frequent retraining — core to classical MLOps — diminishes in importance</strong>.</p><p>Instead of:</p><ul><li>Constant fine-tuning for new tasks</li><li>Data drift triggering retraining cycles</li></ul><p>We move toward:</p><ul><li><strong>In-context learning and self-adaptation</strong></li><li><strong>Memory updates over weight updates</strong></li><li><strong>Policy and strategy evolution at the agent layer</strong></li><li><strong>Simulation-driven validation rather than data-driven retraining</strong></li></ul><p>Training becomes <strong>rare, expensive, and foundational</strong>, while <strong>adaptation becomes continuous, cheap, and operational</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*y95z7Hxf10nVMVAExlCEaw.png" /></figure><p><strong>The New AI Stack</strong></p><p>The future AI architecture stack evolves as follows:</p><ul><li><strong>Foundation Models</strong> → stable, general reasoning engines</li><li><strong>Agent Layer</strong> → planners, executors, critics, coordinators</li><li><strong>AgenticOps Layer</strong> → autonomy governance, safety, observability, evolution</li><li><strong>Environment Layer</strong> → tools, APIs, digital &amp; physical worlds</li><li><strong>Human Layer</strong> → intent setting, oversight, exception handling</li></ul><p><strong>Conclusion</strong></p><p>MLOps optimized <em>models</em>.<br> LLMOps optimized <em>prompts and inference</em>.<br> <strong>AgenticOps optimizes autonomy itself.</strong></p><p>In an agentic AI ecosystem, the strategic advantage no longer comes from how often you retrain models — but from <strong>how safely, efficiently, and intelligently your agents learn, act, and evolve in the world</strong>.</p><p><strong>Bottom Line:</strong></p><p><em>Competitive advantage shifts from how often you train models<br> to how well your agents think, act, and evolve safely.</em></p><blockquote><a href="https://www.linkedin.com/in/prashanttklal/">https://www.linkedin.com/in/prashanttklal/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ce1be5073aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taming the Beast: A Journey to Reliable Nifty Data Feeds with Python]]></title>
            <link>https://medium.com/@Prashant.Lal/taming-the-beast-a-journey-to-reliable-nifty-data-feeds-with-python-9fb5623e2050?source=rss-b819d5301fc4------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fb5623e2050</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Prashant Lal]]></dc:creator>
            <pubDate>Sat, 06 Sep 2025 07:13:26 GMT</pubDate>
            <atom:updated>2025-09-06T07:13:26.314Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I navigated dependency hell, websocket conflicts, and C++ build errors to build a robust market data system.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*rRaczfMENMt3sIeFH2X6rA.png" /><figcaption><em>Image: A flow diagram showing data from Yahoo Finance and Fyers API being processed by Python scripts and output to a terminal and chart.</em></figcaption></figure><h3>The Objective: Data is King</h3><p>Every algorithmic trading project, whether a simple indicator or a complex bot, starts with one crucial element: reliable, real-time market data. My goal was straightforward: to build a robust Python-based system that could fetch and display live Nifty 50 and Bank Nifty data. I wanted to explore multiple data sources for redundancy and functionality — starting with the popular yfinance library and then integrating the official Fyers API for its advanced features like WebSocket streaming.</p><p>This is the story of that journey. It’s a tale of initial success, bewildering failure, forensic debugging, and ultimately, a solution that any developer working in the Python ecosystem can learn from.</p><h3>Act I: The Simple Elegance of Yahoo Finance</h3><p>The first attempt was quick and clean. The yfinance library is a beloved tool for a reason. In a few lines of code, I had a script pulling live data.</p><p>python</p><pre>import yfinance as yf<br>nifty = yf.Ticker(&quot;^NSEI&quot;)<br>data = nifty.info<br>print(f&quot;LTP: {data[&#39;regularMarketPrice&#39;]}&quot;)nifty = yf.Ticker(&quot;^NSEI&quot;)<br>data = nifty.info<br>print(f&quot;LTP: {data[&#39;regularMarketPrice&#39;]}&quot;)</pre><p>It worked flawlessly. The terminal output showed crisp, real-time numbers. I celebrated a little too early.</p><h3>Act II: The Plot Thickens — Integrating Fyers API</h3><p>Satisfied with Yahoo, I turned to the Fyers API V3. As a broker’s official API, it offers richer data, direct integration for trading, and a robust WebSocket for real-time updates. The installation seemed smooth:</p><pre>pip install fyers-apiv3</pre><p>The authentication flow worked perfectly. The script ran, and the data poured into my terminal. Elation! I had both data sources running. I shut down for the day, pleased with my progress.</p><h3>Act III: The Dependency Nightmare Unfolds</h3><p>The next morning, catastrophe struck. My trusty Yahoo Finance script, which worked perfectly hours before, was now throwing a baffling error:</p><pre>ModuleNotFoundError: No module named &#39;websockets.sync&#39;</pre><p>How could a script that wasn’t touched suddenly break? This began the detective phase. The key clues came from pip:</p><pre>fyers-apiv2 2.0.9 requires websockets==8.1, but you have websockets 15.0.1 which is incompatible.</pre><p>The culprit was identified! The fyers-apiv2 package had a dependency (aiohttp) that, in turn, depended on an older version of websockets. During its installation, pip had silently downgraded websockets from v15.0.1 to v8.1. The newer yfinance library required features only present in v10+, hence the crash.</p><p>It was a classic case of dependency hell.</p><h3>The Solution: Isolate and Conquer</h3><p>The fix was surgical:</p><ol><li>Uninstall the conflicting packages: pip uninstall fyers-apiv3 yfinance websockets -y</li><li>Reinstall with correct versions: pip install yfinance websockets&gt;=10.0</li></ol><p>This restored the Yahoo Finance script to working order. The lesson was clear: never let packages fight over dependencies in a global environment.</p><h3>Act IV: Conquering the Windows Build Tools Error</h3><p>On a separate machine, a new challenge emerged when installing Fyers. The installation failed with a intimidating error:</p><pre>error: Microsoft Visual C++ 14.0 or greater is required.</pre><p>This is a common Windows hurdle. Some Python packages contain components written in C that need to be compiled during installation. The solution was to install the Microsoft C++ Build Tools, a one-time setup that unlocks the ability to install virtually any Python package.</p><p>With the build tools installed, fyers-apiv3 installed seamlessly, and I could run both data scripts in harmony.</p><h3>Architecture and Resolution: The Final Flow</h3><p>The final, stable architecture relies on separation. While I got both working in one environment, the professional and safe approach is to use virtual environments.</p><p>The data flow is simple but powerful:</p><ol><li>Data Sources: Yahoo Finance &amp; Fyers API serve as redundant data feeds.</li><li>Python Scripts: Process the data, calculate indicators, and prepare it for consumption.</li><li>Output: A terminal display for real-time monitoring and a chart for visualization.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tDGeGT2P9NJ2UQuBvCGPWw.png" /><figcaption><em>Using separate virtual environments is the best practice to avoid dependency conflicts.</em></figcaption></figure><p><em>Using separate virtual environments is the best practice to avoid dependency conflicts.</em></p><h3>Key Takeaways and Lessons Learned</h3><ol><li>Virtual Environments Are Non-Negotiable: This is the #1 takeaway. Use venv or conda environments to isolate project dependencies. This would have prevented the entire websocket conflict.</li></ol><pre>python -m venv venv_yfinance<br>python -m venv venv_fyers</pre><ol><li>Understand Your Dependencies: Before installing a package, use pip install --dry-run &lt;package&gt; to see what it will change in your environment.</li><li>The Build Tools Are Your Friend: On Windows, install the Microsoft C++ Build Tools early. It’s a one-time investment that prevents countless future installation errors.</li><li>Embrace the Journey: Debugging is not a failure; it’s the process of understanding. The real learning happened not when the code worked, but when it broke.</li></ol><p>This journey from a simple script to a nuanced understanding of Python’s packaging ecosystem was incredibly rewarding. It transformed a frustrating afternoon of errors into a valuable case study in robust software development for finance.</p><p><em>The Code for Yahoo finance :</em></p><pre>import yfinance as yf<br>import time<br>from datetime import datetime<br><br>def get_index_data(symbol, name):<br>    &quot;&quot;&quot;Fetch and display data for a given index symbol&quot;&quot;&quot;<br>    try:<br>        ticker = yf.Ticker(symbol)<br>        data = ticker.info<br>        <br>        current_price = data.get(&#39;regularMarketPrice&#39;, &#39;N/A&#39;)<br>        prev_close = data.get(&#39;regularMarketPreviousClose&#39;, &#39;N/A&#39;)<br>        <br>        if current_price != &#39;N/A&#39; and prev_close != &#39;N/A&#39;:<br>            change = round(current_price - prev_close, 2)<br>            change_percent = round((change / prev_close) * 100, 2)<br>        else:<br>            change = &#39;N/A&#39;<br>            change_percent = &#39;N/A&#39;<br>        <br>        print(f&quot;\n{name} ({symbol}):&quot;)<br>        print(f&quot;Current Price: {current_price}&quot;)<br>        print(f&quot;Previous Close: {prev_close}&quot;)<br>        print(f&quot;Change: {change} ({change_percent}%)&quot;)<br>        print(f&quot;Day&#39;s High: {data.get(&#39;dayHigh&#39;, &#39;N/A&#39;)}&quot;)<br>        print(f&quot;Day&#39;s Low: {data.get(&#39;dayLow&#39;, &#39;N/A&#39;)}&quot;)<br>        <br>        return True<br>    except Exception as e:<br>        print(f&quot;\nError fetching data for {name}: {e}&quot;)<br>        return False<br><br># Main execution<br>print(&quot;Live Nifty and Bank Nifty Data&quot;)<br>print(&quot;=&quot; * 40)<br>print(f&quot;Last updated: {datetime.now().strftime(&#39;%Y-%m-%d %H:%M:%S&#39;)}&quot;)<br><br># Get data once<br>get_index_data(&quot;^NSEI&quot;, &quot;NIFTY 50&quot;)<br>get_index_data(&quot;^NSEBANK&quot;, &quot;BANK NIFTY&quot;)<br><br># Optional: Uncomment the following lines to run in a continuous loop<br>&quot;&quot;&quot;<br>print(&quot;\nStarting live update loop (Ctrl+C to stop)...&quot;)<br>update_interval = 30  # seconds<br><br>while True:<br>    print(f&quot;\n{&#39;=&#39;*40}&quot;)<br>    print(f&quot;Update: {datetime.now().strftime(&#39;%Y-%m-%d %H:%M:%S&#39;)}&quot;)<br>    get_index_data(&quot;^NSEI&quot;, &quot;NIFTY 50&quot;)<br>    get_index_data(&quot;^NSEBANK&quot;, &quot;BANK NIFTY&quot;)<br>    print(f&quot;\nNext update in {update_interval} seconds...&quot;)<br>    time.sleep(update_interval)<br>&quot;&quot;&quot;</pre><p>The output looks like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zHT3n9ysKWuN96Q2" /></figure><p><em>The code for Fyers APIv3:</em></p><pre>from fyers_apiv3 import fyersModel<br>from fyers_apiv3.FyersWebsocket import data_ws<br>import json<br>import time<br>from datetime import datetime<br><br>class FyersTradingApp:<br>    def __init__(self, client_id, secret_key, redirect_uri):<br>        self.client_id = client_id<br>        self.secret_key = secret_key<br>        self.redirect_uri = redirect_uri<br>        self.access_token = None<br>        self.fyers = None<br>        self.data_websocket = None<br>        <br>    def generate_auth_code(self):<br>        # Create a session model with the client credentials<br>        session = fyersModel.SessionModel(<br>            client_id=self.client_id,<br>            secret_key=self.secret_key,<br>            redirect_uri=self.redirect_uri,<br>            response_type=&quot;code&quot;,<br>            grant_type=&quot;authorization_code&quot;<br>        )<br>        <br>        # Generate the auth code URL<br>        response = session.generate_authcode()<br>        print(&quot;Please visit this URL to authenticate:&quot;, response)<br>        auth_code = input(&quot;Enter the auth code from the redirect URL: &quot;)<br>        return auth_code<br>        <br>    def generate_access_token(self, auth_code):<br>        session = fyersModel.SessionModel(<br>            client_id=self.client_id,<br>            secret_key=self.secret_key,<br>            redirect_uri=self.redirect_uri,<br>            response_type=&quot;code&quot;,<br>            grant_type=&quot;authorization_code&quot;<br>        )<br>        <br>        session.set_token(auth_code)<br>        response = session.generate_token()<br>        <br>        if response[&quot;s&quot;] == &quot;ok&quot;:<br>            self.access_token = response[&quot;access_token&quot;]<br>            print(&quot;Access token generated successfully!&quot;)<br>            # Save the token to a file for future use<br>            with open(&quot;fyers_token_v3.json&quot;, &quot;w&quot;) as f:<br>                json.dump(response, f)<br>            <br>            # Initialize the FyersModel instance with the access token<br>            self.fyers = fyersModel.FyersModel(<br>                client_id=self.client_id,<br>                token=self.access_token,<br>                is_async=False,<br>                log_path=&quot;&quot;<br>            )<br>            return True<br>        else:<br>            print(&quot;Error generating access token:&quot;, response[&quot;message&quot;])<br>            return False<br>            <br>    def load_existing_token(self):<br>        try:<br>            with open(&quot;fyers_token_v3.json&quot;, &quot;r&quot;) as f:<br>                token_data = json.load(f)<br>                self.access_token = token_data[&quot;access_token&quot;]<br>                <br>                # Initialize the FyersModel instance with the access token<br>                self.fyers = fyersModel.FyersModel(<br>                    client_id=self.client_id,<br>                    token=self.access_token,<br>                    is_async=False,<br>                    log_path=&quot;&quot;<br>                )<br>                print(&quot;Loaded existing access token&quot;)<br>                return True<br>        except FileNotFoundError:<br>            print(&quot;No existing token found.&quot;)<br>            return False<br>            <br>    def get_market_data(self, symbols):<br>        if not self.fyers:<br>            print(&quot;Fyers model not initialized. Please generate access token first.&quot;)<br>            return None<br>            <br>        # Format symbols for the API call<br>        symbol_string = &quot;,&quot;.join(symbols)<br>        <br>        # Get quote data<br>        data = {<br>            &quot;symbols&quot;: symbol_string<br>        }<br>        <br>        response = self.fyers.quotes(data=data)<br>        <br>        if response[&quot;s&quot;] == &quot;ok&quot;:<br>            return response[&quot;d&quot;]<br>        else:<br>            print(&quot;Error fetching market data:&quot;, response.get(&quot;message&quot;, &quot;Unknown error&quot;))<br>            return None<br>            <br>    def format_market_data(self, data):<br>        formatted_data = []<br>        <br>        for item in data:<br>            symbol = item.get(&quot;n&quot;, &quot;N/A&quot;)<br>            v_data = item.get(&quot;v&quot;, {})<br>            <br>            # Safely extract values with defaults - using correct field names for API V3<br>            ltp = v_data.get(&quot;lp&quot;, 0)<br>            open_price = v_data.get(&quot;open_price&quot;, 0)<br>            high = v_data.get(&quot;high_price&quot;, 0)  # Changed from &quot;h&quot; to &quot;high_price&quot;<br>            low = v_data.get(&quot;low_price&quot;, 0)    # Changed from &quot;l&quot; to &quot;low_price&quot;<br>            prev_close = v_data.get(&quot;prev_close_price&quot;, 0)<br>            volume = v_data.get(&quot;volume&quot;, 0)<br>            <br>            # Calculate change and percentage<br>            if prev_close != 0:<br>                change = round(ltp - prev_close, 2)<br>                change_percent = round((change / prev_close) * 100, 2)<br>            else:<br>                change = 0<br>                change_percent = 0<br>            <br>            # Get OHLCV data<br>            ohlcv = {<br>                &quot;open&quot;: open_price,<br>                &quot;high&quot;: high,<br>                &quot;low&quot;: low,<br>                &quot;close&quot;: ltp,<br>                &quot;volume&quot;: volume<br>            }<br>            <br>            # Get depth data (market depth) with safe access<br>            depth = {<br>                &quot;ask&quot;: v_data.get(&quot;ask&quot;, 0),<br>                &quot;ask_qty&quot;: v_data.get(&quot;ask_qty&quot;, 0),<br>                &quot;bid&quot;: v_data.get(&quot;bid&quot;, 0),<br>                &quot;bid_qty&quot;: v_data.get(&quot;bid_qty&quot;, 0)<br>            }<br>            <br>            formatted_data.append({<br>                &quot;symbol&quot;: symbol,<br>                &quot;ltp&quot;: ltp,<br>                &quot;prev_close&quot;: prev_close,<br>                &quot;change&quot;: change,<br>                &quot;change_percent&quot;: change_percent,<br>                &quot;ohlcv&quot;: ohlcv,<br>                &quot;depth&quot;: depth<br>            })<br>            <br>        return formatted_data<br>        <br>    def start_websocket(self, symbols):<br>        # Create a data socket connection object<br>        self.data_websocket = data_ws.FyersDataSocket(<br>            access_token=f&quot;{self.client_id}:{self.access_token}&quot;,<br>            log_path=&quot;&quot;,<br>            litemode=True,<br>            write_to_file=False,<br>            reconnect=True,<br>            on_connect=self.on_connect,<br>            on_close=self.on_close,<br>            on_error=self.on_error,<br>            on_message=self.on_message<br>        )<br>        <br>        # Establish a connection to the Fyers WebSocket<br>        self.data_websocket.connect()<br>        <br>        # Subscribe to the symbols<br>        self.data_websocket.subscribe(symbols=symbols, data_type=&quot;symbolData&quot;)<br>        <br>        # Keep the connection alive<br>        try:<br>            while True:<br>                time.sleep(1)<br>        except KeyboardInterrupt:<br>            print(&quot;Disconnecting WebSocket...&quot;)<br>            self.data_websocket.close()<br>            <br>    def on_connect(self):<br>        print(&quot;WebSocket connected successfully&quot;)<br>        <br>    def on_close(self):<br>        print(&quot;WebSocket connection closed&quot;)<br>        <br>    def on_error(self, error):<br>        print(f&quot;WebSocket error: {error}&quot;)<br>        <br>    def on_message(self, message):<br>        # Process the incoming message<br>        if message.get(&quot;type&quot;) == &quot;symbolData&quot;:<br>            data = message.get(&quot;data&quot;, [])<br>            for item in data:<br>                symbol = item.get(&quot;symbol&quot;, &quot;N/A&quot;)<br>                ltp = item.get(&quot;lp&quot;, 0)<br>                print(f&quot;{symbol}: {ltp}&quot;)<br>                <br>    def display_market_data(self, data):<br>        print(&quot;\n&quot; + &quot;=&quot;*80)<br>        print(f&quot;Market Data - {datetime.now().strftime(&#39;%Y-%m-%d %H:%M:%S&#39;)}&quot;)<br>        print(&quot;=&quot;*80)<br>        <br>        for item in data:<br>            print(f&quot;\n{item[&#39;symbol&#39;]}:&quot;)<br>            print(f&quot;  LTP: {item[&#39;ltp&#39;]}&quot;)<br>            print(f&quot;  Previous Close: {item[&#39;prev_close&#39;]}&quot;)<br>            print(f&quot;  Change: {item[&#39;change&#39;]} ({item[&#39;change_percent&#39;]}%)&quot;)<br>            print(f&quot;  OHLC: O={item[&#39;ohlcv&#39;][&#39;open&#39;]}, H={item[&#39;ohlcv&#39;][&#39;high&#39;]}, L={item[&#39;ohlcv&#39;][&#39;low&#39;]}, C={item[&#39;ohlcv&#39;][&#39;close&#39;]}&quot;)<br>            print(f&quot;  Volume: {item[&#39;ohlcv&#39;][&#39;volume&#39;]}&quot;)<br>            print(f&quot;  Depth: Ask={item[&#39;depth&#39;][&#39;ask&#39;]}({item[&#39;depth&#39;][&#39;ask_qty&#39;]}), Bid={item[&#39;depth&#39;][&#39;bid&#39;]}({item[&#39;depth&#39;][&#39;bid_qty&#39;]})&quot;)<br>            <br>        print(&quot;\n&quot; + &quot;=&quot;*80)<br><br># Main execution<br>if __name__ == &quot;__main__&quot;:<br>    # Your Fyers credentials<br>    client_id = &quot;INSERT YOUR CLIENT ID HERE&quot;  # App ID/Client ID<br>    secret_key = &quot;INSERT YOUR SECRET KEY HERE&quot;     # Secret ID<br>    redirect_uri = &quot;https://www.google.com/&quot;  # Redirect URI you used in app creation<br>    <br>    # Create Fyers trading app instance<br>    app = FyersTradingApp(client_id, secret_key, redirect_uri)<br>    <br>    # Try to load existing token<br>    if not app.load_existing_token():<br>        # Generate new token if not found<br>        auth_code = app.generate_auth_code()<br>        if not app.generate_access_token(auth_code):<br>            exit()<br>    <br>    # Define the symbols for Nifty and Bank Nifty<br>    nifty_symbol = &quot;NSE:NIFTY50-INDEX&quot;<br>    banknifty_symbol = &quot;NSE:NIFTYBANK-INDEX&quot;<br>    symbols = [nifty_symbol, banknifty_symbol]<br>    <br>    # Get market data<br>    market_data = app.get_market_data(symbols)<br>    <br>    if market_data:<br>        formatted_data = app.format_market_data(market_data)<br>        app.display_market_data(formatted_data)<br>        <br>        # Ask user if they want to start WebSocket for real-time updates<br>        use_websocket = input(&quot;\nDo you want to start WebSocket for real-time updates? (y/n): &quot;).lower()<br>        <br>        if use_websocket == &#39;y&#39;:<br>            print(&quot;Starting WebSocket for real-time updates. Press Ctrl+C to stop.&quot;)<br>            app.start_websocket(symbols)</pre><p>The out put looks like :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zp_q4drgDNmXuCY7" /></figure><p>About myself:</p><p>Prashantt K Lal</p><p><a href="https://www.linkedin.com/in/prashanttklal/">https://www.linkedin.com/in/prashanttklal/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fb5623e2050" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>