Back to Learning

Coding

814 prompts available

Aggressive XAUUSD Scalper

Create an extremely aggressive scalper trading robot (Expert Advisor) exclusively for the XAUUSD (Gold) symbol on the M1 (1-minute) timeframe using the MQL5 programming language for the MetaTrader 5 platform. The scalper must execute very fast and frequent trades, aiming to capture small price movements swiftly. Key requirements: - Use only MQL5. - Target the XAUUSD symbol on M1 timeframe. - Employ highly aggressive scalping logic focused on rapid trade entries and exits. - Incorporate risk management features including appropriate stop loss and take profit settings optimized for scalping. - Optimize for low-latency execution and minimal drawdown. - The code must be well-structured and thoroughly commented for ease of future modification. # Steps 1. Initialize the Expert Advisor with configurable inputs such as lot size, stop loss, take profit, trailing stop loss, and any other relevant parameters. 2. Develop a fast and responsive signal generation logic using suitable indicators or price action rules tailored for aggressive scalping. 3. Implement robust order management functions to efficiently handle quick position opening and closing. 4. Include safety measures to prevent overtrading and excessive risk exposure. 5. Ensure the code includes necessary checks for symbol and timeframe to operate strictly on XAUUSD M1. 6. Test and fine-tune parameters to maximize profitability and minimize drawdown in an M1 XAUUSD environment. # Output Format Provide the full MQL5 source code (*.mq5 file) of the Expert Advisor including all setup, indicator calculations, trade logic, risk management, and order-handling functions. The code must be complete, ready to compile and deploy on MetaTrader 5 without need for further alterations, and include detailed comments explaining its logic and usage.

Aggressive XAUUSD Scalper EA

Create an extremely aggressive scalper trading robot (Expert Advisor) written exclusively in MQL5 for the MetaTrader 5 platform. This EA must trade only the XAUUSD symbol on the M1 (1-minute) timeframe. The bot should execute very fast and frequent trades aimed at capturing small price movements quickly and efficiently. Key features and requirements: - Use solely MQL5 language and standard libraries. - Operate strictly on the XAUUSD symbol at the M1 timeframe; incorporate safeguards verifying symbol and timeframe at initialization. - Implement highly aggressive scalping logic focusing on rapid entries and exits that respond swiftly to minor price changes. - Integrate risk management controls including configurable stop loss, take profit, trailing stop, and lot size optimized for scalping. - Optimize for low latency and minimal drawdown; include mechanisms to prevent overtrading and control risk exposure. - Structure the code cleanly with modular functions and comprehensive comments throughout explaining functionality and logic for easy future adaptation. # Steps 1. Define and initialize configurable input parameters such as lot size, stop loss in points, take profit in points, trailing stop, and any scalping-specific variables. 2. Create fast and responsive signal generation logic using suitable MQL5 indicators or price action algorithms tailored for aggressive scalping on 1-minute gold data. 3. Develop robust order management routines to open and close positions instantly as signals trigger, handling order exceptions and errors gracefully. 4. Implement safety mechanisms like maximum open trades limit, trading time restrictions, or maximum daily loss to minimize risk. 5. Include verification checks at EA start to ensure symbol is XAUUSD and timeframe is M1; if not, disable trading functions and notify the user. 6. Thoroughly comment all sections of the code detailing the purpose of variables, methods, trading logic, and risk controls. # Output Format Provide the fully functional MQL5 source code of the Expert Advisor ready to be saved as a *.mq5 file. The code must be complete with setup, indicator calculations, trade entry and exit logic, risk management, order handling, and validation checks. It should compile without errors and be deployable immediately on MetaTrader 5. Include detailed inline comments explaining each part of the implementation for straightforward future modification and understanding.

Aggressive XAUUSD Scalper MQL5

Create an extremely aggressive scalper trading robot (Expert Advisor) for the XAUUSD (Gold) symbol on the M1 (1-minute) timeframe using MQL5 programming language. The scalper should be designed for very fast and frequent trades to capture small price movements. Requirements: - Use only the MQL5 language for MetaTrader 5 platform. - Operate on the XAUUSD symbol exclusively. - Use the M1 timeframe. - Implement highly aggressive scalping logic focusing on rapid trade entries and exits. - Include risk management features like stop loss and take profit suitable for scalping. - Optimize for low-latency execution and minimal drawdown. - The code should be well-commented and structured for easy modification. # Steps 1. Initialize the Expert Advisor with required inputs (lot size, stop loss, take profit, trailing stop, etc). 2. Develop a signal generation method based on fast indicators or price action suited for scalping. 3. Implement order management functions to handle quick opening and closing of positions. 4. Include safety checks to avoid overtrading and excessive risk. 5. Test and optimize parameters to maximize profitability on M1 XAUUSD chart. # Output Format Provide the complete MQL5 source code of the Expert Advisor (.mq5) file, including all necessary functions and comments. The code should be ready to compile and deploy in MetaTrader 5 without further modification.

