(Although obviously different, the distinction between "Account" and "Connection" can largely be "put to one side" for the purposes of discussion here unless otherwise emphasised.)
When Configuring Connections, the different Available Connection Types sometimes have an option to specify Demo, and sometimes not. If the Connection Type is for a Data Provider Only, it makes sense if the Demo option is not there, since these are not Accounts in the true sense. For broker Connections, however, given they most likely connect an Account, one would expect it to be there for all brokers, not just some. For example, NinjaTrader FXCM Connections can have Demo specified, but FOREX.com Connections cannot, even though FOREX.com also offers Demo accounts.
There are various Connection.Options that are useful in trying to determine the type of Account to which a Connection connects: CanManageOrders, IsDataProviderOnly, Mode. If IsDataProviderOnly is true, one might presume the Connection is not for a Demo or Live Account. Nevertheless, that does not mean that if IsDataProviderOnly is false the Connection is for a broker Account. The Free NinjaTrader Forex Data connection (It's fantastic. Thanks, NinjaTrader!) has IsDataProviderOnly set to false, but does not act as a broker Account; it only provides data to facilitate Simulation Accounts. Mode can be either Live or Simulated, but that does not provide the differentiation required to distinguish between the three possibilities. For example, the Free NinjaTrader Forex Data connection is Mode.Live, whereas an FXCM Demo Account is Mode.Simulation.
Questions:
- Why are some broker Connections able to have Demo specified, whilst others are not?
- Can all broker Connections have this option made available?
- If the option is available, how can the state of the option for the Connection be queried from an AddOn?
- Whether or not the Demo option is available in any Connection Type, how can one unequivocally determine if any Connection is Simulation, Demo or Live by reference to a "direct" state (e.g. bool), rather than having to intuit that from a name or a mix of other (potential inaccurate) set states (e.g. Connection.Options).
Thanks.
Comment