Customizable trailing Stop For Manual Entries
Dec 18, 2017

The Customizable Trailing Stop For Manual Entries indicator provides a flexible stop-loss management system for manual trades, allowing users to track entries and automate exit triggers based on percentage-based trailing logic across different timeframes.
Usage
The Usage section describes how the script can be used to manage open positions on platforms or exchanges that do not natively support trailing stop-loss orders. To initialize the tool, the user must input the exact timestamp (Year, Month, Day, Hour, and Minute) of their manual entry. Once configured, the script calculates a dynamic stop level that follows price action at a specified percentage distance.
Timeframe Synchronization
A key feature of this tool is its ability to decouple the trailing logic from the chart timeframe. For example, a user can monitor a trade on a 1-minute chart to ensure the entry timestamp is precise, while setting the trailing stop calculation to use 4-hour or Daily price data. This prevents premature exits caused by minor intraday volatility while maintaining a granular view of the price action.
Trigger and Trailing Parameters
The script allows users to define which price source triggers the stop (e.g., Close, Low, or High) and which source is used to calculate the trailing peak. This is particularly useful for traders who want the trailing stop to move based on Highs (for long positions) but only want the exit to trigger if the Close price breaks the stop level.
Details
The script operates by identifying the "Best Price" (the highest point reached for longs or lowest for shorts) since the specified start time. The trailing stop is then calculated by applying the user-defined percentage offset to this peak.
The execution logic utilizes request.security to fetch data from different timeframes if the "Use current chart resolution" options are disabled. This allows the tool to reference higher-timeframe trends for stop placement while executing the trigger logic on the current chart's price action. The indicator also includes built-in alert functionality that triggers once the price source crosses the calculated trailing level.
Settings
Core Settings
- 1=Long, 2=Short: Determines the direction of the trade and the orientation of the trailing stop.
- Start Year/Month/Day/Hour/Minute: Specifies the exact bar time when the manual trade was executed to begin calculations.
- Trail Percent: The percentage distance maintained between the peak price and the stop-loss level.
Trailing Settings
- Trailing Parameter: The price source (High, Close, etc.) used to determine the peak of the move.
- Use current chart resolution for trailing stop?: When enabled, uses the timeframe of the current chart. When disabled, the custom timeframe below is used.
- Use different timeframe for trailing?: Specifies the timeframe for peak price calculations (e.g., '240' for 4 hours).
Trigger Settings
- Trigger for stoploss: The price source (Close, Low, etc.) that must cross the trailing price to trigger an exit.
- Use current chart resolution for stop trigger?: Determines if the trigger logic should be evaluated on the current chart timeframe.
- Use different timeframe for stop trigger?: Specifies a custom timeframe to evaluate the exit condition.
FAQ
How do I set the entry time if it doesn't align with my current chart? You should switch to a lower timeframe (like the 1-minute chart) to set the "Start Minute" and "Start Hour" precisely. The trailing logic can still be set to a higher timeframe using the "Use different timeframe" settings.
Why does the indicator disappear after a certain point? The indicator is designed to stop plotting once the stop-loss condition has been met (the trigger price crosses the trailing price). This signifies the trade is closed.
How can I access the Customizable Trailing Stop For Manual Entries? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.