Back to Learning

Coding

814 prompts available

Ag Grid Metadata Parser

You are to develop a .NET Core component that parses metadata for the AG Grid server-side row model. This parser will interpret the metadata structure passed from the AG Grid client to the server, correctly extracting parameters such as group keys, filter states, sort states, and any other relevant data needed for server-side data operations. The parser should be robust and capable of handling various metadata inputs representing grouping, filtering, sorting, and pagination details according to the AG Grid server-side model specification. It should provide a clean, structured representation of this metadata suitable for backend processing. # Requirements - Accept metadata input typically sent by AG Grid with server-side row models. - Parse and extract information including but not limited to: - Row group keys - Filter conditions - Sort orders - Pagination information if applicable - Structure the output as strongly typed .NET classes or data transfer objects. - Ensure extensibility for additional metadata keys in the future. - Handle possible missing or malformed metadata gracefully. # Steps 1. Review AG Grid server-side model metadata format. 2. Design .NET data structures that represent the metadata cleanly. 3. Implement the parsing logic with appropriate error handling. 4. Provide methods to output the parsed metadata for further use. 5. Include unit tests to verify parsing correctness for various metadata scenarios. # Output Format Provide the complete C# code for the parser component, including data classes, parsing methods, and example usage demonstrating how to feed AG Grid metadata and retrieve structured parsed output. # Notes - Emphasize code readability and maintainability. - Consider common AG Grid configurations regarding grouping and filtering. - Use standard .NET Core packages; do not rely on external dependencies unless justified.

Aggressive Gold Trading Bot

Design an aggressive trading bot in MQL5 for trading Gold (XAUUSD) that achieves a high win rate by capitalizing on short-term price movements using scalping and breakout strategies. Focus on incorporating technical indicators such as Moving Averages, RSI, and MACD to generate precise entry and exit signals. Implement advanced risk management techniques to minimize losses and maximize profits, adapting dynamically to changing market volatility through position sizing and trade adjustments. Follow these steps: 1. Conduct market analysis to identify key support and resistance levels for XAUUSD. 2. Define explicit entry and exit rules based on indicator signals. 3. Determine optimal position sizing factoring in account equity and risk tolerance. 4. Backtest the bot extensively using historical data, refine it to improve the win rate. 5. Set up real-time monitoring and alerts to track trade performance and adjust strategies as required. Output the complete MQL5 bot code with detailed comments explaining each function and logic block. Additionally, provide a comprehensive summary of the trading strategy highlighting backtesting performance metrics such as number of trades, win rate, and overall profitability. Ensure compliance with MetaTrader platform guidelines and account for slippage and spread effects during aggressive trading in the profitability calculations. The code should be modular and allow easy future adjustments for diverse market conditions. # Output Format - Full MQL5 source code with thorough inline comments. - Trading strategy summary report including backtest results and key performance statistics. # Examples ```mql5 int OnInit() { // Initialize indicators and variables } void OnTick() { // Implement trade logic based on indicators } double CalculateRisk() { // Return optimal lot size based on risk management } ``` Summary: "The bot executed [X] trades achieving a win rate of [Y]% and a profit of [$Z] over [timeframe] of backtesting."

AG Grid Vue 3 Integration

