The request definition which you submit as a parameter to
Useful note! The Run Script widget in the MyTrader platform provides interactive help on constructing the properties for trading requests. If you use Create From > Trading Action it will show you the script and request settings corresponding to a set of options in the deal ticket.
For the purposes of trading requests, the
Particularly when opening orders and trades, some options can be specified in multiple forms. This saves your code from doing its own calculations, and makes it easier to translate from user interface fields to properties in a trading request. For example, all the following (and others listed below) are valid ways of specifying the volume when opening a new order or trade:
| Example | Description |
| volume: 10000 | Standard request, defining volume in terms of cash/units |
| volume: {lots: 0.1} | Framework converts the specified lots quantity to cash/units using the |
| volume: {equityPercent: 0.5} | Can only be used in combination with a stop-loss. The framework calculates the trade volume such that the cash value of hitting the stop-loss is (a maximum of) the specified percentage of current account equity |
In other words, the framework lets you send a request saying "stop-loss at 50 pips and risking 1% of account equity" without needing to do all the accompanying calculations yourself in your own code:
Framework.SendOrder({
sl: {pips: 50},
volume: {equityPercent: 1},
…
The asynchronous