static public field O2GResponseType.MARGIN_REQUIREMENTS_RESPONSE
Brief
The constant represents the type of a response to a request for margin requirements information.
Details
Margin requirements for subscribed instruments are available after a successful login.
They can be obtained by calling the following methods:
The O2GTradingSettingsProvider.getMMR method that is used for the accounts with the one-level margin policy.
The methods of the O2GMargin class that are used for the accounts with the three-level margin policy.
Margin requirement for the unsubscribed instruments are not loaded by the ForexConnect API during the login process. If you subscribe to an instrument during a session, to get margin requirements for this instrument, create a request.
First, you must assign the Constants.Commands.UpdateMarginRequirements
value to the O2GRequestParamsEnum.COMMAND parameter by using the
O2GValueMap.setString method. For example,
valueMap.setString(O2GRequestParamsEnum.COMMAND, Constants.Commands.UpdateMarginRequirements);
Then you must create a request by passing the value map as an argument to the
O2GRequestFactory
.createOrderRequest
method. For example,
O2GRequest request = requestFactory.createOrderRequest(valueMap);
And finally, you must send the request by using the O2GSession.sendRequest method.
For example,
mSession.sendRequest(request);
The response to this request is of the MARGIN_REQUIREMENTS_RESPONSE
type. An instance of the
O2GResponse
class is the response
parameter in your implementation of the
IO2GResponseListener
.onRequestCompleted
method.
The response must be processed by the
O2GResponseReaderFactory.processMarginRequirementsResponse method.
For example,
responseFactory.processMarginRequirementsResponse(response);
For complete description and an example, refer to the Update Margin Requirements section.
Declared in O2GResponseType