You are on page 1of 11

Universal Trailing Stop User Manual

OVERVIEW
The Universal Trailing Stop or UTS strategy, exits either Long or Short positions when the trailing stop is
touched or penetrated.

The purpose of a Trailing Stop is to attempt to capture as much profit as possible as the price moves in a
profitable direction away from the entry price. The Trailing Stop Amount sets the tolerance for how
much the price can reverse from a profitable move before the Trailing Stop is hit and the position exited.
As the Trailing Stop Amount is increased, the average profitable trade may increase, but likewise the
average losing trade may also increase.

Trailing Stops for long positions always ratchet up or increase in price – meaning the Trailing Stop price
never decreases, it only increases over time.

Likewise, Trailing Stops for short positions always ratchet down or decrease in price – meaning the
Trailing Stop price never increases, it only decreases over time.

Unlike the built-in TradeStation Trailing Stops, the UTS strategy only updates the trailing stop at bar
Closes, not on each price tick within the bar. This allows the UTS strategy to offer key capabilities not
found in the built-in TradeStation Trailing Stop strategies:

1) It does NOT require Look-Inside-Bar Back Testing or LIBB set to 1-tick to accurately back-test.
2) Rapid back-testing and strategy optimization going back as far as historical minute bar data is
available, often 10+ years. Built-in TradeStation Trailing Stop strategies are limited to roughly 6-
months of accurate back-testing, and back-test and optimize very slowly.
3) Can optionally issue market exit orders in place of Stop Market orders to avoid issues with lost Stop
orders in live trading.
4) Can issue synthesized Stop-Limit orders
5) Accurately back-tests on the following Price-based bars: Range, Momentum, Kase, Renko, and Line
Break
6) Supports automated trading with all Price-based bars: Range, Momentum, Kase, Renko, Line Break,
Kagi and Point & Figure
7) Allows 4 different type trailing stops: Ticks, Dollars, Percent and Custom Formula
8) Allows 4 different type “Floor” price trigger levels to turn on trailing stops: Ticks, Dollars, Percent
and Custom Formula
9) Allows a Custom Formula ( separate Long and Short formula ) to define the bar price for updating
the trailing stop at bar Closes.

1
Requirements: TradeStation V9.1 Update 24 or later

General
The UTS strategy can be used in back-testing, strategy optimization, and live-trading. For any of the UTS
products, including the UTS 1 Symbol product, you can insert the UTS on an unlimited number of charts
for back-testing. However, the number of Symbols limits the number of AUTOMATED trading charts
UTS can be used on. So the UTS 1 Symbol product only allows you to use it on a single AUTOMATED
trading chart. Likewise, the UTF 5 Symbols product allows you to use it on 5 AUTOMATED trading charts
( each chart with a different symbol ). If you have subscribed to the UTS Unlimited Symbols product,
the UTS strategy can be used on an unlimited number of AUTOMATED trading charts at the same time.

The UTS strategy does not make entries - it only exits positions. So if it is inserted by itself on a chart
you will see no Trades or positions entered. It works alongside entry/exit strategies inserted on the
same chart: Built-in, custom, or even "Black Box" strategies, such as TradingApp Store strategies you
subscribe to, where you cannot see the source code.

Cautions/Limitations

This strategy cannot be used in back-testing Kagi or Point & Figure charts, as you cannot accurately
back-test Trailing Stops on these type of charts. However, this strategy can be used in automated live
trading of Kagi or Point & Figure charts, with the warning that unpredictable and/or large financial losses
may occur.

2
DETAILED INSTRUCTIONS ON USE AND EXAMPLES
Inputs

The UTS strategy has 13 user-friendly Inputs which:


 Are mostly numerical so they can be used in a strategy optimization
 Allows the “Profit Floor” type and size which trigger the Trailing Stop to update to be specified
 Allows the type and size of Trailing Stop to be specified

The Inputs are:


1. UseMarketOrdersToAvoidLostOrders: If set to 0 this is turned off and Stop based price orders will
be used. If set to a non-zero value, such as -1 or 5, or when Price-based bar charts are used ( Range,
Momentum, Kagi, Kase, Renko, Line Break and Point & Figure ), only Market orders issued at the bar
Close are used. If Line Break and Renko bars are detected “This Bar On Close” orders will be issued,
which fill at the bar Closing price in back-testing, but operate like Market orders issued at the bar
Close in live trading.

2. LongEntryBarReferencePrice: This typically will contain an EasyLanguage Formula, NOT a fixed


numerical value. The default is “High”, which stands for the High of the currently closed Bar the
strategy is running on. The formula is used to calculate and update the Trailing Stop price for Long
positions. For example, if you are in a long position and the highest “High” since entering the
position is 100.00, and the Trailing Stop is 20 ticks ( each tick is 0.01 so the trail amount is 0.20 ) then
the Trailing Stop will be located 0.20 below 100.00 or at 99.80. If instead of “High” you specified
“Close” then the highest “Close” since entry would be used to calculate the Trailing Stop from. The
EasyLanguage Formula may also look like: “(High + Low)/2” or “AvgTrueRange(14) + Low”, or “Low +
( (High-Low) * RSI(Close,10) / 100 )”, etc.

3. ShortEntryBarReferencePrice: Same as the LongEntryBarReferencePrice, but is used for short


positions. The default is “Low”, which stands for the Low of the currently closed Bar the strategy is
running on. The Trailing Stop calculations for short positions adds the trail amount to the Lowest
Formula value since entry.

4. NumTicksTriggerTrailingStop: If set to a negative value, such as -1, or -15, will set the trailing stop to
begin immediately updating as soon as entry occurs. If set to zero(0), this Input is ignored and one
of the other Inputs: DollarsPerShareTriggerTrailingStop, PercentTriggerTrailingStop, or
FormulaTriggerTrailingStop, is instead used. If set to a positive value, such as 5, this will set the
“Profit Floor” which must touched or exceeded for the Trailing Stop to begin updating. For example,
if set to 5, with a Trail Amount set to 20 ticks, the Trailing Stop would remain at 20 ticks below the
entry price until the price moved at least 5 ticks above the entry price, at which point the Trailing
Stop would jump to 20 ticks below the Highest LongEntryBarReferencePrice( “High” ) since entry. If
the Highest “High” since entry was 5 ticks above the entry price ( the same as the “Profit Floor” ) the
Trailing Price would move to 15 ticks below the entry price. Note that a “tick” is the minimum move
for a symbol. For stocks, this is typically 1 cent or 0.01 for a stock. For futures, such as the ES-Mini,
this is 0.25.

3
5. DollarsPerShareTriggerTrailingStop: Works similarly to NumTicksTriggerTrailingStop, except it sets
the dollars per share “Profit Floor” which must be touched or exceeded for the Trailing Stop to begin
updating. For example, if this was set to 1.55 and the entry price was at 100, the Trailing Stop would
not begin updating until the price climbed to or exceeded 101.55.

6. PercentTriggerTrailingStop: Works similarly to NumTicksTriggerTrailingStop, except it sets the


percentage of the entry price as the “Profit Floor” which must be touched or exceeded for the
Trailing Stop to begin updating. For example, if this Input was set to 1.55 ( 1.55% ) and the entry
price was at 100, the Trailing Stop would not begin updating until the price climbed to or exceeded
101.55.

7. FormulaTriggerTrailingStop: Works similarly to NumTicksTriggerTrailingStop, except it uses an


EasyLanguage Formula to set the “Profit Floor” which must be touched or exceeded for the Trailing
Stop to begin updating. For example, if this Input was set to “High * 1.01” and the entry price was at
100 and the bar High when the entry occurred was 102, the “Profit Floor” would be set at 1.01 * 102
= 103.02. So the price would have to climb to 103.02 before the Trailing Stop price would begin
updating. Note that if the Formula uses bar prices, these are for the bar entry occurred on.

Note that only one of the 4 “Trigger” Inputs: NumTicksTriggerTrailingStop,


DollarsPerShareTriggerTrailingStop, PercentTriggerTrailingStop, or FormulaTriggerTrailingStop can
be set to a non-zero value, and one must be set to a non-zero value. If not, the strategy will issue a
run-time error message, like shown below, and turn off the strategy. You will then have to turn back
on the strategy and correct the Input settings.

4
8. NumTicksTrailingStop: If set to negative or zero(0), this Input is ignored and one of the other Inputs:
DollarsPerShareTrailingStop, PercentTrailingStop or FormulaTrailingStop, is instead used. If set to
a value > 0, this Input sets the trailing amount. For example, if this Input was set to 5, the trailing
amount will be 5 ticks ( 5 cents or 0.05 for stocks ). If the entry price was 100 the Trailing Stop price
would be initialized at 100 - 0.05 = 99.95.

9. DollarsPerShareTrailingStop: Works similarly to NumTicksTrailingStop, except it sets dollars per


share as the trailing amount. For example, if this was set to 2.13 and the entry price was 100, the
trailing amount would be $2.13 and the Trailing Stop price would be initialized at 100 – 2.13 = 97.87.

10. PercentTrailingStop: Works similarly to NumTicksTrailingStop, except it sets a percentage of the


entry price as the trailing amount. For example, if this was set to 1(%) and the entry price was 85,
the trailing amount would be 1% of 85, or 0.85. The Trailing Stop price would be initialized at 85 –
0.85 = 84.15.

