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?
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?
Rename
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.
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.
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.
From your answer, I assume that orders created outside WealthLab are not supported without that complex calculation (using the positions) that I mentioned.
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.
Your Response
Post
Edit Post
Login is required