Using an Offset value with Client-Side Stops
The functionality of the StopLoss and TakeProfit parameters of the fnOpenOrder function are the same when using Client-Side Stops.
stoploss |
The value at which to close the trade for a loss.
|
takeprofit |
The value at which to close the trade for a profit.
|
When an Offset value is used, the value of the stoploss or takeprofit is captured at the time the trade is opened and it is stored locally by the EA. The stored value is used to monitor the open trade. The stored value is maintained correctly even if the EA is removed and reattached to the price chart. However, recall that the Client-Side Stops functionality will not execute unless the EA is attached and running.
On the chart below, the default offset values of 200 were used for the Client-Side Stops stoploss and takeprofit: These values are displayed on the top left corner of the price chart.
Notice in the Trade window that the actual order was opened using the default emergency stop values of 5000.