- ago
I am creating a custom-coded Broker Adapter.

My broker backend returns either Buy or Sell for an order type. However, WealthLab requires the transaction type to be one of Buy, Sell, Short or Cover.

Is there any way or an example to deduce/determine the correct TransactionType for the active orders from the plain Buy/Sell type returned by the broker?

Currently, I am enumerating all orders (executed and active) to determine which are Entry orders and which are Exit orders by looking at the positions they might have opened/closed. However, my implementation doesn't seem to give me enough confidence.

Is there any better way to do this?
0
242
3 Replies

Reply

Bookmark

Sort
Cone8
 ( 4.98% )
- ago
#1
The broker doesn't generate orders, your adapter does.
Buy and Cover Transactions are BUY.
Sell and Short Transactions are SELL.

Edit:
I missed the about active orders. You have the OrderId. Your adapter should remember the orders that it sent and you can match it with active orders.
0
- ago
#2
Thanks Cone

From your answer, I assume that orders created outside WealthLab are not supported without that complex calculation (using the positions) that I mentioned.
0
Cone8
 ( 4.98% )
- ago
#3
I don't really know what you're talking about. There's some scenario dealing with positions and orders that you're really familiar with and I am not.
0

Reply

Bookmark

Sort