Aggressive XAUUSD Trading Bot

Design a trading bot in MQL4 that aggressively trades Gold (XAUUSD) while maintaining a high win rate. Consider various trading strategies and risk management techniques to optimize performance. ### Additional Details - Focus on aggressive trading strategies that capitalize on short-term price movements, including scalping and breakout methods. - Incorporate technical indicators (e.g., Moving Averages, RSI, MACD) to signal entry and exit points. - Implement advanced risk management settings to minimize losses while maximizing profit potential in volatile conditions. - Ensure the bot can adapt to different market conditions by using dynamic positioning and trade adjustments based on market volatility. ### Steps 1. **Market Analysis:** Identify key support and resistance levels for XAUUSD. 2. **Define Entry/Exit Rules:** Establish clear criteria for entering and exiting trades based on technical indicators. 3. **Position Sizing:** Determine optimal lot sizing techniques that account for account equity and risk tolerance. 4. **Backtesting:** Use historical data to test the bot’s performance and iterate based on results to improve win rate. 5. **Monitoring:** Set up real-time monitoring and alerts for trade performance and adjust strategies as necessary. ### Output Format - Provide the bot code as MQL4, including comments describing each function. - Create a summary of the trading strategy with performance metrics from backtesting results. ### Examples - A basic structure for the bot code including key functions: ``` int OnInit() { /* Initialization code */ } void OnTick() { /* Trading logic code */ } double CalculateRisk() { /* Risk management code */ } ``` - A summary statement: "The bot executed 100 trades with a win rate of 70%, achieving an overall profit of $X over 3 months of backtested data." ### Notes - Ensure the bot is compliant with MetaTrader platform guidelines and can be easily adjusted for different trading scenarios. - Consider potential slippage and spread in aggressive trading conditions when calculating profitability.

Agile E-commerce Builder

Create a simple yet functional e-commerce website with a database integration using HTML, CSS, and JavaScript. Implement the project using Agile Feature-Driven Development (FDD) methodology focusing on iterative feature delivery. Avoid creating excessive documentation; instead, prioritize code clarity and modularity. Incorporate a basic database simulation (such as using localStorage or an in-memory structure) to manage products, users, and orders. # Requirements - Build the e-commerce frontend with HTML and CSS for layout and styling. - Use JavaScript to handle dynamic interactions, product listings, user cart management, and order processing. - Simulate database functionality internally (e.g., with localStorage or a JS object) to store product data, user sessions, and orders. - Follow FDD by delivering discrete features like product listing, shopping cart, checkout, and order history in separate incremental steps. - Keep code organized, readable, and modular to reflect agile incremental feature development. - Avoid verbose comments or extensive documentation; focus on self-explanatory code and concise inline comments only where necessary. # Suggested Steps 1. Design the basic product listing page with sample products stored in the simulated database. 2. Implement a shopping cart allowing users to add, remove, and view items. 3. Create a checkout process that collects user information and processes the order. 4. Add order history feature to view previous orders. 5. Iterate features by refining functionality and UI. # Output Format Provide fully functional and self-contained HTML, CSS, and JavaScript code files that demonstrate the e-commerce site with all required features and internal database simulation. Ensure code is modular and sufficiently commented for clarity but without excessive documentation. # Notes - Use best practices for code structure and maintainability aligned with Agile FDD. - No external backend or database server is required; use client-side solutions only. - Keep UI simple but user-friendly and intuitive.

Agora Meeting Setup

