Skip to content

SriniArch/NeoApp

Repository files navigation

Scalper & Monitor Pro

A professional trading application for scalping and real-time PnL monitoring, built for the Neo API platform.

Features

🎯 Scalper

  • Quick Order Execution: Fast BUY/EXIT buttons for scalping strategies
  • Strike Price Controls: Easy up/down arrows to adjust strike prices
  • CE/PE Toggle: Quick switch between Call and Put options
  • Lot Size Selection: Predefined lot sizes (1, 2, 3, 5, 10)
  • Symbol History: Remembers your last 3 traded symbols
  • Auto-Login: Automatic authentication on startup
  • Scrip Master Integration: Automatic token lookup for trading symbols

📊 PnL Monitor

  • Real-time Trade Tracking: Live monitoring of completed trades
  • Comprehensive Statistics:
    • Total trades count
    • Win/Loss ratio and win rate percentage
    • Gross PnL, Net PnL, and total charges
    • Last 5 trades display
  • Color-coded Display: Green for profits, red for losses
  • Auto-refresh: Updates every 5 seconds
  • CSV Export: Automatically saves trades to daily CSV files in logs/ directory

Installation

Prerequisites

  • Python 3.11+
  • Conda/Miniforge environment manager

Setup

  1. Clone the repository

    git clone https://github.com/SriniArch/NeoApp.git
    cd NeoApp2
  2. Create and activate the environment

    conda create -n neo python=3.11
    conda activate neo
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables

    Create a .env file in the project root with your Neo API credentials:

    CONSUMER_KEY=your_consumer_key
    MOBILE=your_mobile_number
    UCC=your_ucc
    MPIN=your_mpin
    TOTP_SECRET=your_totp_secret
    NIFTY_LOT_SIZE=75
  5. Add scrip master CSV files

    Place your scrip master files in the project root:

    • nse_fo.csv - NSE Futures & Options scrip master
    • bse_fo.csv - BSE Futures & Options scrip master

Usage

Running the Application

python run.py

The application will:

  1. Auto-login using your credentials
  2. Load the scrip master data
  3. Display the Scalper & Monitor interface

Trading Workflow

  1. Select Symbol: Enter or select a trading symbol (e.g., SENSEX2610184900PE)
  2. Adjust Strike: Use ▲/▼ buttons to change strike price
  3. Choose Option Type: Toggle between CE (Call) and PE (Put)
  4. Set Lot Size: Select from dropdown (1, 2, 3, 5, 10)
  5. Execute Trade:
    • Click BUY to enter position
    • Click EXIT to close position
  6. Monitor PnL: Watch real-time statistics in the right panel

CSV Export

Completed trades are automatically saved to:

logs/trades_YYYY-MM-DD.csv

CSV includes:

  • Symbol, Date, Buy/Sell Times
  • Quantity, Buy/Sell Prices
  • Gross PnL, Charges, Net PnL

Project Structure

NeoApp2/
├── run.py                  # Main entry point
├── scalper/
│   ├── neoscalper.py      # Main UI and trading logic
│   └── ltp.py             # Live price fetching
├── monitor/
│   ├── neomonitor.py      # Standalone monitor (legacy)
│   └── pnl_engine.py      # PnL calculation engine
├── bot/
│   └── neobot.py          # Automated trading bot
├── common/
│   ├── config.py          # Configuration management
│   ├── neo_login.py       # Authentication
│   ├── orders.py          # Order execution
│   ├── scrip_master.py    # Symbol lookup
│   └── utils.py           # Utility functions
├── assets/
│   └── scalper2.png       # App icon
├── logs/                  # Log files and trade CSVs
└── .env                   # Environment variables (not in repo)

Configuration

Environment Variables

Variable Description Required
CONSUMER_KEY Neo API consumer key Yes
MOBILE Registered mobile number Yes
UCC Unique Client Code Yes
MPIN Mobile PIN Yes
TOTP_SECRET TOTP secret for 2FA Yes
NIFTY_LOT_SIZE Default lot size No (default: 75)
NSE_SCRIP_MASTER_PATH Path to NSE CSV No (default: nse_fo.csv)
BSE_SCRIP_MASTER_PATH Path to BSE CSV No (default: bse_fo.csv)

Security

⚠️ Important: Never commit your .env file or credentials to version control.

The .gitignore file is configured to exclude:

  • .env and .envrc
  • *.csv files (scrip masters)
  • Log files
  • Sensitive data

Troubleshooting

"Login validation completed but access_token is MISSING!"

This is a debug message and can be safely ignored if the Monitor displays data correctly. The Neo API client may store the token internally.

Monitor shows no data

  • Ensure you have completed at least one trade
  • Check that your API credentials are valid
  • Verify network connectivity

Symbol not found

  • Ensure scrip master CSV files are present and up-to-date
  • Check that the trading symbol format matches the scrip master

License

This project is for personal use only.

Disclaimer

This software is provided as-is for educational and personal trading purposes. Use at your own risk. The authors are not responsible for any financial losses incurred through the use of this software.


Happy Trading! 📈

About

Manual trading terminal for Kotak Neo API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages