Using an Absolute Price 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 Absolute price value is used, the value of the stoploss or takeprofit is calculated on each incoming tick. Recall that the Client-Side Stops functionality will not execute unless the EA is attached and running.
One method for using Absolute price values for a stoploss or takeprofit is to use the Highest or Lowest price of the last 12 bars.
This is done in VTS by using the functions fnGetHighest and fnGetLowest found under the Bar menu and then assigning these values as the stoploss and takeprofit values, respectively.
This is a working, simplified drawing showing the technique.
This is the fnOpenOrder configuration window.
On the chart below, the Absolute price values of the high and low were used for the client-side stoploss and takeprofit: These values are displayed on the top left corner of the price chart. These values are updated on every tick.
Notice in the Trade window that the actual order was opened using the default emergency stop values of 5000.