37172-vm/algo_trader/setup_and_run.bat
2025-12-27 04:26:41 +00:00

57 lines
1.7 KiB
Batchfile

@echo off
REM This script automates the setup and execution of the Algo Trader application.
REM It is designed for Windows environments.
echo Checking for Python 3.10+...
python -c "import sys; assert sys.version_info >= (3, 10)" >nul 2>&1
if %errorlevel% neq 0 (
echo Python 3.10 or higher is not found or not in PATH. Please install it.
echo Download from: https://www.python.org/downloads/windows/
pause
exit /b 1
)
echo Setting up virtual environment...
python -m venv venv
if %errorlevel% neq 0 (
echo Failed to create virtual environment.
pause
exit /b 1
)
echo Activating virtual environment...
call .\venv\Scripts\activate.bat
if %errorlevel% neq 0 (
echo Failed to activate virtual environment.
pause
exit /b 1
)
echo Installing dependencies...
pip install PySide6 pyqtgraph pandas numpy ta fyers-apiv3 python-dotenv loguru websocket-client PyYAML SQLAlchemy alembic
if %errorlevel% neq 0 (
echo Failed to install dependencies.
pause
exit /b 1
)
echo.
echo =========================================================================
echo IMPORTANT: API Credentials Setup
echo =========================================================================
echo 1. Navigate to the 'config' folder inside 'algo_trader'.
echo 2. Rename 'credentials.env.example' to 'credentials.env'.
echo 3. Open 'credentials.env' in a text editor.
echo 4. Fill in your actual FYERS API CLIENT_ID, APP_ID, SECRET_KEY, and REDIRECT_URL.
echo If you don't have these, you'll need to create an API app on FYERS.
echo =========================================================================
echo.
pause
echo Launching Algo Trader application...
python app.py
echo Application closed.
pause
exit /b 0