EasyLanguage Reserved Words & Functions

SetStopLoss (Reserved Word)

image\trumpet2.gif Disclaimer

SetStopLoss is a built-in stop reserved word that enables you to specify the amount of money you are willing to risk either on a total position basis, or a one contract or one share basis. Within a strategy an order to close your entire position is generated once the stop loss amount has been reached. Whether the stop loss amount is based on a position or per share/contract basis is determined by set stop reserved words: SetStopPosition,  SetStopShare, or  SetStopContract

When used with an automated strategy where orders are being generated into the real-world, the stop exit order is monitored and the order held on your computer, once the Stop Loss amount is reached, a market order is generated and sent to be executed.  If you lose internet connectivity, you no longer have a working stop.

Normally strategies generate orders on the close of the bar for execution on the next bar, SetStopLoss allows you to generate orders and exit on the same bar as the bar of entry, this is especially useful when working with longer during bars, (e.g. 30-min, 60-min, daily, weekly, monthly).

SetStopLoss can only be used in a Strategy.

Usage

SetStopLoss(Amount)

Input Parameters

Name Type Description
Amount Numeric Amount of loss, in dollars, at which point the position will be closed.

Examples

When used with the SetStopPosition reserved word, the Amount parameter sets the stop loss as a dollar amount for the entire position based on the total number of shares or contracts in the current open position. (if you held 500 shares of MSFT and specified $200 stop loss amount, you would exit $0.40 from your entry price.)

SetStopPosition;

SetStopLoss(200);

(SetStopPosition is the default setting and is optional)

When used with the SetStopShare or SetStopContract reserved words, the Amount parameter sets the stop loss as a one share or one contract amount.  (if you held 500 shares of MSFT and specified $0.60 stop loss amount, you would exit .60 from your entry price with a $300 loss.)

SetStopShare;

SetStopLoss(.60);

(SetStopShare and SetStopContract are synonymous and both work for stock, futures, options, etc.)

Orders Generated

Market Order to Sell (Long Exit) or Market Order to Buy to Cover (Short Exit)

Signal Name

Stop Loss

Related Topics

StopLoss (strategy) , ProfitTarget (strategy) , SetProfitTarget , SetStopPosition , SetStopShare , SetStopContract