public static StrategyProc getInstance(Spread spread) { if (instance == null) { instance = new StrategyProc(spread); } return (instance); }
public Session() { spread = new Spread(); instrumentA = new Instrument(); instrumentB = new Instrument(); instruments = new List<Instrument>(); instruments.Add(instrumentA); instruments.Add(instrumentB); }
private StrategyProc(Spread spread) { this.spread = spread; orders = new List<SpreadOrder>(); lastfill = new Dictionary<string, double>(); closeouts = new Dictionary<string, Thread>(); offOrders = new Dictionary<string, Order>(); fillbugs = new Dictionary<string, SpreadOrder>(); scratchLegs = new Queue<Order>(); procSpread = SpreadProc.getInstance(); procSpread.OnFill += this.OnFill; procSpread.OnUpdate += this.OnUpdate; }
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(); }
public void resetStrategy(Session session) { signal.resetparams( new object[] { session.spread.Threshold ,session.spread.TrendFollow ,session.spread.PriceLength ,session.spread.Signal }); spread = session.spread; }
public SignalFactory(Spread spread) { this.spread = spread; this.signalName = spread.Signal.ToUpper(); }