Closed GoogleCodeExporter closed 8 years ago
I suppose to switch contracts, the current contract might need to be
automatically closed. This presents a question, should it works this way, and
then should it reopen the new position? What do you think the right way to
handle this business logic is?
Original comment by mwillif...@gmail.com
on 9 Jan 2013 at 10:34
JBookTrader is designed specifically for intraday-trading. That is, all current
open contracts are closed by the end time specified in TradingSchedule.java. If
the next day happens to be a rollover day, then the new front month contract
should be traded. The needed code change is to check whether the front month
has changed and to set the contract accordingly. This needs to happen after the
close of the trading interval.
Original comment by eugene.k...@gmail.com
on 9 Jan 2013 at 11:31
Original comment by eugene.k...@gmail.com
on 9 Jan 2013 at 11:31
Original comment by mwillif...@gmail.com
on 10 Jan 2013 at 5:06
Original comment by mwillif...@gmail.com
on 10 Jan 2013 at 5:07
Added another call to TraderAssistant.createMarketBook(), which switches on
crossover this data structure as well now. I see there IS a lot of complexity
and lifecycle of objects with respect to how/when they are all created. I
suspect my solution leaves the old MarketBook structure in memory, in the
marketBooks collection, etc. However, it is too risky at the moment to remove
the old MarketBook, because another strategy might still be trading it (even
though crossover occurs, it's trading hours might still be ongoing).
I renamed the class to: CLNYMEXMostLiquid, as it is really only good for CL
Testing:
- I tested crossover, by forcing a crossover right away with test code, it
worked. At least the new marketBook was created, and started writting to the
filesystem.
Let me know if you have any other testing ideas.
Original comment by mwillif...@gmail.com
on 11 Jan 2013 at 6:42
Original issue reported on code.google.com by
mwillif...@gmail.com
on 9 Jan 2013 at 9:28