July 2011 Order2Go Update

From FxCodeBaseWiki

Jump to: navigation, search

The Order2Go official release is scheduled on July. With this release the update will be required. The new Order2Go version provides a lot of great features such as Stop/Limit orders for US-based accounts and many others (find the full list below). Also, in this release there are a few functions that must be used by all Order2Go users. Without this your Order2Go applications may work improperly (see Critical Changes).

Contents

Where To Get?

The latest development build (Jun, 03 2011) can be downloaded here:

Stand Alone Full Installation (FXOrder2Go.EXE)
Microsoft Installer Merge Module Full Installation (Order2GoMSM.msm)
Microsoft Installer Merge Module Redistributable Modules Only (Order2GoMSMComponents.msm)
C++ Interfaces (cpp.zip)
PDB files (pdb.zip)

What's New?

Critical Changes

In this release there are a few functions that must be used by all Order2Go users. Without this your Order2Go applications may work improperly. Please find a list of these functions below.

Trailing Order Properties per Order Type and Instrument

The following properties will be considered deprecated:

  • TradeDeskAut.GetSystemProperty("TRAILING_STOP_DYNAMIC")
  • TradeDeskAut.GetSystemProperty("TRAILING_STOP_MAX" )
  • TradeDeskAut.GetSystemProperty(“TRAILING_STOP_MIN" )
  • TradeDeskAut.GetSystemProperty("TRAILING_STOP_USED ")

Now these properties are defined per instrument and order type. You should use the TradingSettingsProviderAut and PermissionCheckerAut interfaces to get the same properties but per instrument and order type.

  1. TradeDeskAut.GetSystemProperty("TRAILING_STOP_DYNAMIC")
    The property is now defined for entry stop, entry limit, stop and limit orders separately. To retrieve the properties, please use the methods of PermissionCheckerAut instead:
    • CanUseDynamicTrailingForEntryLimit
    • CanUseDynamicTrailingForEntryStop
    • CanUseDynamicTrailingForLimit
    • CanUseDynamicTrailingForStop
    • CanUseFluctuateTrailingForEntryLimit
    • CanUseFluctuateTrailingForEntryStop
    • CanUseFluctuateTrailingForLimit
    • CanUseFluctuateTrailingForStop
  2. TradeDeskAut.GetSystemProperty("TRAILING_STOP_MAX" )
    The property is now defined for entry stop, entry limit, stop and limit separately. To retrieve the properties, please use methods of TradingSettingsProviderAut instead:
    • GetMaxTrailingStepForEntryLimit
    • GetMaxTrailingStepForEntryStop
    • GetMaxTrailingStepForLimit
    • GetMaxTrailingStepForStop
  3. TradeDeskAut.GetSystemProperty(“TRAILING_STOP_MIN" )
    The property is now defined for entry stop, entry limit, stop and limit separately. To retrieve the properties, please use methods of TradingSettingsProviderAut instead:
    • GetMinTrailingStepForEntryLimit
    • GetMinTrailingStepForEntryStop
    • GetMinTrailingStepForLimit
    • GetMinTrailingStepForStop
  4. TradeDeskAut.GetSystemProperty("TRAILING_STOP_USED ")
    The property is now defined for entry stop, entry limit, stop and limit orders separately. To retrieve the properties, please use methods of PermissionCheckerAut instead:
    • CanUseDynamicTrailingForEntryLimit
    • CanUseDynamicTrailingForEntryStop
    • CanUseDynamicTrailingForLimit
    • CanUseDynamicTrailingForStop
    • CanUseFluctuateTrailingForEntryLimit
    • CanUseFluctuateTrailingForEntryStop
    • CanUseFluctuateTrailingForLimit
    • CanUseFluctuateTrailingForStop

MMR and BaseUnitSize per Account and Instrument

In the new version, to retrieve BaseUnitSize and MMR values, you shouldn’t use the BaseUnitSize column of the Accounts table and the MMR column of the Offers table. Unlike in the previous versions, the values must be obtained for a certain account/offer.

To retrieve the values, you should use methods TradingSettingsProviderAut.GetBaseUnitSize and TradingSettingsProviderAut.GetMMR correspondingly.

Example: Get MMR (O2GO, CS)

Monitoring Status of Connection with Price Server

GetPriceHistory, GetPriceHistoryUTC and GetPeriods methods could fail in case they are called before establishing a connection with the price server. For example, if they are called once after login.

In the new version, you should monitor the connection status to prevent failing of methods which work with the price server. They are such methods as: PriceHistoryHelperAut.GetPeriods (which receives a list of available periods), TradeDeskAut.GetPriceHistory, GetPriceHistoryAsync and TradeDeskAut.GetPriceHistoryUTC, GetPriceHistoryUTCAsync (which receive historical prices).

To monitor the status, use events TradeDeskEventsSink.OnPriceSessionStatusChanged or pending events of the kind KIND_PRICESESSIONSTATUSCHANGE.

Also, Order2Go provides a method TradeDeskAut.IsPriceServerConnected to define whether connection with the price server is established.

If the connection status is other than Connected, the methods work with the price server shouldn’t be used.

Trading

Stop/Limit for US-Based Accounts (ELS Orders)

Since Close, Stop and Limit orders on individual trades for all United States based accounts are not functional (as they are not compliant with the National Futures Association (NFA)Compliance Rule 2-43 (b), the special approach is required to handle risk management on such accounts. For this purpose, Order2Go supports new order kind - ELS (Entry with Limit and Stop) orders.

ELS Order (Entry with Limit and Stop) is an order which contains two or three orders - a primary (opening) order and one or two secondary (closing) orders. A primary order can be a market or entry order. Secondary orders can be one limit entry and one stop entry whose trade operation is opposite to that of the primary order. All orders in ELS have the same amount. When the primary order is executed, the secondary orders become active and then work like OCO orders - that is when one of them is executed, the other is automatically cancelled. But unlike OCO orders, ELS orders cannot open new positions, just close the existing ones in accordance with the FIFO rules.

Example: Create ELS Order(O2GO, CS)

Order Time-In-Force

Order2Go provides the ability to specify the duration of entry orders and immediate open and close orders. The order Time-In-Force defines how long the order will remain active before it is executed or expires.

Immediate Order Time-in-Force

Order2Go provides the ability to specify the duration of an immediate open and close order:

  • A GTC order (Good Until Cancelled) indicates that you want to take the full amount of your order. This order may be partially executed.
  • An IOC order (Immediate Or Cancel) indicates that you want to take the maximum available amount of the order. This order can be partially executed, and its remaining part will be cancelled when there is no liquidity.
  • A FOK order (Fill or Kill) indicates that you want the full amount of your order immediately or not at all.

At Best market orders have one of the three Time-In-Force options: GTC, IOC or FOK.

Market Range orders have one of the two Time-In-Force options: IOC or FOK.

To set the order Time-In-Force, use the following methods:

TradeDeskAut.CloseTrade2, CloseTrade2Async]

Example: Set Time In Force for At Best Market Order (O2GO, CS)

Entry Order Time-In-Force

Order2Go provides the ability to specify the duration of your entry order:

  • A GTC order (Good Until Cancelled) indicates that you want the order to remain active until executed or cancelled by you.
  • A DAY order indicates that you want the order to remain active until executed, cancelled by you or until the end of the trading day.

To set entry order Time-In-Force, use the following methods:

Choose Trailing Mode

As now the server supports both trailing modes (dynamic and fixed) simultaneously, Order2Go provides the ability to choose a trailing mode for Entry, Net Stop/Limit and regular Stop/Limit orders.

To support trailing orders, Order2Go provides the following data and methods:

These methods allow choosing which trailing mode (dynamic or fixed) must be used.

Example: Create Trailing Entry Order (O2G, CS)

Change Entry Order Rate and Amount at Once

With the new method TradeDeskAut.ChangeEntryOrder, ChangeEntryOrderAsync, you can change a rate and amount of an entry order at once.

Execution of Multiple Trading Operations at Once

Now it's possible to execute multiple trading operations ("create", "change" or "delete") at once. For example, you can send a batch with a request to open a position and with two requests to create entry orders. For this purpose, the Order2Go provides the interface OrdersBatchAut. Use the methods of the interface to add requests for creating/changing/deleting of orders to a batch. To execute the requests, call the method OrdersBatchAut.Execute, ExecuteAsync

Check Order Amount in Case of Partial Fills

New columns are added to the Orders table. They are intended to determine the filled and remaining quantities of orders in case of partial fills:

  • The OriginQTY column shows the original amount of the order when it was placed.

For an opening order this value is always the same. For a closing order this value will change if the position to which this order is attached is partially closed.

  • The FilledQTY column shows the amount of the last filled portion. Note that in the order deletion message this field has a zero value.
  • The Lot column shows the amount yet to be filled (the remaining amount).

The difference between OriginQTY and Lot is the filled amount.

Example: Monitor Order Execution Using Events Handling (O2GO, CS)

RequestOrderStatus

TradeDeskAut.RequestOrderStatus allows you to receive the Fix Status which corresponds to the FixStatus column of the Orders table.

Asynchronous Execution

Asynchronous Login and Logout

Order2Go provides new asynchronous methods of login and logout:

To get the result of LoginAsync execution, use events TradeDeskEventsSink.OnSessionStatusChanged or pending events of the kind KIND_SESSIONSTATUSCHANGE. If an error occurs during login, the status Disconnected is returned. In this case you can get the text of the error using the TradeDeskAut.LastError property.

Asynchronous Methods to Get Price History

Order2Go provides new asynchronous methods for getting historical prices:

The methods return RequestID. To get a result of the methods execution, use events TradeDeskEventsSink.OnPriceHistoryCompleted or pending events of the kind KIND_PRICEHISTORYCOMPLETED.

Event Processing

Events filter

Order2Go provides the ability to set a filter for events. You can set a filter for events to receive only trading events and not receive events caused by data recalculation. The following method and properties are added to TradeDeskAut:

Trading Settings

Get All Tiers of Margin

Order2Go allows you to get all three tiers of margin:

  • Liquidation margin requirement (LMR, defines the amount of funds required to prevent the liquidation of a one lot position).
  • Maintenance margin requirement (MMR, defines the amount of funds required to maintain a one lot position).
  • Entry margin requirement (EMR, defines the amount of funds required to open a one lot position).

The new method GetMargins is added to the TradingSettingsProviderAut class. The method returns true if the margin policy is three level. In this case you can retrieve MMR/EMR/LMR values from the output parameters of the GetMargins method. Otherwise, the method returns false. In this case you can retrieve MMR value from the first output parameter of the method.

Retrieve Trading Sessions and Check Whether PIN is Required

There are users who have multiple accounts of different types and get access to them using the same login/password. These users must specify the identifier of the trading session to log in. There are also users who use PIN to log in. Order2Go provides the following methods and interfaces to retrieve identifiers of trading sessions and to check whether PIN is required:

These methods get a list of all available trading sessions. The RetrieveTradeSessions method returns an object of SessionDescriptorEnumAut The RetrieveTradeSessionsAsync method is implemented for asynchronous execution. To get a result of the method execution, use events of TradeDeskEventsSink.OnRetrieveSessionsCompleted and TradeDeskEventsSink.OnRetrieveSessionsFailed or pending events of the kinds KIND_SESSIONSLISTCOMPLETED and KIND_SESSIONSLISTFAILED.

It is a collection of SessionDescriptorAut objects. The collection is returned by methods TradeDeskAut.RetrieveTradeSessions, RetrieveTradeSessionsAsync .

The interface keeps information about a trading session and contains the following properties:

    • Description
    • Name
    • RequirePIN
    • SubID

To retrieve the identifier of a trading session, use the property SubID.

To check whether PIN is required for login, use the property RequirePIN.

Example: Get Session List (O2GO, CS)

Price History

PriceHistoryHelperAut

The new helper class FXCore.PriceHistoryHelperAut is added for working with historical prices. The class contains the following methods and properties:

  • GetPeriods (gets identifiers of all price history periods supported by the server).
  • GetCandle (gets the start and end dates of the candle to which a specified date belongs).
  • GetTradingDayOffset (gets the offset between a day's midnight and the date of the beginning of a trading day in the EST time zone).
  • GetTradingDayOffsetUTC (gets the offset between a day's midnight and the specified date in the UTC time zone).
  • GetTradingWeekOffset (gets the offset between a Sunday date and the date of the beginning of a trading week).
  • VolumeSupport (checks whether the server supports the volume).

Example: Create Custom Candle (O2GO, CS)

Support of All Available Time Frames for Price History

All time frames supported by the server are now available in Order2Go. You can get historical prices for any time frame supported by the server using the methods:

To receive a list of available periods, use the method PriceHistoryHelperAut.GetPeriods

Example: Get List of Supported Time Frames (O2GO, CS)

Tick Volume

Price history now contains tick volume. The Volume property is added to the MarketRateAut class. To define whether the server supports tick volume, use the property PriceHistoryHelperAut.VolumeSupport

Example: Get Tick Volume (O2GO, CS)

May, 2011 RC1 Update

May, 10 2011 the RC version has been updated:

1) The tables, orders, error message documentation has been updated to reflect the latest changes on the server side.

Problems fixed: 1) GetMargins returns an internal exception when calling the method for non-subscribed symbols.

2) Incorrect error message when login with empty/incorrect username.

3) GetMargins method returns zeros for some accounts.