Create a detailed step-by-step guide and code examples for developing a project that demonstrates integrating AG Grid with Vue 3 using the Composition API, including state management with Pinia, TypeScript for type safety, TailwindCSS for styling, and Faker.js to generate mock data. The response should cover: - Setting up the Vue 3 project with TypeScript support. - Installing and configuring AG Grid for Vue 3. - Using the Composition API to create and manage the grid component. - Integrating Pinia to manage grid state such as sorting, filtering, or selected rows. - Employing TailwindCSS to style the grid and surrounding UI consistently. - Generating realistic mock data using Faker.js to populate the grid. Include code snippets demonstrating each major integration and configuration step, focusing on how these libraries work together in the same project environment. # Steps 1. Initialize a Vue 3 project with TypeScript using Vite or Vue CLI. 2. Install AG Grid Vue 3, Pinia, TailwindCSS, and Faker.js via npm. 3. Configure TailwindCSS in the project. 4. Set up Pinia as the state management solution. 5. Create a grid component that uses the Composition API to define reactive data and methods. 6. Use Faker.js within the grid component or Pinia store to generate and manage mock data. 7. Style the grid and UI components with TailwindCSS classes. 8. Demonstrate grid features such as sorting, filtering, and row selection managed via Pinia. # Output Format Provide a structured tutorial with numbered steps followed by code blocks where applicable. Use comments within code samples for clarity. End with a summary of how the integration benefits the development workflow and user experience. # Examples ```typescript // Example: Defining Reactive Grid Data with Faker.js and the Composition API import { ref } from 'vue'; import { faker } from '@faker-js/faker'; export function useGridData() { const rowData = ref( Array.from({ length: 100 }, () => ({ id: faker.datatype.uuid(), name: faker.name.fullName(), email: faker.internet.email(), age: faker.datatype.number({ min: 18, max: 80 }), })) ); return { rowData }; } ``` # Notes - Emphasize the composition of these technologies promoting scalable and maintainable code. - Ensure TypeScript types are properly declared for AG Grid and state management. - Highlight TailwindCSS utility classes for quick and responsive design. - Faker.js data can be regenerated on demand for testing different grid states. - Pinia store can synchronize grid state with other application parts if needed.

Aggressive Gold Trading Bot MQL4

Design a trading bot in MQL4 that aggressively trades Gold (XAUUSD) while maintaining a high win rate by capitalizing on short-term price movements using scalping and breakout strategies. The bot should: - Incorporate technical indicators such as Moving Averages, RSI, and MACD to generate precise entry and exit signals. - Implement advanced risk management techniques to minimize losses and maximize profit potential amid volatility. - Adapt dynamically to varying market conditions through position sizing and trade adjustments based on current market volatility. Follow these detailed steps: 1. **Market Analysis:** Identify and code detection of key support and resistance levels for XAUUSD. 2. **Define Entry/Exit Rules:** Specify clear, indicator-based criteria for opening and closing positions using scalping and breakout signals. 3. **Position Sizing:** Program dynamic lot sizing based on account equity and predefined risk tolerance parameters. 4. **Backtesting:** Use historical price data to rigorously test the bot's performance, iteratively refining logic to improve the win rate. 5. **Monitoring and Alerts:** Implement real-time monitoring and alerts to track trade performance and allow for strategy adjustments when necessary. Ensure compliance with MetaTrader platform standards, factoring in spread and slippage effects inherent in aggressive trading environments. # Output Format - Provide the full MQL4 bot code with detailed comments explaining each function and logic block. - Include a comprehensive summary of the trading strategy, detailing backtest performance metrics such as the number of trades executed, win rate percentage, net profit, and duration covered by the historical data. # Example Structure ```mql4 int OnInit() { /* Initialize indicators and variables */ return(INIT_SUCCEEDED); } void OnTick() { /* Execute trading logic based on indicator signals and market conditions */ } double CalculateRisk() { /* Compute risk per trade dynamically */ return riskValue; } ``` Summary example: "The bot executed 100 trades with a win rate of 70%, achieving an overall profit of $X over 3 months of backtested data." # Important Notes - Ensure adaptability to various market volatility scenarios through dynamic trade management. - Account for real trading nuances such as spread and slippage when calculating profitability. - Maintain code clarity and modularity to facilitate easy adjustment for diverse trading environments.

Agar.io Clone Single File

Create a single HTML file that contains the absolute best implementation of an agar.io clone game. Ensure the following to maximize quality: - The game should be fully functional with smooth, responsive controls. - Implement all core gameplay mechanics, such as cell movement, splitting, merging, and consuming pellets or smaller cells. - Optimize performance for running efficiently in a browser without external dependencies. - Include visually appealing graphics and animations using canvas or similar technologies. - The game should handle multiplayer functionality either via AI opponents or simulated players if real networking is not feasible within one file. - Make the code well-structured, clean, and self-contained within the single HTML file. # Steps 1. Set up the HTML structure with a canvas for rendering. 2. Implement the core game loop with smooth rendering and updates. 3. Code player controls to move and split the cells. 4. Generate pellets and AI-controlled cells or bots. 5. Manage cell collisions and consumption logic. 6. Include visual effects and UI elements for score and player state. 7. Optimize code to be performant and concise. # Output Format Provide the complete HTML markup as a single file that can be saved and opened directly in a modern web browser to play the agar.io clone. # Notes - Avoid dependencies on external libraries or assets. - Focus on creating an engaging, playable experience within the single file constraint. - The solution should be compatible with common browsers and execute without errors. # Response Formats Only provide the complete HTML file content as your response.

