指定
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.
反馈
1
等级
项目
1410
67%
仲裁
123
32%
/
41%
逾期
218
15%
空闲
发布者: 1 代码
2
等级
项目
473
40%
仲裁
103
41%
/
23%
逾期
78
16%
繁忙
发布者: 2 代码
3
等级
项目
0
0%
仲裁
0
逾期
0
空闲
相似订单
The indicator a bit inverted. But it doesn’t matter to me as long as the winrate make sense for investment. For brief details regarding the indicator. What should have been a sell, i inverted it into buy with sl and tp swapped(only change the name of sl and tp for visualisation , but the code still on right tp and sl) . And in script ive inverted the signal command code. But the trouble is the tp and sl cant be
Reverse grid trading bot for crypto exchange
300 - 550 USD
Hello, I want a grid trading bot for the Gate.io crypto exchange. I currently have a working grid bot written in MQL5, and I want a similar bot implemented in Python. The MQL5 bot can be translated, but the codebase is large and it was not designed to be easily ported to Python. Therefore, I prefer that the final Python bot preserves the same core grid logic, but is implemented cleanly in Python rather than doing a
Please explain all the details, including the entry and exit conditions . 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 . requests for details of the project will be ignored
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
Copy trading bot
80+ USD
Here is what I’m looking for: • Signal source: On-chain wallet address monitoring. I want to copy trade high win-rate meme coin wallets (smart money / profitable traders), not Telegram signals. • Market: Crypto (primarily meme coins). • Execution speed: Very important — I want as close to sub-second execution as possible. Low latency is a top priority. • Infrastructure: I’m open to self-hosted VPS or cloud setup if
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
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
The indicator a bit inverted. But it doesn’t matter to me as long as the winrate make sense for investment. For brief details regarding the indicator. What should have been a sell, i inverted it into buy with sl and tp swapped(only change the name of sl and tp for visualisation , but the code still on right tp and sl) . And in script ive inverted the signal command code. But the trouble is the tp and sl cant be
Ai robot
30 - 50 USD
1️⃣ System Architecture An AI robot typically consists of the following subsystems: 🔹 1. Perception Layer Collects environmental data using: RGB / Depth cameras LiDAR Ultrasonic sensors IMUs (Inertial Measurement Units) Microphones Data is processed using: Computer Vision (e.g., object detection, SLAM) Signal processing Sensor fusion algorithms 🔹 2. Cognition / Intelligence Layer Implements AI models such as
项目信息
预算
30 - 50 USD
截止日期
从 2 到 3 天