示例#1
0
 public Instrument[] Create()
 {
     Instrument[] result = new Instrument[instrDefinitions.SymbolCount];
     int i = 0;
     foreach (string symbol in instrDefinitions.Symbols)
     {
         result[i++] = Create(symbol);
     }
     return result;
 }
示例#2
0
        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]);
            }
        }
示例#3
0
文件: Coint.cs 项目: rc153/LTF
        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);
        }
示例#4
0
 private void Initialize(Id id)
 {
     instr = env.GetUniverseService().GetInstrument(id);
     Initialize();
 }