Create a setup for Agora Video Meetings using Django Rest Framework and Next.js version 15.0.3. Implement routing in the Next.js application by defining the `page.tsx`, `layout.tsx`, and `middleware.ts` files. Utilize a `Navbar.tsx` component for navigation within your main app core. The app should be named `liveclass`. Provide secure methods to handle sensitive information such as the AGORA_APP_ID and AGORA_APP_CERTIFICATE, ensuring they are not exposed in the front-end code. # Steps 1. **Initial Setup**: - Set up a new Next.js project using version 15.0.3. - Integrate Django Rest Framework as the backend for handling video meeting functionalities. 2. **Agora Integration**: - Securely store Agora credentials (AGORA_APP_ID and AGORA_APP_CERTIFICATE) using environment variables. - Implement Agora SDK within the frontend to enable video meetings. 3. **Routing and Navigation**: - Create a `page.tsx` to handle different routes in the Next.js app. - Use `layout.tsx` to manage shared layouts across pages. - Implement `middleware.ts` to handle authentication and other request-based logic. - Develop a `Navbar.tsx` component for consistent navigation across the app. 4. **Testing and Deployment**: - Test the video meeting functionalities thoroughly. - Deploy the setup ensuring secure handling of environment variables and credentials. # Output Format Provide a structured explanation or code snippets for setting up and implementing these requirements. Highlight the key sections of code and any crucial configurations needed for effective integration. # Examples - Initialize a Next.js app project and demonstrate where and how to include the `Navbar.tsx`. - Show sample code snippets for `page.tsx`, `layout.tsx`, and `middleware.ts` with explanations. # Notes - Ensure no sensitive information like AGORA_APP_ID or AGORA_APP_CERTIFICATE is exposed in the client-side code. Use `.env` files and server-side processing wherever possible.

Agora Meetings App

Develop an Agora Video Meetings application using Django Rest Framework and Next.js version 15.0.3 with specific routing and middleware configurations. The application should facilitate the following roles: - **Admin**: Capability to create meetings. - **Teacher**: Participation in meetings. - **Student**: Participation in meetings. Implement the following core components: - **page.tsx**: This should handle the main layout and UI for the video conferences, ensuring seamless integration with Agora's SDK. - **layout.tsx**: Manage the arrangement and common components for the application layout, such as headers, footers, and sidebars. - **middleware.ts**: Implement custom middleware to handle authentication and authorization processes, ensuring users are who they claim to be and have the proper permissions. # Steps 1. **Set Up Django Rest Framework**: - Create APIs for meeting creation, retrieving meeting details, and managing user roles. - Establish models for meetings, users, and roles. 2. **Configure Next.js**: - Implement routing as needed with version 15.0.3 features. - Use `page.tsx` for UI arrangements specific to each page. - Use `layout.tsx` to create a consistent look and feel around Agora meetings. 3. **Middleware Development**: - Use `middleware.ts` to manage request validation and user authorization. 4. **Integrate Agora SDK**: - Set up OAuth and authentication processes. - Incorporate Agora's functionalities for video calls. 5. **Test and Deploy**: - Ensure all components work together seamlessly on both local and production environments. # Output Format Provide the full repository development progress as documentation. Include: - A brief description of each core component and its purpose. - Example configurations and code snippets for `page.tsx`, `layout.tsx`, and `middleware.ts`. - Instructions on how to set up the development environment and any dependencies. # Examples - **Meeting Creation**: Admin creates a meeting using a provided endpoint or through a dashboard. - **User Authentication**: Middleware is used to validate user credentials before joining a meeting. # Notes - Focus on security and data integrity when setting up middleware and API endpoints. - Ensure high performance and low latency in video streams by optimizing the integration with Agora services.

Agora Video Meetings

Develop a video meeting application using Agora.io with Django Rest Framework as the backend and Next.js version 15.0.3 as the frontend. Implement routing using page.tsx, layout.tsx, and middleware.ts for the application structure, and include a Navbar.tsx component. ## Steps 1. **Backend Setup**: - Set up a Django Rest Framework project with necessary models, views, and endpoints to handle video meeting data. - Integrate Agora SDK for managing video calls and sessions. - Ensure the backend is properly configured to handle authentication and data flow. 2. **Frontend Setup**: - Initialize a Next.js application using version 15.0.3. - Create a consistent layout using layout.tsx and page.tsx for page rendering and smooth navigation. - Implement middleware.ts for handling request logic such as authentication checks or data preprocessing. 3. **Routing Fundamentals**: - Use Next.js routing fundamentals to manage different pages such as login, meeting room, and dashboard. - Ensure the routing integrates seamlessly with the state management and user authentication flow. 4. **UI Component - Navbar**: - Develop a Navbar component in Navbar.tsx that allows navigation between application sections. - Ensure it maintains consistent design and is responsive for various device sizes. ## Output Format Provide detailed, step-by-step explanations for each implementation phase described, along with code snippets where applicable. ## Examples - Example of setting up a basic endpoint in Django Rest Framework: ```python from rest_framework.views import APIView from rest_framework.response import Response class MeetingAPIView(APIView): def get(self, request, format=None): # Logic to retrieve and send meeting data return Response({"message": "Welcome to the meeting API"}) ``` - Example of a basic Navbar component in Next.js: ```javascript // Navbar.tsx import Link from 'next/link'; const Navbar = () => ( <nav> <ul> <li><Link href="/">Home</Link></li> <li><Link href="/dashboard">Dashboard</Link></li> <li><Link href="/meetings">Meetings</Link></li> </ul> </nav> ); export default Navbar; ``` ## Notes - Ensure compatibility between Django’s backend and Next.js frontend components. - Handle Agora SDK integration carefully to maintain performance during video calls. - Remember to test authentication flows extensively to secure meeting access.

Agora Video Meetings App

Create a project for building an Agora Video Meetings app using Django Rest Framework and Next.js. Utilize Next.js version 15.0.3 with app routing fundamentals incorporating page.tsx, layout.tsx, and middleware.ts. Follow the outlined structure and model specifications below. ### Goals - Build a backend using Django Rest Framework to handle user authentication and meeting management. - Develop a frontend with Next.js for user interface and real-time meeting capabilities. ### Backend Instructions - **Accounts app**: Extend the Django `AbstractUser` model to create a `CustomUser` model with a `user_type` field that specifies if a user is a 'student', 'teacher', or 'admin'. - **Core app**: Develop a `Meeting` model with attributes for title, host, participants, and Agora integration (channel and token). ```python from django.contrib.auth.models import AbstractUser from django.db import models class CustomUser(AbstractUser): USER_TYPE_CHOICES = ( ('student', 'Student'), ('teacher', 'Teacher'), ('admin', 'Admin'), ) user_type = models.CharField(max_length=10, choices=USER_TYPE_CHOICES) class Meeting(models.Model): title = models.CharField(max_length=255) host = models.ForeignKey(CustomUser, related_name='hosted_meetings', on_delete=models.CASCADE) participants = models.ManyToManyField(CustomUser, related_name='meetings', blank=True) agora_channel = models.CharField(max_length=255, unique=True, blank=True) agora_token = models.CharField(max_length=1024, blank=True, editable=False) created_at = models.DateTimeField(auto_now_add=True) ``` ### Frontend Instructions - Implement the front end in Next.js 15.0.3 using the following routing/pages structure: - **page.tsx**: Main entry for rendering pages. - **layout.tsx**: Set the layout structure and design of the application. - **middleware.ts**: Handle authentication and route protection. ### Note - Integrate Agora SDK for real-time video functionality. - Ensure scalability by maintaining clean code structure. ### Example Code (Next.js) Here's a very basic structure to get started with Next.js: ```typescript // page.tsx export default function Home() { return ( <div> <h1>Welcome to Agora Video Meetings</h1> </div> ); } ``` ### Additional Considerations - The logic for login, registration, and logout is to be ignored or handled separately according to project needs. - Use environment variables for sensitive configurations. # Output Format - A detailed description of the file and folder structure, key components, and necessary configurations for both the backend and the frontend aspects of the Agora Video Meetings app. # Examples - Sample `Meeting` object and `CustomUser` instance creation. # Notes - Further customization may include UI elements, error handling, and additional features like chat or file sharing.

Agora Video Meetings App

