Back to Coding

Advanced Scalping Bot

Prompt

Build an advanced scalping trading bot optimized for low timeframes such as 5-minute (M5) and 15-minute (M15) charts, focusing on fast entries and exits with the objective of consistent profitability through small price movements. The bot should: - Implement a strategy based on exploiting market inefficiencies, using clear entry and exit rules. For example, use moving averages where a buy signal triggers when the 50-period SMA crosses above the 100-period SMA, and a sell signal triggers when the 100-period SMA crosses above the 50-period SMA. - Incorporate additional technical indicators such as RSI and Bollinger Bands to refine entry and exit signals. For instance, buy when RSI is below 30 and Bollinger Bands %B is below 0; sell when RSI exceeds 70 and Bollinger Bands %B exceeds 100. - Apply rigorous risk management through stop-losses set between 2-5% below entry price, portfolio-wide maximum drawdown capped at 15%, and optionally trailing stops to lock in profits. - Employ position sizing rules limiting each trade to 1-2% of total capital to minimize risk exposure. - Include volatility filters to pause trading under extreme market conditions, such as when volatility indexes (e.g., VIX) exceed thresholds, price moves exceed 2 standard deviations, or bid-ask spreads widen substantially. - Use market and limit orders primarily for executing trades. - Ensure the algorithm is robust, readable, and free of bugs, with clearly defined entry, exit, and sizing rules. - Design for hitch-free execution requiring always-on connectivity and reliability. Step-by-step approach: 1. Define clear, rule-based entry and exit conditions based on moving averages and combined indicator signals. 2. Encode stop-loss and trailing stop mechanisms aligned with recent market volatility. 3. Implement position sizing constraints per trade and portfolio risk parameters. 4. Add volatility filters to halt trading during abnormal conditions. 5. Use appropriate order types (market and limit) to execute trades quickly and efficiently. 6. Test the bot extensively on historical data to verify strategy effectiveness and absence of bugs. 7. Prepare the system for continuous and reliable live operation. Output Format Provide a detailed trading bot algorithm description or code implementation with comments, explaining each part: strategy logic, indicator calculations, order execution logic, risk management components, and volatility handling. The output should be in a programming language or pseudocode suitable for trading bot platforms, fully executable or clearly instructive for development. Icon: "BoltIcon" Category: "programming" Tags: ["Scalping", "Trading Bot", "Algorithmic Trading", "Risk Management"] Name: "Advanced Scalping Bot" Short Description: "Develop an advanced scalping bot for M5 and M15 charts using moving averages, RSI, Bollinger Bands, and strict risk management.",

Related Coding Prompts

Write Code

As a seasoned programmer, your task is to write code in [programming language] to [perform action]. The code should be efficient, well-structured, and optimized for performance. Make sure to follow best practices and industry standards while implementing the necessary algorithms and logic to achieve the desired functionality. Test the code thoroughly to ensure it functions as intended and meets all requirements. Additionally, document the code properly for future reference and maintenance.

Debug Code

Act as a seasoned programmer with over 20 years of commercial experience. Analyze the provided [piece of code] that is causing a specific [error]. Your task involves diagnosing the root cause of the error, understanding the context and functionality intended by the code, and proposing a solution to fix the issue. Your analysis should include a step-by-step walkthrough of the code, identification of any bugs or logical mistakes, and a detailed explanation of how to resolve them. Additionally, suggest any improvements or optimizations to enhance the performance, readability, or maintainability of the code based on your extensive experience. Ensure that your solution adheres to best practices in software development and is compatible with the current development environment where the code is being executed.

Do Code Review

As a seasoned programmer with over 20 years of commercial experience, your task is to perform a comprehensive code review on the provided [piece of code]. Your review should meticulously evaluate the code's efficiency, readability, and maintainability. You are expected to identify any potential bugs, security vulnerabilities, or performance issues and suggest specific improvements or optimizations. Additionally, assess the code's adherence to industry standards and best practices. Your feedback should be constructive and detailed, offering clear explanations and recommendations for changes. Where applicable, provide examples or references to support your suggestions. Your goal is to ensure that the code not only functions as intended but also meets high standards of quality and can be easily managed and scaled in the future. This review is an opportunity to mentor and guide less experienced developers, so your insights should be both educational and actionable.