public method host:execute("getTradingProperty", ...);
Brief
Returns a trading property.
Declaration | ||
|
Parameters | |
name |
The name of the property. |
instrument |
The name of the instrument. Specify |
account |
The identifier of the account. Specify |
Details
Note: This function is optional and may be not supported by the host application.
The method can be used in both indicators and strategies.
See the table below for the list of the properties supported.
Name |
Type |
Description |
Required parameters. |
||||||||
ReportURL |
String |
The basic URL which can be used to get the report. Add the following parameters to the URL to get the report:
|
account |
||||||||
canCreateEntry |
Boolean |
Checks whether the entry order can be created for the specified account and instrument. |
instrument, account |
||||||||
canCreateMarketOpen |
Boolean |
Checks whether the market open order can be created for the specified account and instrument. |
instrument, account |
||||||||
canCreateMarketClose |
Boolean |
Checks whether the market close order can be created for the specified account and instrument. |
instrument, account |
||||||||
canCreateStopLimit |
Boolean |
Checks whether the conditional (stop, limit) close order can be created for the specified account and instrument. |
instrument, account |
||||||||
canCreateNetStopLimit |
Boolean |
Checks whether netting conditional (stop, limit) close order can be created for the specified instrument. |
instrument |
||||||||
canUseDynamicTrailingForEntryLimit |
Boolean |
Checks whether dynamic trailing order can be used for the entry limit orders. |
none |
||||||||
canUseDynamicTrailingForEntryStop |
Boolean |
Checks whether dynamic trailing order can be used for the entry stop orders. |
none |
||||||||
canUseDynamicTrailingForLimit |
Boolean |
Checks whether dynamic trailing order can be used for the limit orders. |
none |
||||||||
canUseDynamicTrailingForStop |
Boolean |
Checks whether dynamic trailing order can be used for the stop orders. |
none |
||||||||
canUseFluctuateTrailingForEntryLimit |
Boolean |
Checks whether fluctuating trailing order can be used for the entry limit orders. |
none |
||||||||
canUseFluctuateTrailingForEntryStop |
Boolean |
Checks whether fluctuating trailing order can be used for the entry stop orders. |
none |
||||||||
canUseFluctuateTrailingForLimit |
Boolean |
Checks whether fluctuating trailing order can be used for the limit orders. |
none |
||||||||
canUseFluctuateTrailingForStop |
Boolean |
Checks whether fluctuating trailing order can be used for the stop orders. |
none |
||||||||
baseUnitSize |
Number |
The size of one lot, i.e. the minimum amount per trade that is allowed on the instrument on the account. The value is expressed in contracts. |
instrument, account |
||||||||
MMR |
Number |
Maintenance Margin Requirement. See Account Mathematics article for details. The amount is expressed in the currency of the account specified. |
instrument, account |
||||||||
EMR |
Number |
Entry Margin Requirement for 3-level margin accounts. See Account Mathematics article for details. The amount is expressed in the currency of the account specified. In case the account is 1-level margin account, the MMR value is returned. |
instrument, account |
||||||||
LMR |
Number |
Liquidation Margin Requirement for 3-level margin accounts. See Account Mathematics article for details. The amount is expressed in the currency of the account specified. In case the account is 1-level margin account, the MMR value is returned. |
instrument, account |
||||||||
conditionalDistanceEntryLimit |
Number |
The minimal distance between the rates of the entry limit order and the current market rate. The distance is expressed in pips. |
instrument |
||||||||
conditionalDistanceEntryStop |
Number |
The minimal distance between the rates of the entry stop order and the current market rate. The distance is expressed in pips. |
instrument |
||||||||
conditionalDistanceLimitForEntry |
Number |
The minimal distance between the rates of a limit order attached to an entry order and the current market rate. The distance is expressed in pips. |
instrument |
||||||||
conditionalDistanceStopForEntry |
Number |
The minimal distance between the rates of a stop order attached to an entry order and the current market rate. The distance is expressed in pips. |
instrument |
||||||||
conditionalDistanceLimitForTrade |
Number |
The minimal distance between the rates of a limit order attached to a trade and the current market rate. The distance is expressed in pips. |
instrument |
||||||||
conditionalDistanceStopForTrade |
Number |
The minimal distance between the rates of a stop order attached to a trade order and the current market rate. The distance is expressed in pips. |
instrument |
||||||||
marketStatus |
Boolean |
Checks whether the instrument is tradeable. |
instrument |
||||||||
maxQuantity |
Number |
The maximum size of a trade or of a market order. The value is expressed in lots. |
instrument, account |
||||||||
minQuantity |
Number |
The minimum size of a trade or of a market order. The value is expressed in lots. |
instrument, account |
||||||||
UserName |
String |
The name of the currently logged in user. |
|||||||||
SessionID |
String |
The ID of the current session. |
Example: Check whether close orders are permitted for the account and instrument of the strategy [hide]
function Init() ... strategy.parameters:addString("Account", "Account to trade", "", ""); strategy.parameters:setFlag("Account", core.FLAG_ACCOUNT); ... end ... function Prepare() ... local canClose = core.host:execute("getTradingProperty", "canCreateMarketClose", instance.bid:instrument(), instance.parameters.Account); ... end