public static Market getInstance(string[] tickers ) { if (instance == null) { instance = new Market(tickers); } return (instance); }
public Zscore(Spread spread) { procSpread = SpreadProc.getInstance(); this.tickers = new string[] { procSpread.productOne.Product ,procSpread.productTwo.Product }; this.multipliers = new double[] {procSpread.productOne.InstrumentMultiplier ,procSpread.productTwo.InstrumentMultiplier }; this.ratio = new int[] { procSpread.productOne.Size, procSpread.productTwo.Size }; market = Market.getInstance(tickers); this.spreads = new List<Quote>(); this.zslist = new List<double>(); this.threshold = spread.Threshold; this.trendfollow = spread.TrendFollow; this.pricelength = spread.PriceLength; this.signame = spread.Signal; this.signame = signame.ToUpper(); }
//called only once when we connect. public void init() { string[] tickers = new string[] { procSpread.productOne.Product ,procSpread.productTwo.Product }; market = Market.getInstance( tickers); SignalFactory factory = new SignalFactory(spread); signal = factory.create(); signal.TradeEvt += this.OnTrade; }