Aggressive HFT Bot MT5

You are to generate a fully automated aggressive high-frequency trading (HFT) bot tailored for MetaTrader 5 (MT5). The bot must leverage the RSI (Relative Strength Index), MACD (Moving Average Convergence Divergence), and multiple moving averages indicators in combination to detect trade entry and exit points. Implement advanced dynamic risk management that adjusts position sizing and stop-loss/take-profit levels in real-time based on market volatility, recent trade performance, and account equity. The bot should prioritize speed and accuracy for high-frequency trading, including optimized order execution logic and latency-aware design. Code must be clean, modular, and well-commented in MQL5 language, with clearly defined parameters for indicator settings, risk tolerance, and trade frequency. Please reason step-by-step about the integration of the indicators, risk management strategies, and trade execution logic before producing the final complete MQL5 source code. Address potential edge cases such as signal conflicts, market gaps, and slippage. # Requirements: - Use RSI, MACD, and moving averages combined for entry/exit signals. - Implement dynamic risk management adapting to market conditions. - Optimize for aggressive high-frequency trading. - Fully automated, no manual inputs once running. - Clear comments explaining logic and parameters. # Steps: 1. Describe the design approach and how indicators will be combined. 2. Explain the dynamic risk management methodology. 3. Detail trade execution logic ensuring speed and reliability. 4. Provide the full MQL5 code implementing the bot. # Output Format: Deliver a detailed explanation followed by the comprehensive, executable MQL5 source code enclosed within markdown code blocks labeled "mql5". Use inline comments within the code for clarity. # Notes: - Assume the user has basic MT5 setup but requires a turnkey automated HFT solution. - Ensure the bot gracefully handles trading session boundaries and errors. - Prioritize realistic and robust algorithm design over overly simplistic implementations.

Age-based Ticket Pricing

Create a series of conditional statements to determine and print the cost of a movie theater ticket based on an age variable. The conditions are: - **Children under 4 years old**: "Free" - **Children between 4 and 12 years old** (inclusive): "$5" - **Teenagers between 13 and 19 years old** (inclusive), and **senior citizens** aged 65 and above: "$10" - **Adults between 20 and 64 years old** (inclusive): "$15" For each specified age, the output format should include the age followed by the corresponding ticket cost. Maintain correct capitalization, as different cases will be interpreted differently by the computer. # Steps 1. Define a variable `age` for each test case. 2. Use conditional statements (if-else) to check the age against specified conditions. 3. Print the age followed by the corresponding cost based on age. 4. Repeat for all test cases. # Output Format The output should be in the following format: ``` Age: [age_value] [cost] ``` Where `[age_value]` is the age being tested and `[cost]` is the corresponding ticket price as specified in the conditions. # Examples 1. Input: `age = 1` Output: ``` Age: 1 Free ``` 2. Input: `age = 12` Output: ``` Age: 12 $5 ``` 3. Input: `age = 15` Output: ``` Age: 15 $10 ``` Repeat this pattern for each age indicated: 1, 3, 4, 12, 13, 19, 20, 50, 65, and 80. # Notes - Ensure that each condition properly uses logical operators to capture the correct age range. - Remember that capitalization matters when outputting text. - Use clear and efficient conditional logic to minimize code redundancy.

Aggressive HFT MT5 Bot

Create a highly automated, aggressive high-frequency trading bot for the MetaTrader 5 (MT5) platform using MQL5. The bot must rapidly execute trades to maximize short-term profits by using technical indicators—specifically RSI, MACD, and moving averages—to identify precise automatic entry and exit points. The bot should implement dynamic, real-time risk management features, including automatic trailing stops, automatic exits minimizing losses or securing profits, and adaptive take profit levels that adjust according to market volatility. It must support customizable input parameters that control aggressiveness, risk tolerance, position sizing, and indicator thresholds. Include an optional Martingale strategy toggle, daily profit and loss targets for manual inputs, but explicitly exclude any grid system trading or hedging; only support live, real scalping with aggressive profit targeting. The bot must continuously monitor market data to identify every trading opportunity and adjust open positions dynamically. # Steps 1. Define an aggressive trading strategy leveraging RSI, MACD, and moving averages optimized for high-frequency scalping. 2. Develop the MQL5 code structure that implements this strategy, calculating technical indicators and executing trades accordingly. 3. Integrate advanced risk management features: dynamic auto exit rules, trailing stop-loss orders, and position sizing adaptive to current volatility. 4. Thoroughly test the bot in MT5's strategy tester across varied market scenarios to ensure reliable performance and stability. 5. Optimize input parameters to balance between aggressive trading behavior and controlling drawdowns. # Output Format Provide the full MQL5 source code for the trading bot, thoroughly commented. Comments must clearly explain the logic behind each part: how the indicators (RSI, MACD, moving averages) are used; how entry and exit signals are generated; the risk management approaches including trailing stops and adaptive take profit; and the parameter configurations. Additionally, supply a detailed summary document describing: - The overall trading strategy and its rationale, - How each technical indicator contributes to decision making, - The mechanics of risk management implemented, - Instructions to adjust parameters for tuning aggressiveness and risk tolerance, - How optional features like Martingale and daily profit/loss targets work and how to enable them. # Notes Ensure compliance with MetaTrader 5 platform standards including trade execution protections. Prioritize ultra-fast trade responsiveness to market changes while applying risk controls consistent with an aggressive scalping strategy. Avoid grid and hedging methods. The bot must be suitable for live trading with a focus on maximizing short-term profit potential while limiting excessive losses through automated safeguards.

Age Calculator App Plan

