We have choosen a freely available strategy based on a scientific paper from Quantpedia to show how we can implement a strategy that requires a characteristic of an asset that is not found in equity, forex or CDF: the term structure. The term structure of futures contracts refers to the price curve formed by the prices of futures contracts over various expiration months. 

The following strategy relies on the idea that commodity futures prices depend on the net positions of hedgers. The general message is that producers and consumers of the underlying commodity transfer the risk of price fluctuations to speculators, who are willing to undertake this risk in the hope of a large positive return. If the supply by short hedgers exceeds the demand by long hedgers (namely, hedgers are net short), the futures price today has to be a downward-biased estimate of the futures price at maturity. This is to induce speculators to take long positions in commodity futures markets. The increase in the futures price as maturity approaches is referred to as normal backwardation. Conversely, if hedgers are net long, the futures price today has to exceed the futures price at maturity to 
persuade speculators to take short positions in commodity futures markets. The decrease in the futures price as maturity approaches is traditionally referred to as contango. Thus, normal backwardation and contango arise as a result of the inequality between the long and short positions of hedgers, which require the intervention of speculators to restore equilibrium. (source)

If commodity futures returns directly relate to the propensity of hedgers to be net long or net short, it becomes natural to design an active strategy that buys backwardated contracts and shorts contangoed contracts. The price gap between different-maturity contracts, called roll-return (R) or implied yield, can be used as a signal of whether a market is in backwardation or contango:

// R = (log(Pn) - log(Pd)) * 365 / (Td - Tn) // R - Roll returns // Pn - Nearest contract price // Pd - Distant contract price // Tn - Nearest contract expire date // Pd - Distant contract expire date

Simple trading strategy:
This simple strategy buys each month the 20% of commodities with the highest roll-returns and shorts the 20% of commodities with the lowest roll-returns and holds the long-short positions for one month. The contracts in each quintile are equally-weighted. The investment universe is all commodity futures contracts.

This exercise was an opportunity to use the TradingCalendar object, introduced with the Options and Futures Support, that informs us about a variety of events relevant to currently trading instruments.

Unfortunatelly, for the tested period, the strategy is not as profitable as announced at Quantpedia, where the period is 1979-2004. However, since there are a strong confidence in anomaly's validity, there is probably margin for improvement.

Note: this strategy was proposed by  at this thread.

Author