public void SetTInstrument(StrategyQTP strategy, TInstrument target) { this.strategy = strategy; this.target = target; barsBuffer = new List<Bar>(); ticksBuffer = new List<Tick>(); }
private static List<TInstrument> GetTInstruments(int poolId) { List<TInstrument> list = new List<TInstrument>(); using (SqlConnection connection = new SqlConnection(ConnectionString)) { SqlCommand command = new SqlCommand(string.Format("SELECT * FROM PoolInstrument WHERE PoolId={0}", poolId), connection); command.Connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { TInstrument ins = new TInstrument(); ins.Exchange = ((string)reader["Exchange"]).Trim(); ins.InstrumentId = ((string)reader["InstrumentId"]).Trim(); ins.MinPosition = (int)reader["MinPosition"]; ins.MonitorClass = (string)reader["MonitorClass"]; list.Add(ins); } command.Connection.Close(); } return list; }
public Monitor(MyStrategy strategy, TInstrument target, TAInfo taInfo, string dllName) { this.strategy = strategy; this.target = target; this.ta = new TA(this, taInfo, dllName); this.barBuffer = new List<Bar>(); this.tickBuffer = new List<Tick>(); }