tradeid - multiple strategies on same symbol
i have a broker that is utilizing multiple strategies and multiple symbols. Some of these strategies might also utilize the same symbols to trade.
The question is if while using
tradeidwhen I open the trade clearly i need to have a buy order such as :
self.buy(data=data-4-this-order, size=size, tradeid=current_id)
what is not clear, when I close the trade using
self.closedo I need to also include the data? IE
am I incorrect in thinking that I should be able to use
self.close()with just those two bits of info and no mater how many shares on on that particular symbol from other strategies, it will close just the shares for the strategy that is placing the order for that matching tradeid?
This was already answered in another post and your assumption is nowhere to be found that things are separated by strategy.
The broker is a single account broker. Anything you do, you do it on a single account. Positions will be closed on that account and
tradeidis just a marker for the separation of an artificial thing which is a
Trade(a collection of operations)
do I need to also include the data?
If you don't, the 1st data in the system will be used. This is in the documentation.