}//end InitializeVariables() // // // // **** Create Copy() **** // public static MarketInstrument CreateCopy(MarketInstrument instrToCopy) { MarketInstrument newInstr = MarketInstrument.Create(instrToCopy.Name, instrToCopy.TickSize, instrToCopy.TickValue); instrToCopy.CopyTo(newInstr); return(newInstr); }//CreateCopy().
// ***************************************************************** // **** Constructors **** // ***************************************************************** public static MarketInstrument Create(string fullName, double tickSize, double tickValue, string serverName = "") { // Try to create the instrument. MarketInstrument instr = new MarketInstrument(); instr.Name = fullName; // Tick information instr.TickSize = tickSize; instr.TickValue = tickValue; instr.InitializeVariables(NMaxDepth); // Exit return(instr); }//Create()
}//end SetMarket(). // // // // **** SetMarket **** // /// <summary> /// This is the "copy" over-loading of SetMarket() /// </summary> /// <param name="instr"></param> private void SetMarket(MarketInstrument instr) { // market - copy entire market for (int side = 0; side < this.Price.Length; ++side) { for (int level = 0; level < this.Price[side].Length; ++level) { this.Price[side][level] = instr.Price[side][level]; this.Qty[side][level] = instr.Qty[side][level]; this.QtyImp[side][level] = instr.QtyImp[side][level]; } } // Trades this.DeepestLevelKnown = instr.DeepestLevelKnown; for (int side = 0; side < this.Volume.Length; ++side) { this.Volume[side] = instr.Volume[side]; } this.IsMarketGood = instr.IsMarketGood; }//end SetMarket()
}//end SetMarket() // // // **** CopyTo() **** // public virtual void CopyTo(MarketInstrument aInstr) { aInstr.SetMarket(this); }//end CopyTo()