指定
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
hello great developer ’m looking for an experienced NinjaTrader developer to help set up software on my VPS, create custom chart templates with multiple indicators, and build an arbitrage dashboard/trade copier system. The project includes multi-account management and integration with Bookmap. I need a custom dashboard to monitor and control multiple accounts efficiently. Please message me if you have strong
What informtion would you need for Ninjatrader futures automated trading and how long would it take ? if anyone can give me answer i will be happy to discuss more about the project thanks fill free to bid to the project thanks
Requirements: - Convert my written trading rules into TradingView Pine strategy - Then convert into MT5 EA - Entry must be next candle open after signal candle close - Stop loss on signal candle high/low - Position sizing: fixed % risk per trade - Portfolio risk cap across symbols - One trade per symbol at a time - Must understand backtesting differences (spread, slippage, fill logic) Important: I want to be able to
Skilled expert programmer needef
45 - 100 USD
Hi there, your attention is urgently needed if you have the right profession in both MQL4 and Ninjascript code, as I am in need of a very reliable programmer to help convert my MQL4 code into a well functioning ninjatrader, this includes the full reconstruction of the entire code, applicant must be able to provide their previous work in line with this specs thanks
Proficient coder needed for converting my MQL4 code to a well functional Nintrader 8 strategies, coder must be able to provide seamless tailored solutions as I need the NT8 strategy: - Replicate the exact same logic, behavior, and decision flow as the MT4 EA - Take the same trades under comparable market conditions - Include all internal logic, states, controls, and integrations present in the code - Be a faithful
Data Integrity
500 - 1000 USD
The trading bot is an automated software system designed to monitor financial markets, execute trades, and manage risk based on predefined strategies. The bot aims to maximize profits while minimizing human intervention and emotional decision-making. Scope: Supports automated trading on selected exchanges (e.g., Binance, Bitget, Coinbase). Executes trades based on technical indicators, signals, or AI models. Provides
I want a modification on my ea . A spread filter or slipage filter such that when the market price is less than 50 point away from the pend order , then ea check the spread if less than the set filter spread. If spread is more than the set spread, the ea will delete the pend order . Secondly , if the broker price is moved or sliped the pending order from the original price it was set by the tolerable slipage distance
1. Objective Create an MT5 automation script (or set of scripts) that fully automates my strategy optimization workflow, including: • Batch optimization runs • Automatic filtering of results • Automatic forward testing • Exporting and organizing results into structured files/folders The goal is to reduce manual work and allow one‑click execution of the entire pipeline. 2. Platform & Environment • MetaTrader 5 •
Would it be possible to connect Futures prop firm with Rithmic or Tradeovate platform to Ninjatrader automated trading ? If anyone can do this for me I will be happy to get started with the person right away
项目信息
预算
30 - 50 USD
截止日期
从 2 到 3 天