11. FormulaTrailingStop: Works similarly to NumTicksTrailingStop, except it uses a Formula to set the
trailing amount. For example, if this was set to “High * 0.01” and the entry price was 100 and the
bar High at entry was 101, the trailing amount would be 1% of the bar High, or 1.01. The Trailing
Stop price would be initialized at 100 – 1.01 = 98.99.

Note that only one of the 4 above Inputs: NumTicksTTrailingStop, DollarsPerShareTrailingStop,


PercentTrailingStop, or FormulaTrailingStop can be set to a positive value, and one must be set to a
positive value. If not, the strategy will issue a run-time error message, similar to that shown on Page
4, and turn off the strategy. You will then have to turn back on the strategy and correct the Input
settings.

12. NumTicksSlippageForStopLimitExit: If set to a value < 0 this is disabled. If set to zero(0) or a positive
value this enables the Synthetic Stop Limit order feature. For example, if you are in a long position
and the Trailing Stop price exceeds the current bar Close at 100 and this is set to 3, then a Sell Limit
order will be issued at 3 ticks below the bar Close at 100, or at 100 – 0.03 = 99.97 ( for stocks where
1 ticks = 0.01 ). Note the Sell Limit order should fill at 99.97 or higher.

13. DisplayUserManual: If set to TRUE the user manual will be displayed in a Web Browser window that
you can resize. Note that if you have the UTS strategy inserted on multiple charts that as long as
any chart in which the UTS strategy is inserted has this Input set to TRUE the user manual will be
displayed. If the UTS strategy is being optimized on a chart the user manual will not be displayed.

5
Input Comments:

You will notice that most Inputs have comments to the right of the Input value surrounded by curly
braces, like: { Comment }, as shown in the image below.

The purpose of these comments is to explain how to set the Input value. You can change the Input
value without changing the comment, but if you delete either the left or right curly brace, { or }, the
comment text will become part of the Input and you will see an error. You can remove the comment by
deleting the curly braces and all the text between them, or you can type over the text between the curly
braces to create your own comment.

6
Usage Examples

Example 1: Set a 20 tick Trailing Stop that begins to update as soon as entry is made
- UseMarketOrdersToAvoidLostOrders: 1
- LongEntryBarReferencePrice: High
- ShortEntryBarReferencePrice: Low
- NumTicksTriggerTrailingStop: -1 ( negative value causes the trailing stop to immediately update )
- All other numerical “Trigger” Inputs: 0 ( disabled )
- FormulaTriggerTrailingStop: “” ( disabled: no space between 2 double quotes )
- NumTicksTrailingStop: 20
- All other numerical Trailing Stop Inputs: 0 ( disabled )
- FormulaTrailingStop: “” ( disabled: no space between 2 double quotes )
- NumTicksSlippageForStopLimitExit: -1 ( disabled )

Example 2: Set a 20 tick Trailing Stop that begins to update after the price has moved to 7 ticks of profit
beyond the entry: Only Input changes from Example 1 above shown below
- NumTicksTriggerTrailingStop: 7

Example 3: Set a 20 tick Trailing Stop that uses the bar Average Price for updating the Trailing Stop ( not
the bar High or Low ), which begins to update after the price has moved to 7 ticks of profit beyond the
entry: Only Input changes from Example 2 above shown below
- LongEntryBarReferencePrice: AvgPrice ( built-in TradeStation function )
- ShortEntryBarReferencePrice: AvgPrice ( built-in TradeStation function )

Example 4: Set a 200% of bar Average True Range Trailing Stop that begins to update as soon as entry is
made: Only Input changes from Example 1 above shown below
- NumTicksTrailingStop: 0
- FormulaTrailingStop: 2 * AvgTrueRange(14) ( built-in TS function: 14-bar calculation )

Example 5: Set a 20 tick Trailing Stop that begins to update after the price has profitably moved 125% of
bar Average True Range beyond the entry: Only Input changes from Example 2 above shown below
- NumTicksTriggerTrailingStop: 0
- FormulaTriggerTrailingStop: 1.25 * AvgTrueRange(14) ( built-in TS function: 14-bar calculation )

Example 6: Set a 0.55% Trailing Stop that begins to update as soon as entry is made: Only Input changes
from Example 1 above shown below
- NumTicksTrailingStop: 0
- PercentTriggerTrailingStop: 0.55

Example 7: Set a 0.55% Trailing Stop that begins to update as soon as the price has profitably moved
0.25% beyond the entry: Only Input changes from Example 6 above shown below
- NumTicksTriggerTrailingStop: 0
- PercentTriggerTrailingStop: 0.25

7
Usage Examples
( Continued )

