{"id":29593195,"url":"https://github.com/promptengineer48/auto-trader01","last_synced_at":"2025-07-20T06:36:33.465Z","repository":{"id":288477011,"uuid":"968247552","full_name":"PromptEngineer48/Auto-Trader01","owner":"PromptEngineer48","description":"Agentic Bot for Auto Trading Bitcoin Futures and Options","archived":false,"fork":false,"pushed_at":"2025-04-17T18:53:27.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-18T08:53:22.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PromptEngineer48.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-17T18:49:26.000Z","updated_at":"2025-04-17T18:53:30.000Z","dependencies_parsed_at":"2025-04-18T08:53:26.985Z","dependency_job_id":"055fd89f-55d5-4aec-ac13-b71ac45a67af","html_url":"https://github.com/PromptEngineer48/Auto-Trader01","commit_stats":null,"previous_names":["promptengineer48/auto-trader01"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PromptEngineer48/Auto-Trader01","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PromptEngineer48%2FAuto-Trader01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PromptEngineer48%2FAuto-Trader01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PromptEngineer48%2FAuto-Trader01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PromptEngineer48%2FAuto-Trader01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PromptEngineer48","download_url":"https://codeload.github.com/PromptEngineer48/Auto-Trader01/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PromptEngineer48%2FAuto-Trader01/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266077483,"owners_count":23872981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-20T06:36:32.674Z","updated_at":"2025-07-20T06:36:33.453Z","avatar_url":"https://github.com/PromptEngineer48.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Delta Trading System\r\n\r\nAn automated trading system for Delta Exchange that uses technical analysis to generate trading signals and execute trades with proper risk management.\r\n\r\n## Features\r\n\r\n- Automated trading signal generation\r\n- Real-time balance monitoring\r\n- Dynamic margin requirement checking\r\n- Risk management (50% balance limit)\r\n- Comprehensive logging system\r\n- Error handling and recovery\r\n\r\n## Project Structure\r\n\r\n```\r\ndelta-trading/\r\n├── src/\r\n│   ├── utils/\r\n│   │   └── wallet_balance_checker.py\r\n│   └── trading/\r\n│       ├── delta_signals.py\r\n│       ├── check_min_order.py\r\n│       └── place_order.py\r\n├── main.py\r\n├── requirements.txt\r\n└── .env\r\n```\r\n\r\n## Components\r\n\r\n### 1. Wallet Management (`src/utils/wallet_balance_checker.py`)\r\n- Tracks total and available USD balance\r\n- Handles API authentication\r\n- Provides balance information for trading decisions\r\n\r\n### 2. Trading Signals (`src/trading/delta_signals.py`)\r\n- Fetches all USD products from Delta Exchange\r\n- Generates trading signals based on price action\r\n- Returns active signals (LONG/SHORT)\r\n\r\n### 3. Margin Management (`src/trading/check_min_order.py`)\r\n- Calculates margin requirements for USD perpetual futures\r\n- Determines margin needed per lot\r\n- Provides simplified margin requirements list\r\n\r\n### 4. Order Execution (`src/trading/place_order.py`)\r\n- Handles order placement on Delta Exchange\r\n- Uses market orders for execution\r\n- Manages order responses and confirmations\r\n\r\n### 5. Main Trading System (`main.py`)\r\n- Orchestrates all components\r\n- Implements trading logic\r\n- Manages risk and balance allocation\r\n- Handles logging and error reporting\r\n\r\n## Setup\r\n\r\n1. Clone the repository:\r\n```bash\r\ngit clone \u003crepository-url\u003e\r\ncd delta-trading\r\n```\r\n\r\n2. Install dependencies:\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n3. Create a `.env` file with your Delta Exchange API credentials:\r\n```\r\nAPI_KEY=your_api_key_here\r\nAPI_SECRET=your_api_secret_here\r\n```\r\n\r\n## Configuration\r\n\r\nThe system is configured with the following default settings:\r\n- Uses 50% of total balance for trading\r\n- Fixed lot size of 1\r\n- Market orders only\r\n- USD perpetual futures only\r\n\r\n## Usage\r\n\r\nRun the trading system:\r\n```bash\r\npython main.py\r\n```\r\n\r\nThe system will:\r\n1. Check available balance\r\n2. Generate trading signals\r\n3. Verify margin requirements\r\n4. Execute trades based on signals\r\n5. Log all activities\r\n\r\n## Logging\r\n\r\nLogs are stored in daily files with the format:\r\n- `delta_trading_YYYYMMDD.log`\r\n- Includes both console and file logging\r\n- Records all balance changes and trade executions\r\n\r\n## Risk Management\r\n\r\nThe system implements several risk management features:\r\n- Maximum 50% of total balance for trading\r\n- Tracks used balance separately\r\n- Prevents negative balance situations\r\n- Validates margin requirements before trading\r\n- Fixed lot size to control position size\r\n\r\n## Error Handling\r\n\r\nComprehensive error handling includes:\r\n- API connection issues\r\n- Invalid responses\r\n- Insufficient balance\r\n- Failed orders\r\n- Network problems\r\n\r\n## Dependencies\r\n\r\n- Python 3.x\r\n- requests\r\n- python-dotenv\r\n- logging\r\n\r\n## Security\r\n\r\n- API credentials stored in `.env` file\r\n- Secure API signature generation\r\n- No hardcoded credentials\r\n- Environment variable support\r\n\r\n## Contributing\r\n\r\n1. Fork the repository\r\n2. Create a feature branch\r\n3. Commit your changes\r\n4. Push to the branch\r\n5. Create a Pull Request\r\n\r\n## License\r\n\r\nMIT License\r\n\r\n## Disclaimer\r\n\r\nThis trading system is for educational purposes only. Trading cryptocurrencies involves significant risk of loss. Use at your own risk. \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromptengineer48%2Fauto-trader01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpromptengineer48%2Fauto-trader01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpromptengineer48%2Fauto-trader01/lists"}