Tradingview Pine script

Tarea técnica

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.
 

Han respondido

1
Desarrollador 1
Evaluación
(885)
Proyectos
1410
67%
Arbitraje
123
32% / 41%
Caducado
218
15%
Libre
Ha publicado: 1 ejemplo
2
Desarrollador 2
Evaluación
(295)
Proyectos
473
40%
Arbitraje
103
41% / 23%
Caducado
78
16%
Ocupado
Ha publicado: 2 ejemplos
3
Desarrollador 3
Evaluación
Proyectos
0
0%
Arbitraje
0
Caducado
0
Libre
Solicitudes similares
Phahla fx boto 30+ USD
99.99% signal accuracy 10-15 trades distribution all currency trade and meta AI assistance on loss[advice] stop and start robot cyber security firewall protection activation code: 20060605TLP20 Please create a trading bot with any logo with the name elevation
Refine signal trigger execution . Optimize live chart performance . Ensure stable and clean code structure : Stable and clean code is important . Otherwise its a mess . Apply with as much accurate structure you foresee
I am looking to purchase a fully developed and proven Expert Advisor (EA) for XAUUSD. This must be an existing EA with a minimum of 12 months verified live trading history on a real account. I am not interested in new development or demo-only systems. Requirements: • Verified live track record (Myfxbook, MQL5 signal, or broker statement) • Consistent profitability with controlled drawdown • Designed for XAUUSD •
RED DEVIL AI 30+ USD
50 EMA > 200 EMA → Uptrend confirmed Price pulls back to touch or cross below 50 EMA RSI > 50 ATR(14) > 20-period ATR average (volatility expanding) Current candle closes bullish ➡ Enter BUY at candle close50 EMA < 200 EMA → Downtrend Price pulls back to touch or cross above 50 EMA RSI < 50 ATR filter confirms volatility Current candle closes bearish ➡ Enter SELL at candle closeATR(14) Take Profit: 2.5 × ATR(14) This
This post is subject to developers response . Edit the post as you like . May be with me you can make a come back . So , , , Shift calculations . More to the calculation then you can comprehend is known . What else comes to your mind
This first robot I'm needing to order a robot that will help me with my trading and make it most efficient Help me with my margins my signals or anything I need to do associated to my trading or classroom
Here is an example of Requirements Specification for the development of the MACD Sample Expert Advisor, which is available in the MetaTrader 5 standard package. 1. The idea of the trading system is as follows: market entries are performed when MACD's main and signal lines intersect in the current trend direction. 2. Trend is determined based on the Exponential Moving Average with the specified period
I’m looking for a trading bot where I can use a balance of £1000 to make regular entries making £20-£40 per entry. obviously, I want to have minimum loss with a lot more profit being made
I’m hiring an experienced MQL5 developer to finish and fix an existing project (NOT building from scratch). I have: An existing MT5 EA (.mq5 + .ex5) that is based on my TradingView logic A TradingView indicator version used for signals/alerts The EA works but has logic/consistency issues and needs improvements + cleanup Goal Make the EA reliable and consistent: Ensure entries/exits match the intended logic Fix
I have a High-Frequency Trading EA and I need a full conversion and optimization for MT5. The goal is to ensure stable execution and reliable performance on real accounts (IC Markets Raw and similar ECN brokers). I need an experienced and reputable MQL5 developer to: Convert the existing strategy to MT5 with full fidelity to the original trading logic (entries, SL, breakeven, trailing, pending orders). Optimize the

Información sobre el proyecto

Presupuesto
30 - 50 USD
Plazo límite de ejecución
de 2 a 3 día(s)