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.

  • VTS creates an extern (or Input)  variable named StopLoss that can be used for this parameter;  its default value is 200.
  • A value can be manually entered into the text-box.
  • A value can be selected using the Choose button.
  • A value can be entered as an integer or as a price level by selecting the Offset value or Absolute value button.  The Absolute value option is useful for using technical indicator values or price values such as Low[1] or High[1].

takeprofit

The value at which to close the trade for a profit.

  • VTS creates an extern (or Input)  variable named TakeProfit that can be used for this parameter;  its default value is 200.
  • A value can be manually entered into the text-box.
  • A value can be selected using the Choose button.
  • A value can be entered as an integer or as a price level by selecting the Offset value or Absolute value button.  The Absolute value option is useful for using technical indicator values or price values such as Low[1] or High[1].


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.


Related Topics:
Property Window
Welcome Screen
Assignment
Condition
TRADESIGNAL Manager
COMMUNICATION Manager
Message
Logic
MetaTrader Platform Configuration
Compiler
Compiler Flags
Platform
Editor
EA Output Folder
Custom Indicator Folder
License
fnOpenOrder
init and deinit
Journal Tab
Experts Tab
Step 1
Step 2
Step 4
Logic
Using Easy Email from the Communication Manager
Using Easy Email from any Element
Testing the Easy Email Connection
Using FX PowerGrid
Using the Exit Plug-in
Using the Profit Manager
Using Client-Side Stops
Using an Offset Value
Building an Expert Advisor to draw and manage a Fibonacci retracement
Configuring the Weight and Threshold
EA-Indicator Plug-in
Enable the EA-Indicator Plug-in
Using the EA-Indicator Plug-in
Custom Indicators in the Toolbox
EA-Indicator Price Chart
EA-Indicator Video
EA Secure Plug-in
Enbale the EA Secure Plug-in
EA Secure Plug-in System Manager
EA Secure Configuration
EA Secure on Price Charts
Chart Execute Plug-in
Chart Execute on Price Chart
Using Chart Execute
Chart Execute Notes
Money Manager Plug-in
Money Management Table
Package Plug-in
Load a Package
fnRemoveAllPivots
Using the Multi Trade Plug-in
Using the Debug Manager Plug-in
Debug Manager Plug-in on a VTS Drawing
Event Manager Plug-in
Using the Event Manager
MQL Event Documentation