Specifiche
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.
Con risposta
1
Valutazioni
Progetti
1410
67%
Arbitraggio
123
32%
/
41%
In ritardo
218
15%
Gratuito
Pubblicati: 1 codice
2
Valutazioni
Progetti
469
39%
Arbitraggio
102
40%
/
24%
In ritardo
77
16%
Caricato
Pubblicati: 2 codici
3
Valutazioni
Progetti
0
0%
Arbitraggio
0
In ritardo
0
Gratuito
Ordini simili
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
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
Olá, preciso de um programador para montar um indicador com base na sobrevenda do estocastico, volume macd, para uma estrategia de reversão e falso rompimento com regioes de OB validos minimas e maximas de H1, H4, D1 e canais para confluencias, quero que seja didatico visualmente e com cores, sons de alertas e algum sinal de call ou put como setas indicando reversões e falsos rompimentos e continuidade
Ninjatrader indicator
30+ USD
I have an issue with my ninja script and i would like you to help me straighten things I wanted to create an indicator and i have the source code already but i am getting compiling errors on my NinjaTrader And i tried fixing the error it still same I sent 3 images here for you to understand the errors and i would like to ask if you can help me fix it so i can go ahead and compile my source code. Thanks
Nijatrader indicator
30+ USD
Good day, I would like to build an automated trading system for Ninjatrader using 2 MACD, a Supertrend, and a moving average indicator. I want the option to adjust the indicator settings, the ability to trade at three different times, and the option to receive alerts. I want to get an idea of what that will cost me. It will enter trades on all blue take one contract out at a fixed point, move the stop to break even
"Hello! I am an experienced programmer specializing in automated trading software for MetaTrader 4 (MQL4) and MetaTrader 5 (MQL5). My goal is to help traders turn their manual strategies into fully automated robots (Expert Advisors) and custom indicators. My services include: Developing Expert Advisors (EA) from scratch based on your strategy. Creating Custom Indicators and Scripts. Modifying existing EAs (adding
I have a simple strategy that need coding on tradingview Strategy using high low at seleted time and when breakout to entry buy sell. Everything will be explained on private
Enhance current EA
200+ USD
I am looking for an experienced MQL5 developer to modify and enhance my existing Expert Advisor, "Gold Levels Trader". The current version has a low win rate (~30%) and issues with ATR-based Stop Loss execution. I want to replace the current "pips drop/rise" logic with Fibonacci Retracement levels for entry signals, implement a Daily Drawdown Limit , and add Pending Orders functionality
I want developer who know how to create bot which immediately transfer specific crypto coin deposit to one crypto address to another specific address in just a second,, if you know about this then only comment on this post
Informazioni sul progetto
Budget
30 - 50 USD
Scadenze
da 2 a 3 giorno(i)