Overview
This prompt is designed to guide programmers in creating a LUA script for the IQ Option platform using specific trading strategies. It benefits developers and traders looking to automate and customize trading strategies based on technical indicators.
Prompt Overview
Purpose: To implement a customizable “All-in” trading strategy script for IQ Option using Alligator, SMA, and MACD indicators.
Audience: Traders and developers using IQ Option who want automated signals based on specific indicator conditions.
Distinctive Feature: Real-time 10-second timeframe analysis with configurable indicator parameters and clear buy/sell alerts.
Outcome: The script outputs “BUY Signal!” or “SELL Signal!” alerts when all defined technical conditions are met.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Stock Brokerage & Trading, Consulting (Management, Strategy)
- Techniques: Prompt Templates, Structured Output, Output Constraints
- Models: GPT-4, GPT-4 Turbo
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Create a fully functional and well-commented LUA script implementing the “All-in” trading strategy tailored for the IQ Option trading platform, based precisely on the indicator settings and conditions described in the YouTube video “https://youtu.be/-EXqUXaTexs?si=QT6Qd_GVoyEtccHI”.
The script must:
– Utilize the following technical indicators with these exact configurations:
– Alligator Indicator:
– Jaw period: 9, Shift: 4
– Teeth period: 6, Shift: 8
– Lips period: 10, Shift: 2
– All lines colored white with line thickness set to 2
– Simple Moving Average (SMA):
– Period: 52
– Type: SMA
– Line color: yellow
– MACD Indicator:
– Fast EMA period: 11
– Slow EMA period: 22
– Signal SMA period: 7
– All MACD signal lines should be white and transparent
– Operate exclusively on a 10-second timeframe, accurately handling real-time price data.
– Implement clear, logical entry conditions for buy and sell signals, as follows:
Buy Signal Conditions:
1. Alligator’s Jaw, Teeth, and Lips lines must be crossing upwards, signaling an uptrend.
2. The SMA 52 (yellow) line must be positioned below all three Alligator lines, confirming the upwards trend.
3. The MACD histogram must be green, affirming the buy entry point.
4. When all these conditions are simultaneously met, the script should generate a “BUY Signal!” alert.
Sell Signal Conditions:
1. The three Alligator lines must be aligned downward, and the current candlestick closing price must be below these lines, signaling a downtrend.
2. The Alligator lines must lie below the SMA 52 line (yellow).
3. The MACD histogram must be red and positioned below the zero line.
4. The Alligator lines must have crossed below the SMA 52 line.
5. Once confirmed, the script outputs a “SELL Signal!” alert.
– Include configurable parameters for each indicator’s periods, shifts, colors, and line thicknesses so that users can customize the strategy inputs easily.
– The code should be modular, clear, and thoroughly commented to facilitate maintenance and integration into the IQ Option platform.
– Provide clear output mechanisms (text alerts or console prints) that clearly indicate when buy or sell conditions are met.
# Steps
1. Define parameters for the Alligator (periods, shifts, colors, thickness), SMA period and color, MACD fast/slow/signal periods, and MACD line transparency.
2. Fetch and process live candle data on a 10-second timeframe.
3. Calculate Alligator lines, SMA 52 line, and MACD components based on real-time data.
4. Implement logic to detect upward crossing and alignment for the buy condition.
5. Implement logic to detect downward alignment, candlestick position, line crossings, and MACD histogram status for the sell condition.
6. Trigger “BUY Signal!” or “SELL Signal!” outputs when conditions are met.
7. Comment all sections for clarity and configurability.
# Output Format
Provide the complete LUA script text in a single code block, with clear comments for each section including parameter definitions, indicator calculations, entry condition logic, and output signaling, formatted to be immediately usable within IQ Option’s trading scripting environment.
Screenshot Examples
[Insert relevant screenshots after testing]
How to Use This Prompt
- Copy the prompt into your text editor.
- Ensure you have access to the IQ Option platform.
- Follow the prompt to create a LUA script.
- Implement the specified indicators and conditions.
- Test the script on a 10-second timeframe.
- Adjust parameters and comments for clarity and customization.
Tips for Best Results
- Understand the Basics: Before diving into complex strategies, ensure you have a solid understanding of LUA scripting and the IQ Option platform’s API.
- Start Simple: Begin with a basic script to fetch and display live data, then gradually add complexity by integrating indicators and logic.
- Test Thoroughly: Use a demo account to test your script extensively, ensuring all conditions trigger correctly before deploying it in a live environment.
- Keep Learning: Stay updated with the latest programming practices and trading strategies to continuously improve your script’s performance and reliability.
FAQ
- What is the Alligator Indicator used for?
The Alligator Indicator identifies market trends and potential reversals using three smoothed moving averages. - How does the MACD histogram indicate a buy signal?
A green MACD histogram above the zero line suggests bullish momentum, indicating a buy signal. - What timeframe is used in the script?
The script operates on a 10-second timeframe for real-time trading decisions. - What does a ‘SELL Signal!’ alert indicate?
It indicates that all sell conditions are met, suggesting a potential downtrend in the market.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (March 2026): Initial release.