4) No events after execution of the method ChangeEntryOrderAsync.

5) Impossible to create ELS order with a primary "market range" order.

Order2Go Hotfix

There are the following issues in the production release of Order2Go (01.07.070811):

  1. An issue with CFDs trading on UK accounts. Sometimes you get the error "The command is disabled" when trying to create an order for CFD. The problem occurs because the Order2Go gets incorrect trading hours for CFDs.
  2. An issue with frequent unnecessary updates of MMR. The problem causes over-usage of the CPU for users who have dozens of accounts with 3-level margin.
  3. An issue with zero PointSize after receiving instrument updates. The problem occurs on systems with a separate price channel.
  4. An issue with creating Stop and Limit orders for an existing entry order on US accounts.
  5. No price coming after 'Disconnected' and then reconnected again
  6. OCO orders error: Could not join into the OCO specified requests types
  7. Stop/Limit rates in pips is not updating when modifying an order
  8. Fail to place Open Range order

To get fixes for all these issues, download the Order2Go release here:

Stand Alone Full Installation (FXOrder2Go.EXE)
Microsoft Installer Merge Module Full Installation (Order2GoMSM.msm)
Microsoft Installer Merge Module Redistributable Modules Only (Order2GoMSMComponents.msm)
C++ Interfaces (cpp.zip)
PDB files (pdb.zip)

Ask Question

Please free to discuss this release at the following forums:

This Article in Other Languages

Language: English  • Español
Personal tools