The Profit Exit function fnAtrExit  executes a trailing stop using the Average True Range (ATR) indicator.


The open order is trailed using the value of the ATR calculated at the close of the last bar.  

For example, if the value of the ATR is 15, the order is trailed by 15 points (or PIPs).


The period parameter is used to define the period used to calculate the ATR.


The count parameter is used as a multiple of the ATR value.  

For example, if the value of the ATR is 15 and the value of the count parameter is 2, then the order is trailed by 30 points (or PIPs)


After the fnAtrExit function has been added to a Drawing, it is configured by clicking the (+) button along the bottom of the Element.

The Function Configuration window allows you to select values for each parameter.



The following table provides information about each parameter of the fnAtrExit function.


Order Selection

Determines what orders of the Account are monitored.

  • All: all open orders on the account.
  • Symbol: only open orders matching the selected symbol.
  • Order Type: only open orders of the selected order type.
  • MagicNumber: only open orders with a matching magicnumber.
  • Exact Ticket: only open orders with the matching order ticket.

Note: Selecting Exact Ticket disables all other selection criteria.

period

The period used to calculate the ATR value.

count

A multiplier applied to the ATR value.