Python-Powered Profits: Tracking Trading Day Winners and Losers.

Getting day gainers and losers data for trading.


One of the traders everyday activities is catching the stocks trends and using statistics on day gainers and loosers you can deside to join the common market trend or on contrary to guess backward market direction. In our case we will use Python to access trading statistics from Mboum Finance Official API which provides stocks day gainers and losers data.

Trading day gainers and losers.
Trading gainers and losers meme.

Python Knowledge Base: Make coding great again.
- Updated: 2024-12-20 by Andrey BRATUS, Senior Data Analyst.




    To use necessary API you need to get "your-api-key" directly from Mboum Finance, or using rapidapi.com, the way I recommend. Output data is in JSON format which can be easily converted to any suitable form for further visualisation and analysis, stocks day gainers/losers are stocks ordered in descending/ascending order by price percent delta.



  1. Python code to get trading day gainers:


  2. Day gainers are simply stocks ordered in descending order by price percent change with respect to the previous close.


    
    import requests
    
    url = "https://mboum-finance.p.rapidapi.com/co/collections/day_gainers"
    
    querystring = {"start":"0"}
    
    headers = {
    "X-RapidAPI-Key": "your-api-key",
    "X-RapidAPI-Host": "mboum-finance.p.rapidapi.com"
    }
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

  3. Trading day gainers output (shown partly):


  4. trading day gainers.



  5. Python code to get trading day losers:


  6. Day losers are simply stocks ordered in ascending order by price percent change with respect to the previous close.


    
    import requests
    
    url = "https://mboum-finance.p.rapidapi.com/co/collections/day_losers"
    
    querystring = {"start":"0"}
    
    headers = {
    "X-RapidAPI-Key": "your-api-key",
    "X-RapidAPI-Host": "mboum-finance.p.rapidapi.com"
    }
    
    response = requests.request("GET", url, headers=headers, params=querystring)
    
    print(response.text)
    

  7. Trading day losers output (shown partly):


  8. trading day losers.





See also related topics: