Specification
Development Brief: Dynamic Swing StopLoss Indicator with LuxAlgo Reset & Alert Integration
🎯 Goal
To build a Pine Script indicator that extends an existing Swing StopLoss system by adding dynamic trailing logic, reset trigger via LuxAlgo blue dot alerts, and manual or alert-based entry activation. The system must fully support Heikin Ashi candles and be visually intuitive for live trading.
📌 Base Code Reference
You’ll use my current indicator as a starting point. It already calculates fixed stop-loss levels based on swing highs/lows and applies an offset percentage:
//@version=5
indicator("Swing SL ±X% (LONG & SHORT) | HA Compatible", overlay=true)
length = input.int(50, minval=1, title="Swing Length")
longOffsetPercent = input.float(0.1, minval=0.01, step=0.01, title="LONG Offset (%)")
shortOffsetPercent = input.float(0.1, minval=0.01, step=0.01, title="SHORT Offset (%)")
useTruePrices = input.bool(true, title="Use true OHLC (for Heikin Ashi support)")
srcLow = useTruePrices ? request.security(syminfo.tickerid, timeframe.period, low) : low
srcHigh = useTruePrices ? request.security(syminfo.tickerid, timeframe.period, high) : high
swingLow = ta.lowest(srcLow, length)
swingHigh = ta.highest(srcHigh, length)
longStop = swingLow * (1 - longOffsetPercent / 100)
shortStop = swingHigh * (1 + shortOffsetPercent / 100)
plot(longStop, title="LONG Stoploss", color=color.green)
plot(shortStop, title="SHORT Stoploss", color=color.red)
plotshape(srcLow <= longStop[1], title="LONG SL Trigger", location=location.belowbar, color=color.green, style=shape.xcross)
plotshape(srcHigh >= shortStop[1], title="SHORT SL Trigger", location=location.abovebar, color=color.red, style=shape.xcross)
alertcondition(srcLow <= longStop[1], title="LONG SL Trigger", message="Price hit LONG stoploss")
alertcondition(srcHigh >= shortStop[1], title="SHORT SL Trigger", message="Price hit SHORT stoploss")
🛠️ Required Additions
1. Trade Activation Logic (based on alert messages)
⦁ Trade should be considered active only after a specific alert message is received.
⦁ Alert messages are sent via TradingView alerts (via external LuxAlgo signals):
- "LONG" → sets activeTrade = true, tradeSide = "long"
- "SHORT" → sets activeTrade = true, tradeSide = "short"
⦁ These are passed via alert_message.
2. Dynamic Swing Length Logic (fully user-configurable)
⦁ Add user input:
Initial Swing Length (default: 50)
⦁ Add user input:
Swing Tightening Frequency (default: every 3 bars)
⦁ Once a trade is active:
- After every N bars (user-defined), the swing length is reduced by 1.
- Minimum allowed swing length = 5.
⦁ This dynamically adjusts the SL calculation as trade matures.
3. Reset via LuxAlgo Blue Dot (via alert message)
⦁ When alert_message == "RESET":
⦁ - Trade is deactivated.
⦁ - Dynamic swing length is reset to the initial input value.
⦁ - Candle counter is reset.
⦁ - A visual label is drawn: "RESET DONE (Blue Dot)" in blue color.
4. Stop-Loss Calculation Logic (conditional on trade state)
⦁ LONG: swingLow * (1 - offset%)
⦁ SHORT: swingHigh * (1 + offset%)
⦁ These SL lines must be plotted only when a trade is active.
5. Visual Markers and Alerts
⦁ Show green ❌ below bar when LONG stop is hit.
⦁ Show red ❌ above bar when SHORT stop is hit.
⦁ Alert messages:
- 🔔 Price hit LONG stoploss
- 🔔 Price hit SHORT stoploss
6. Optional Manual Testing Inputs (for developer)
⦁ Add toggle inputs for manually triggering:
- LONG, SHORT, or RESET
⦁ These help verify the functionality without external alerts.
🧪 How the Indicator Should Work (Free-form Explanation)
This indicator dynamically adjusts stop-loss levels based on recent price swings and responds to external LuxAlgo signals. Once a 'LONG' or 'SHORT' message is received, the system activates a trade and begins calculating a progressive trailing stoploss. The swing length is initially user-defined (e.g., 50 candles), and after every N bars (e.g., 3), it tightens by 1, simulating dynamic risk management.
When a 'RESET' message is received (typically from a LuxAlgo blue dot alert), the system deactivates the trade, resets the swing parameters, and waits for the next entry. The script must work seamlessly on Heikin Ashi candles, using raw OHLC data when needed.
The entire system must not repaint, be cleanly structured, and provide visual clarity:
- SL lines
- Reset labels
- Stoploss trigger markers
- Alerts
📤 Output Files & Expectations
- Final `.pinescript` file (ready for TradingView)
- Code should be well-documented and structured
- Inputs must be clearly labeled
- Developer should provide a short usage summary (what alert messages trigger what)
🖼️ Visual Example: Custom Alert and StopLoss Structure
Below is a screenshot example illustrating the StopLoss levels, LuxAlgo blue dot behavior, and how alerts appear when the dynamic system is working live on the chart.
Responded
1
Rating
Projects
1410
67%
Arbitration
123
32%
/
41%
Overdue
218
15%
Free
Published: 1 code
2
Rating
Projects
469
39%
Arbitration
102
40%
/
24%
Overdue
77
16%
Loaded
Published: 2 codes
3
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
Similar orders
MT5 EA required with SMC strategy
40 - 80 USD
Signal Logic - Swing points detected correctly (Fractals or N-bar) - BOS triggers only on bar close beyond swing level (+ optional min break distance) - FVG zones detected correctly (3-candle gap) and stored with clear boundaries - FVG invalidation works as configured (full fill / partial fill / timeout) Entry & Execution - Entry only after BOS (if enabled) and on return to active FVG zone - Bar-close confirmation
LOOKING FOR AN EA WITH HIGH PERFORMANCE
30 - 45 USD
Hi, I’m searching for a developer who already has a high‑performance Gold EA that can beat the results shown in my screenshot. If you have such an EA, please reply with: - A brief description of how it works (grid, scalping, SMC, etc.) - Backtest results and the set files you used - Whether you’re willing to make minor tweaks so I can use it as my own If the performance looks good, we can discuss adjustments and next
Multi-Asset AI Trading Bot Details Proposals I want a single, cohesive AI bot that can log in to MetaTrader, Coinbase, Robinhood, and TradingView, scan live market data, and execute trades automatically in stocks, forex, and crypto. The core logic must support day-trading, swing-trading, and scalping modes that I can toggle on a schedule or by simple configuration. The workflow I picture is: • Real-time data
I need a gold EA that perform well.
30 - 100 USD
I need someone that is able to develop for me a MT5 EA that perform VERY WELL on XAUUSD. Every strategy is accepted. By applying, please send me screenshot of results since 2018
Editing of existing EA required
50 - 150 USD
Hello developers, I'm looking for existing, proven EAs (MQL5) that work flawlessly on MT5. Requirements: Demo version available for testing Backtest results + screenshots Verified trade history from 2018-2025 Budget is negotiable If you've got an EA that fits, hit me up
I want to develop and EA first to use for back testing, then to use for trading. This will be done on the 15 min timeframe. The EA must Identify sessions highs and lows with specific timings (Asian, London, NY), Place three EMA and ensure that the 50, 100 and 200 exponential moving averages are in order to give directional bias Sell bias = 50 below the 100, which is below the 200 Buy bias = 50 above the 100, which is
Need a HFT scalping EA
30 - 100 USD
Require the development of a high-speed HFT, fully automated trading Expert Advisor (EA) for MetaTrader 5 , optimized for live trading on both Deriv and Exness . The EA must be designed for fast execution, low latency, and reliability on real-money accounts , with full compatibility across broker-specific contract specifications, tick sizes, tick values, pricing formats, and volume rules. It should automatically
Converting ex4 file into mq4 file and modifications
100 - 350 USD
Looking for an experienced MQL4/MQL5 developer. Task: EX4 → MQ4 recovery Modify EA logic Convert MQ4 → MQ5 (fully working) Must understand MT4 vs MT5 differences and deliver clean, tested code. This is a paid job, with possible follow-up work if things go well. DM me with your experience and examples of similar work
This EA uses the inbuilt indicators to execute trades. It follows the simple rules of buy signal and sell signal.It will be independent of each other. The same rule follows for each
1. Background & MQL5 Journey: ¿Cuéntame un poco sobre tu background en trading algorítmico y qué te emociona de crear EAs de alto rendimiento? 2. Experience: ¿Cuáles son 2-3 EAs destacados que has creado (mercados, Sharpe, PF, señales/backtests)? 3. Institutional Results: ¿Puedes lograr Sharpe ≥3.0, PF >2.5, <10% DD en XAUUSD? ¿Qué te da confianza? 4. Demo EA: ¿Tienes una señal de EA top (MQL5/Myfxbook) con 100+
Project information
Budget
30 - 50 USD
Deadline
from 2 to 3 day(s)