In real-time netting opposing positions are netted immediately and as soon as this happens they are removed from the (open) Positions tab to a new tab called Closed Positions.
Consider the example before, where we first bought and then sold 100000 EURUSD. This now looks like this:
When the first trade is made (Buy 100.000 EURUSD), you will see an open position for Long 100.000 EURUSD. But as soon as you make the closing trade (Sell 100.000 EURUSD), the entry in the open positions tab will be removed. Instead you will be able to find the now closed position in the "Closed Positions" tab.
If you call OpenAPI:
- the calls to /port/v1/positions and port/v1/netpositions will return an empty list.
- the call to /port/v1/closedpositions will return information about the closed position
Further notice that it is no longer possible to place orders related directly to an open position. In the example below I have made two consecutive Buy 100.000 and Buy 150.000 GBPUSD trades. This is now displayed as follows (after clicking the " # " button:
e
Notice:
- It is not possible to place orders related to an individual position.
- If you press the "Add" button, you will get a "Place Order" dialog, and the dialog will be pre-filled with an amount the size of the open position. However the placed orders will not be directly related to the net position.
To illustrate this, below I have pressed the "Add" button twice to stop-loss/take profit order, each time getting a dialog like this:
This results in two sets of OCO orders, non of them being related directly to any position or net position.
In real-time netting mode we do distinguish between P/L on closed vs. open margin positions. To accommodate for this, the /port/balances/endpoint return two additional fields "UnrealizedMarginOpenProfitLoss and UnrealizedMarginClosedProfitLoss. The "UnrealizedProfitLoss" field has been retained for backwards compatibility and has the value of the sum of the two new additional fields.
Finally, in real-time netting mode it is not possible to exercise individual option positions. You can only exercise (parts of) an option. To do this you must use the /trade/v1/positions/exercise endpoint.
Real-time Netting and ENS
At Saxo Real-time netting is implemented as a simulation of what will actually happen in our back-office system over night!
In reality the two opposing positions still exist, they are just no longer visible in the UI or available through /port/v1/positions.
So in the above situation:
- You will get a BUY 100.000 EURUSD "New Position" event, with the positionId of the fist position, when the first trade is made.
- You will get a SELL 100.000 EURUSD "New Position" event with the positionId of the second position, when the second trade is made.
When the positions are netted over night by our back-office system, you will get two "Deleted Position"events.
What to be aware of when switching from EOD netting to Real-time netting
An application, which has so far worked well when the client is set up for EOD netting may experience the following differences:
- It is no longer possible to relate orders to positions.
- Also, if you place a three-way order (entry+ stop loss/take profit order), once the entry order has been executed and the two related orders become working, these orders will also not be related to the newly created position.
- Opposing positions are netted immediately and removed from the /port/v1/positions and /port/v1/netpositions resources.
- Netted positions are available as closed positions through the /port/v1/closedpositions resource. However notice that the netted positions resource does not link back to the full detail of the individual open positions.
- One consequence of this is that if an application expects to be able to place an order and then keep monitoring the (open) positions, to see when the order is executed, then this will not work if the position is a closing position! To get summary information about the closing position you may instead call port/v1/closedpositions.
- If you are solely relying on ENS to keep track of your "open positions" you will experience a temporary discrepancy as ENS will have sent you two "New Positions" events as soon as the trades are entered, but the ENS messages identifying the removal of those positions are only received EOD.
- It is also no longer possible to exercise individual option positions. Instead use the /trade/v1/positions/exercise endpoint to exercise a specified amount out of the total net position amount.
What should you do as a developer?
First, find out if you even have to support both netting modes:
- If you are a Saxo Bank White Label or Introducing Broker, you may choose that your clients will only be allowed to use one of these, and thus your application may only need to support one mode.
- If you are developing a general 3rd party application, which will be used by Saxo Bank clients throughout the world, you must be prepared to support several netting modes. At least your application must detect if the client has selected the mode you support, and if not, inform the client and ask him/her to switch to the mode you support.
If you are going to support both netting modes, start by making some trades in SaxoTraderGO in both modes to make sure you understand how they work. Then go implement!
Note that the biggest difference in the two modes, is that real-time netting no longer allows placing orders directly against a specific position. But it is not actually a requirement to do so in EOD mode. So you should be able to support both modes, if your application:
- Refrains from placing orders related to positions
- Refrains from exercising individual positions.
- Checks if there are entries in the port/v1/closedpositions resource and then displays these.
Generally, if you are building an interactive UI, where each user logs in with their individual access token, your application can simply subscribe to /port/v1/positions and port/v1/closedpostions, and show the information provided and updated through those resources. Then you will get a picture, which matches what is shown in Saxo's own trading platform.