internal void OnFundamental(Fundamental fundamental) { if (this.strategy != null && this.strategy.status == StrategyStatus.Running) { this.strategy.OnFundamental_(fundamental); } }
public override object Read(BinaryReader reader) { reader.ReadByte(); Fundamental fundamental = new Fundamental(); fundamental.dateTime = new DateTime(reader.ReadInt64()); fundamental.providerId = reader.ReadInt32(); fundamental.instrumentId = reader.ReadInt32(); int num = reader.ReadInt32(); for (int i = 0; i < num; i++) { fundamental.fields[i] = reader.ReadDouble(); } return fundamental; }
internal virtual void OnFundamental_(Fundamental fundamental) { if (this.raiseEvents && this.instruments.Contains(fundamental.instrumentId)) { this.OnFundamental(this.framework.InstrumentManager.GetById(fundamental.instrumentId), fundamental); } LinkedList <Strategy> linkedList = this.strategiesByInstrument[fundamental.instrumentId]; if (linkedList != null) { for (LinkedListNode <Strategy> linkedListNode = linkedList.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Data.OnFundamental_(fundamental); } } }
public override object Read(BinaryReader reader) { reader.ReadByte(); Fundamental fundamental = new Fundamental(); fundamental.dateTime = new DateTime(reader.ReadInt64()); fundamental.providerId = reader.ReadInt32(); fundamental.instrumentId = reader.ReadInt32(); int num = reader.ReadInt32(); for (int i = 0; i < num; i++) { fundamental.fields[i] = reader.ReadDouble(); } return(fundamental); }
private void OnFundamental(Event e) { this.data_count += 1L; Fundamental fundamental = (Fundamental)e; if (this.framework.Clock.Mode == ClockMode.Simulation) { this.framework.Clock.DateTime = fundamental.dateTime; } else { fundamental.dateTime = this.framework.clock.DateTime; } this.framework.dataManager.OnFundamental(fundamental); this.framework.strategyManager.OnFundamental(fundamental); }
public override void Write(BinaryWriter writer, object obj) { byte value = 0; writer.Write(value); Fundamental fundamental = (Fundamental)obj; writer.Write(fundamental.dateTime.Ticks); writer.Write(fundamental.providerId); writer.Write(fundamental.instrumentId); if (fundamental.fields != null) { writer.Write(fundamental.fields.Size); for (int i = 0; i < fundamental.fields.Size; i++) { writer.Write(fundamental.fields[i]); } return; } int value2 = 0; writer.Write(value2); }
protected internal virtual void OnFundamental(Instrument instrument, Fundamental fundamental) { }
internal virtual void OnFundamental_(Fundamental fundamental) { if (this.raiseEvents && this.instruments.Contains(fundamental.instrumentId)) { this.OnFundamental(this.framework.InstrumentManager.GetById(fundamental.instrumentId), fundamental); } LinkedList<Strategy> linkedList = this.strategiesByInstrument[fundamental.instrumentId]; if (linkedList != null) { for (LinkedListNode<Strategy> linkedListNode = linkedList.First; linkedListNode != null; linkedListNode = linkedListNode.Next) { linkedListNode.Data.OnFundamental_(fundamental); } } }
internal void OnFundamental(Fundamental fundamental) { this.fundamental[fundamental.instrumentId] = fundamental; }