ShowShortStop (Function)

image\trumpet2.gif Disclaimer

The ShowShortStop function adds text to a chart that displays the stop level on the chart for a short-side stop.  This function is designed for use only with strategies.

Syntax

ShowShortStop(StopVal)

Returns (Integer)

In addition to displaying "Stop--", the function itself returns a numeric value representing the current market position (-1 for short, 1 for long, and 0 for no position).

Parameters

Name

Type

Description

StopVal

Numeric

Sets the stop value where the text will be displayed.

Remarks

The function adds the text "Stop--". If the stop value is beyond the upper/lower limit of the chart, the text will not appear unless the chart scaling is adjusted to include that area. In addition, the function returns the current market position that is assigned to a variable.

Example

Will display the "Stop--" at the lowest Low of the last two bars while the market position is long:

Value1 = ShowLongStop(Lowest(Low, 2));

Additional Example

If you wanted to show the stop text for a short trailing stop, you could use the following:

Variables: StopValue(0);

If Close Crosses Below
Average(Close, 18) Then
 SellShort This Bar on Close;

StopValue
= Highest(High, 2);

If MarketPosition
= -1 Then
 BuyToCover Next Bar at StopValue Stop;

Value1
= ShowLongStop(StopValue);