Example 8: Set a 0.55% Trailing Stop that begins to update as soon as the price has profitably moved 48
cents beyond the entry: Only Input changes from Example 7 shown below
- PercentTriggerTrailingStop: 0
- DollarsPerShareTriggerTrailingStop: 0.48

Example 9: Set a Parabolic SAR Trailing Stop that begins to update as soon as entry is made: Only Input
changes from Example 1 above shown below
- NumTicksTrailingStop: 0
- FormulaTrailingStop: ParabolicCustom( 0.02, 0.2 ) ( built-in TS function with 2 Inputs )

8
Trouble Shooting
Problem: No trades are generated on the chart after inserting and turning on the UTS strategy.

Possible Cause: No trading strategy which enters positions has been inserted on the chart in addition to
the UTS strategy. The UTS strategy does not make entries - it only exits positions. So if it is inserted by
itself on a chart you will see no Trades or positions entered.

Possible Solution: Insert a trading strategy on the same chart that makes entries.

Problem: No trades are generated on the chart after inserting and turning on both the UTS strategy and
a trading strategy which enters positions.

Possible Cause: If there is insufficient history on the chart ( beyond the Maximum bars the study will
reference – called MaxBarsBack ) the strategy never runs and no trades occur.

Possible Solution: Increase the chart history be setting the chart start date to an earlier date.

Problem: When I turn on the UTS strategy I see an Events Log window pop-up like shown below and the
strategy turns OFF.

Cause: These are user run-time error messages, generated by the strategy when error checking the
Inputs.

Solution: The error message displayed in the Events Log window will tell you what the issue is with the
Input settings. Turn the strategy back on and Format the Inputs to correct the Input settings, and the
strategy will then run.

9
Problem: When I turn on the UTS strategy I see an Events Log window pop-up like shown below stating
the UTS strategy is only allowed to run on so many different automated symbol charts.

Cause: The UTS strategy can run on an unlimited number of charts at the same time when back-testing.
However, the number of Symbols limits the number of AUTOMATED trading charts UTS can be used on.
So the UTS 1 Symbol product only allows you to use it on a single AUTOMATED trading chart. Likewise,
the UTF 5 Symbols product allows you to use it on 5 AUTOMATED trading charts.

Solution: You will need to subscribe to the UTS Symbols product which supports the number of symbols
you want to automatically trade using the UTS strategy. Note that you can combine different UTS
Symbols products: So a UTS 1 Symbol and UTS 5 Symbols products together can be used to
AUTOMATICALLY trade 6 symbols.

CONTACT US
If there are enhancements or issues you would like to discuss please call us at 567-455-6389 or email us
at support@EmeraldTradingTechnologies.com.

10
DISCLAIMER

Neither TradeStation Technologies nor any of its affiliates has reviewed, certified, endorsed, approved,
disapproved or recommended, and neither does or will review, certify, endorse, approve, disapprove, or
recommend any product that offers training, education or consulting regarding the use of
EasyLanguage.

Emerald Trading Technologies, Inc., its employees, affiliates and agents (EMERALD) are NOT soliciting or
offering securities, security derivatives, investment products/services or trading/investment advice.
Investment in securities involves substantial risks and should not be undertaken without understanding
all the risks related to the sale and purchase of securities. You have sole responsibility for determining
the appropriateness of, when and on what terms to engage in any trading transactions. When investing
in securities, YOU CAN LOSE MONEY, INCLUDING MORE THAN YOUR PRINCIPAL.

The software described herein is designed to be a tool to assist you trading. THIS SOFTWARE IS
PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL EMERALD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; FINANCIAL OR
NON-FINANCIAL LOSSES, OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS software, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. Without limiting the foregoing, EMERALD makes no warranty that 1) the
software will meet your requirements, 2) the software will be uninterrupted, timely, secure or error-
free, 3) the results that may be obtained from the use of the software will be effective, accurate or
reliable, 4) the quality of the software will meet your expectations, and 5) any errors in the software will
be corrected. This software and its documentation could include technical or other mistakes,
inaccuracies or typographical errors.

EMERALD may make changes to the software or documentation without notice. The documentation
may be out of date and EMERALD makes no commitment to update such materials. EMERALD assumes
no responsibility for errors or omissions in the software or documentation. In no event shall EMERALD
be liable to you or any third parties for any special, punitive, incidental, indirect or consequential
damages of any kind, or any damages whatsoever, including, without limitation, those resulting from
loss of use, data or profits, financial or non-financial losses, whether or not EMERALD has been advised
of the possibility of such damages, and on any theory of liability, arising out of or in connection with the
use of this software. The use of this software is done at your own discretion and risk and with
agreement that you will be solely responsible for any damage to your computer system or loss of data
that results from such activities. No advice or information, whether oral or written, obtained by you
from EMERALD shall create any warranty for this software.

11

You might also like