How do I handle 'Futures' symbols with an EA?

 

Hi all,

I've goggled extensively and come up empty and was wondering if anyone has come across the following issue.

For Brokers that offer trading on futures, the symbol naming system is like this; #CLK5 which is 'May 2015 Light, Sweet Crude Oil Futures'.

The K5 part of the symbol name changes depending on which delivery date you are looking at, as is the convention with futures. The symbol stops being valid altogether after the delivery date.

What if you wanted your EA to look at the nearest delivery date for Light, Sweet Crude Oil continuously, so that you could trade it continuously as if it were only one instrument, as opposed to a series of expiring different instruments?

How would you code your EA to look for the appropriate symbol?


As always, very grateful for any responses.

 
Forex_cellence:

Hi all,

I've goggled extensively and come up empty and was wondering if anyone has come across the following issue.

For Brokers that offer trading on futures, the symbol naming system is like this; #CLK5 which is 'May 2015 Light, Sweet Crude Oil Futures'.

The K5 part of the symbol name changes depending on which delivery date you are looking at, as is the convention with futures. The symbol stops being valid altogether after the delivery date.

What if you wanted your EA to look at the nearest delivery date for Light, Sweet Crude Oil continuously, so that you could trade it continuously as if it were only one instrument, as opposed to a series of expiring different instruments?

How would you code your EA to look for the appropriate symbol?


As always, very grateful for any responses.

If there is a convention in the name you can "calculate" them and check the history of the current symbol.
 
Forex_cellence:

Hi all,

I've goggled extensively and come up empty and was wondering if anyone has come across the following issue.

For Brokers that offer trading on futures, the symbol naming system is like this; #CLK5 which is 'May 2015 Light, Sweet Crude Oil Futures'.

The K5 part of the symbol name changes depending on which delivery date you are looking at, as is the convention with futures. The symbol stops being valid altogether after the delivery date.

What if you wanted your EA to look at the nearest delivery date for Light, Sweet Crude Oil continuously, so that you could trade it continuously as if it were only one instrument, as opposed to a series of expiring different instruments?

How would you code your EA to look for the appropriate symbol?


As always, very grateful for any responses.

They are effectively different instruments, with different price and spread, and they overlap their trading periods. If you need a continuous chart, look for CFD rather than futures.

 
Ovo:

They are effectively different instruments, with different price and spread, and they overlap their trading periods. If you need a continuous chart, look for CFD rather than futures.


Some brokers have continuous symbol.  But tradeallowed is no.  You still have to know in your EA the corresponding symbol to be traded.  As mentioned by ange, the symbols are known for the months being traded.
Reason: