private static void SubscribeToPricesWithCustomFactory(string username, string lightstreamerUrl, ApiLogOnResponseDTO logonResponse, int validMarketId)
{
var cityindexStreamingConnection = new DefaultCityindexStreamingConnectionFactory().Create(new Uri(lightstreamerUrl + "/CITYINDEXSTREAMING"), username, logonResponse.Session);
cityindexStreamingConnection.Connect();
PriceStream priceStream = new PriceStream(cityindexStreamingConnection);
priceStream.SubscribeToMarketPrice(validMarketId);
priceStream.PriceChanged += new PriceChangedEventHandler(CustomPriceStream_PriceChanged);
}