public Instrument[] Create() { Instrument[] result = new Instrument[instrDefinitions.SymbolCount]; int i = 0; foreach (string symbol in instrDefinitions.Symbols) { result[i++] = Create(symbol); } return result; }
public IndexComputer(Instrument[] instrs, double[] weights) { Contract.Requires(instrs.Length == weights.Length); data = new IndexComputerInstrument[instrs.Length]; for (int i = 0; i < instrs.Length; i++) { data[i++] = new IndexComputerInstrument(this, instrs[i], instrs[i], weights[i]); } }
public override void Initialize() { int size = (int)cfg.getDouble("size", 10); sampleTime = Time.fromSeconds(cfg.getDouble("timeSec", 5 * 60)); prices1 = new WrappedArray<FixedPointDecimal>(size); prices2 = new WrappedArray<FixedPointDecimal>(size); Id id2 = env.GetIdService().GetId(cfg.getString("ref"), cfg.getEnum<SymbolType>("symbolType")); instr2 = env.GetUniverseService().GetInstrument(id2); env.Scheduler.ScheduleAfterBackground(sampleTime, sample); }
private void Initialize(Id id) { instr = env.GetUniverseService().GetInstrument(id); Initialize(); }