Develop an Agora Video Meetings application using Django Rest Framework for the backend and Next.js version 15.0.3 for the frontend, adhering to the app routing fundamentals provided in the specified Next.js files. ## Objective Create a full-stack application that enables video meetings powered by Agora, ensuring efficient integration between Django Rest Framework and Next.js. ## Requirements - Utilize **Django Rest Framework** for the backend to manage API endpoints and any necessary server-side logic. - Implement **Next.js Version 15.0.3** for the frontend to organize components and client-side rendering. - Use **app Routing Fundamentals** in Next.js, specifically in the `page.tsx`, `layout.tsx`, and `middleware.ts` files, to handle navigation and application structure. - Ensure seamless integration between the frontend and backend. - Implement user authentication and session management for secure video meetings. ## Steps 1. **Backend Development** - Set up Django and Django Rest Framework. - Define and implement API endpoints required for meeting management, user authentication, and video streaming capabilities using Agora SDK. - Handle business logic for creating, joining, and managing video meetings. - Test API endpoints to ensure they function as expected. 2. **Frontend Development** - Set up Next.js environment with Version 15.0.3. - Use `page.tsx` to define component pages for UI sections like homepage, meeting room, and user dashboard. - Implement `layout.tsx` to maintain consistent styling and structure across the app. - Configure `middleware.ts` to handle authentication routes and any necessary server-side logic on request. - Integrate Agora SDK for video call functionalities. 3. **Integration** - Connect the Next.js frontend with Django backend by fetching and posting data as required. - Ensure state management aligns between frontend components and backend responses. - Test the full application flow from user login, meeting creation, joining meetings, and video streaming. ## Output Format Provide detailed documentation of the implemented application including: - Setup instructions for both the backend and frontend environments. - Code snippets for key components and configurations in both Django and Next.js. - Screenshots or descriptions of key workflows and UI components. ## Notes - Consider the security and scalability of the application, especially in user authentication and video streaming. - Ensure the application performs optimally across various devices and browsers. - Leverage existing resources such as Agora SDK documentation and Next.js routing documentation to enhance app features. ## Examples - A `page.tsx` file defining the homepage should include sample code for rendering a video meeting component. - Example middleware handling session verification should be provided in `middleware.ts`.

Agricommunity React Frontend

Create a React frontend application for the Agricommunity project, which enables farmers to chat and access specific features. The application should include the following components: 1. **Registration Form**: Capture the following user details: - First name - Second name - Surname - Username - Email - Password - Re-enter password (for confirmation) 2. **Login Form**: Allow users to log in using: - Username - Password 3. **Chat Interface**: A interface where farmers can chat with each other. 4. **Two Floating Action Buttons** (FABs) on the chat interface: - One labeled "ChatKulim" that activates a chat feature powered by a large language model (LLM). - One labeled "Disease Detection" that allows uploading a picture to detect plant diseases. Enhance the floating buttons by applying appropriate icons that visually represent their functions. # Steps - Develop the registration form with validation for fields and password confirmation. - Develop the login form with error handling. - Create a chat interface to enable real-time messaging among farmers. - Design and add two floating action buttons with suitable icons: - ChatKulim button for LLM-powered chat. - Disease Detection button for image uploading. # Output Format Provide the complete React frontend code with relevant components, state management, and styling. Include comments explaining each part of the code for clarity. If external libraries or dependencies are needed for icons, chat, or image uploading, mention and import them appropriately in the code.

AHK AlwaysOnTop with Cleanup

You are tasked with analyzing and reviewing an AutoHotkey v2.0 script file named "HotKeyLauncher.ahk". The main objectives are: - Implement functionality to set a specified window to be "Always On Top" by leveraging the "Microsoft PowerToys" utility. - Ensure that when the hotkey involving a double tap of the backtick key (`) is triggered, the script automatically removes the two backtick characters inserted into any active text input (such as a textbox). To accomplish this, carefully analyze the existing script to integrate the following features: 1. Detect the double tap of the backtick (`) key as the hotkey trigger. 2. Upon activation, utilize Microsoft PowerToys to toggle the "Always On Top" state of the currently focused window. 3. Automatically remove the double backticks inserted by the hotkey from any active editable text input to avoid leaving unwanted characters. Your solution must ensure seamless interaction so that the "Always On Top" function is triggered without residual characters being left in user input fields. # Steps - Parse and understand the existing "HotKeyLauncher.ahk" script to find where the double backtick hotkey is handled. - Research or verify that Microsoft PowerToys provides a method (such as a command-line interface or an API) to toggle the "Always On Top" state of windows. - Modify or add to the AutoHotkey script such that when the double backtick is detected, the PowerToys function to set "Always On Top" is activated. - Immediately after triggering, programmatically delete the last two backtick characters from the active input field, ensuring the user’s typing flow is uninterrupted. # Output Format Provide the enhanced AutoHotkey v2.0 script code snippet or detailed modifications needed for "HotKeyLauncher.ahk" to achieve the above requirements. Include any necessary explanations or comments within the script to clarify how the removal of the double backticks and the integration with Microsoft PowerToys is accomplished.

Page 62 of 68

    Coding Prompts - Learning AI Prompts | Elevato