While writing this, I noticed something about contract switchover (in general) in jbooktrader. It only appears to happen when the strategy is created in the constructor. So, if my theory is correct, we may have a bug if someone kept their jbooktrader open for a long long time, across the futures crossover date. I have not confirmed this, but to be safe I'd recommend restarting jbook every day on securities that have expiration close in.
While writing this, I noticed something about contract switchover (in general) in jbooktrader. It only appears to happen when the strategy is created in the constructor. So, if my theory is correct, we may have a bug if someone kept their jbooktrader open for a long long time, across the futures crossover date. I have not confirmed this, but to be safe I'd recommend restarting jbook every day on securities that have expiration close in.That's correct, Marcus. The contract will not rollover until JBT is restarted. It's not an issue for me, as I restart every day, but some people run JBT continuously weeks and months at a time. So this would be good to fix.
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To post to this group, send email to jbook...@googlegroups.com.
To unsubscribe from this group, send email to jbooktrader...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jbooktrader?hl=en.
As for restarting JBT, you need to look into this special program:
http://sourceforge.net/projects/ibcontroller
I think that is the right one. It's a java program which launches TWS,
but intercepts window messages and automatically changes the
auto-logout time.
For those who might be interested, I wrote support for the NYMEX Future of CL (Light Sweet Crude). The NYMEX security expires 3 business days prior to the 25th, and if the 25th falls on a weekend, add more days. So it follows these rules.Marcus
--
You received this message because you are subscribed to the Google Groups "JBookTrader" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jbooktrader/-/nfUJGJHA7esJ.
It has one setting that is important, the VOLUME_CROSSOVER_BEFORE_EXP. This controls when the system will switch to the next months contract. Currently, for my test, this is set to 8 business days. I think this might be slightly too early to switch over, I'll need to collect some data before I'll know for sure.
Contract contract = ContractFactory.makeFutureContract("CL", "NYMEX");byContract contract = ContractFactory.makeFutureContract("CL", "NYMEX", "201302");