static public field O2GResponseType.MarginRequirementsResponse
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 O2GTradingSettingsProvider.getMMR method that is used for the accounts with the one-level margin policy.
Margin requirements for 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 MarginRequirementsResponse
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