Andres1 wrote:
the code doesn't respect that statement and open orders with an instrument that isnt subscribed?
Obvioulsy you can't open orders for instruments that are not subscribed, you can find out already subscribed instruments by calling
ICotext.getSubscribedInstruments. In work with live data the strategy works with all instruments that are currently subscribed by the platform.
IContext.setSubscribedInstruments (use the 2-argument method for synchronous subscription) is for the case when you need to make sure to have the particular instruments subscribed, but it will not remove the instruments that are already subscribed in the platform. Please read our wiki:
https://www.dukascopy.com/wiki/#Subscribe_to_an_instrument