For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
How to assign an open position to a datafeed?
-
Given that we are trading live using IBBroker &
Ourdata.tradeContract
!=data.contract
&
We have an open position overnight &
Cerebro shutsdown at session end.How do we bind yesterday's open position of
data.tradeContract
todata
?In order to close the trade we use
self.close
method.
This works in the same session, as the open position oftradeContract
is bound todata
. What and where do we need to explicitly code to enable this for the next trading session?