fnOpenOrder
- The fnOpenOrder function it used to open a new order (position).
- The fnOpenOrder function is found in the Functions Toolbox under the Trade menu.
- The fnOpenOrder function is a user-friendly front end for the MQL function OrderSend.
- Selecting the configuration (+) button of fnOpenOrder function will display the fnOpenOrder Configuration Window.
- There are four tabs on the fnOpenOrder Configuration Window:
- The Configure Tab is used to set the values of the parameters of the Function.
- The Advanced Tab is used to set the values of the advanced parameters of the Function.
- The Message Tab is used to send a message from the Function Element.
- The Notes Tab is used to add notes or comments to the Function Element.
The following table provides information about each parameter of the fnOpenOrder function.
symbol |
The symbol name of the currency. CHART specifies the the currency of the chart to which the EA is attached. |
cmd |
The type of order: |
price |
The price at which to enter the order. MetaTrader usually requires Buy orders to use the Ask price and Sell orders to use the Bid price. These are the VTSdefault values for the price parameter. |
slippage |
The amount of points, as an integer, the price can move from the requested open price. VTS creates an extern (or Input) variable named Slippage that can be used for this parameter; its default value is 3. |
lots |
The number of lots to open.
|
stoploss |
The value at which to close the trade for a loss.
|
takeprofit |
The value at which to close the trade for a profit.
|
trailingstop |
The trailing stop option is enabled by checking the Use Trailing Stop checkbox.
|
comment |
A string of text that is assigned to the order. This text is displayed in the Trade tab of the MetaTrader platform. Note: The MetaTrader broker may change this text when the order is modified. |
magicnumber (advanced) |
The unique integer number used to identify an open trade.
|
expiration (advanced) |
A datetime value that causes the order to expire. Only used for non-market orders. |
arrow_color (advanced) |
The color of the arrow drawn on the price chart. |
The bottom portion of the window allows the Element Name to be saved.