Category Archives: futures

CME Lumber Changes

While I don’t typically actively trade Lumber Futures, I do track their prices. I recently was confused by a change to the symbol at Barchart.com from LS to LB.

I found this very helpful article about the change in the contract. Much more changed than just the symbol, the dimensions and other specifics about the contract changed as well.

https://www.lesprom.com/en/news/Everything_you_need_to_know_about_new_CME_lumber_futures_contract_107712/

The size of the contract is much smaller, from about a train car of lumber to a truck of lumber. Also the prices don’t really match up so this should be added as a new item and not spliced back into the old Lumber contract. This is a fairly substantial change.

Backtrader Data Frustruation

I’ve been working on a day-trading algorithm for backtrader using stock data (primarily SPY and QQQ for now). Sometimes it appears that the data doesn’t completely come through and the system doesn’t quite initialize. I now think I know what is going on.

First, the fix…I shortened the maximum parameter for an ATR parameter that I was using. When this was shortened (using 60 minute data, to 300 bars or fewer) the code started working as anticipated.

Why did this work? I believe using some levels of granularity the historical data retrieved is insufficient to allow all of the indicators to fully populate. This was tricky to narrow down because 1 minute data worked and 120 minute data worked but 60 minute data didn’t. I don’t know that the Interactive Brokers API gives you the same amount of data each time, so in some cases it appears less data is retrieved resulting in in my case ATR to not fully populate and leaving me in the “prenext” area of backtrader, not making it to the “next” method.