Create a detailed and clear plan to build an age calculator app. Include the following details: 1. Define the purpose of the age calculator app (e.g., calculate a person's exact age in years, months, days). 2. Specify the input requirements from the user (e.g., date of birth in a specific format). 3. List the key functionalities (e.g., validate input, compute age accurately considering leap years, display output clearly). 4. Suggest an appropriate technology stack or programming language for building the app. 5. Provide a basic outline of the app's user interface and user experience. 6. Describe how to test the app to ensure accuracy and reliability. # Steps - Understand the exact features and requirements of the age calculator. - Gather user input correctly and validate it. - Implement the logic to calculate the difference between the current date and the input date. - Handle edge cases like leap years and invalid inputs. - Design a simple UI that clearly shows the resulting age. - Test extensively under varying input scenarios. # Output Format Provide a structured plan/documentation including all the points above in clear sections with bullet points or numbered lists for easy readability.

Aggressive M1 Price Action EA

Develop an Expert Advisor (EA) logic for MetaTrader 5 (MT5) that aggressively grows a cent account from an initial balance of 100 CNT to 10,000 CNT by trading on the 1-minute (M1) chart using price action analysis. The EA should use small take profit targets per trade to minimize risk while ensuring cumulative profits meet the growth objective. It must handle broker and symbol specifics for Market4You and GOLDi on a cent account format. Include risk management and position sizing that efficiently contributes to reaching the profit target. Detail the following aspects: - How to identify price action signals on the M1 timeframe for trade entries and exits. - Risk management techniques tailored for tight take profits with aggressive growth. - Trade entry and exit criteria including order types, stop loss, and take profit configuration. - How to automatically display or report the current account balance/equity and the percentage of the profit target achieved during runtime. Provide a structured plan or a sample MT5 EA code snippet illustrating the core trading logic, money management, and live reporting, with clear comments explaining each section and choice. # Steps 1. Define price action signals suitable for the M1 timeframe (e.g., pin bars, engulfing candles, inside bars) and outline how the EA will detect them programmatically. 2. Design a small fixed or dynamic take profit based on recent price range or volatility. 3. Implement position sizing calculation based on current balance, desired risk per trade, and small profit targets. 4. Develop entry rules triggered by confirmed price action signals. 5. Set stop loss close to entry to minimize loss; set take profit to a small, achievable target. 6. Track cumulative profits and compare to the 10,000 CNT goal. 7. Include real-time display or logging of current balance/equity and progress towards profit target. # Output Format Present: - A concise, commented MT5 EA code snippet (in MQL5) demonstrating the above logic, OR - A structured outline or pseudocode clarifying how each component functions and interacts. Use clear, professional language and maintain focus on the aggressive growth objective, price action analysis, risk control, and reporting features. # Notes - Emphasize that the strategy focuses on frequent trades with small profits. - Adapt risk and lot size dynamically as the account balance grows. - Ensure broker-specific requirements and cent account considerations are addressed.

Age Calculator HTML

Create HTML code for an age calculator. The calculator should allow a user to input a date of birth and then display the calculated age in years, months, and days. # Steps 1. **HTML Structure**: Design the form to capture the user's input, specifically the date of birth. - Use appropriate input types for capturing the date. - Include a submit button to trigger the calculation. 2. **JavaScript Logic**: Implement the date computation. - On submission, read the input value. - Calculate the age by comparing the current date to the date of birth. - Break down the resulting age into years, months, and days. 3. **Display the Result**: Show the computed age back to the user. - Ensure the result is presented in a clear and readable format below the input form. # Output Format - Provide an HTML file structure with inline JavaScript that functions correctly as a standalone webpage. - Ensure functionality is self-contained with no external dependencies. # Example ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Age Calculator</title> <style> body { font-family: Arial, sans-serif; } .container { max-width: 300px; margin: auto; text-align: center; padding: 50px; } </style> </head> <body> <div class="container"> <h1>Calculate Your Age</h1> <form id="age-form"> <label for="dob">Enter your date of birth:</label><br><br> <input type="date" id="dob" name="dob"><br><br> <input type="button" value="Calculate Age" onclick="calculateAge()"> </form> <h2 id="result"></h2> </div> <script> function calculateAge() { var dob = document.getElementById('dob').value; if(!dob) { document.getElementById('result').innerText = "Please enter your date of birth."; return; } var dobDate = new Date(dob); var today = new Date(); var age = today.getFullYear() - dobDate.getFullYear(); var monthDiff = today.getMonth() - dobDate.getMonth(); if (monthDiff < 0 || (monthDiff === 0 && today.getDate() < dobDate.getDate())) { age--; } var yearDiff = age; // Calculate months var months = monthDiff < 0 ? 12 + monthDiff : monthDiff; if (today.getDate() < dobDate.getDate()) { months--; } // Calculate days var days = today.getDate() >= dobDate.getDate() ? today.getDate() - dobDate.getDate() : new Date(today.getFullYear(), today.getMonth(), 0).getDate() - dobDate.getDate() + today.getDate(); document.getElementById('result').innerText = `You are ${yearDiff} years, ${months} months, and ${days} days old.`; } </script> </body> </html> ```

Age Calculator Project

Create a complete Age Calculator web application using HTML, CSS, and JavaScript. Your application should have a user-friendly interface where users can input their birth date (day, month, and year). Upon submission, the app will calculate and display the exact age in years, months, and days from the birth date to the current date. Ensure the interface is clean and responsive with appropriate styling. Handle edge cases such as invalid dates and future birth dates by providing clear error messages. # Steps - Design an HTML form to input day, month, and year. - Style the form and output area using CSS to create an attractive, clear layout. - Use JavaScript to: - Validate the input date fields. - Calculate the age by comparing the input birth date to the current date. - Update the page dynamically with the calculated age or error messages. # Output Format Provide the full code including HTML, CSS, and JavaScript either within a single HTML file using embedded CSS and JS, or as separate files with clear indications. Include comments in the code to explain key parts. # Examples Input: - Birth Date: 15, 8, 1990 Output: - Age: 33 years, 10 months, 21 days (example, depending on current date) # Notes - Assume the current date is the system's current date from JavaScript. - Ensure accessibility and responsive design for different screen sizes. - Provide clear user feedback for invalid inputs or future dates.

Page 59 of 68

    Coding Prompts - Learning AI Prompts | Elevato