/// <summary> /// 初期化 /// </summary> public void Initialize(SimulateManager manager) { // シュミレート管理取得 m_SimulateManager = manager; // ゲージ制御初期化 foreach (var gauge in m_GaugeControllers) { gauge.Initialize(this); } }
/// <summary> /// 初始化构造函数 /// </summary> public SimulateModel() { smanager = new SimulateManager(); dllmodel = smanager.DllModel; smvars = new List <SimulateVariableUnit>(); AllRoutine = null; MainRoutine = null; SubRoutines = new List <SimuViewDiagramModel>(); AllFuncs = null; FuncBlocks = new List <SimuViewFuncBlockModel>(); SubCharts = new List <SimuViewTabModel>(); }
private void Simulate(int new_startdate, int new_enddate) { this.dg_overview.Rows.Clear(); //仓位股票数量 holdstocknum = (int)txt_num.Value; foreach (int buy_type in Rule.rulebuy_type) { for (int i = 0; i < pnl_buysell2.GetSelectedCombGroup().Length; i++) { sm = new SimulateManager(new_startdate, new_enddate, holdstocknum); combineRule combinerule = pnl_buysell2.GetSelectedCombGroup()[i]; //得到所有符合买卖原则的数据 StockOpeItem[] items = StockAnalysisSQL.GetAnalysis2List(buy_type, new_startdate, new_enddate, combinerule.buy.ToString(), combinerule.sell.ToString(), -0.99, true, //apply default Sell true); foreach (StockOpeItem item in items) { sm.AddOpeItem(item); } sm.Simulate(new_startdate, new_enddate); sm.SaveToDB(buy_type, combinerule.buy.ToString(), combinerule.sell.ToString()); } } }
public virtual void Setup(SimulateManager _manager) { manager = _manager; }