protected override void SetupInitialize(IEngineHub myEngineHub, IEngineContainer engineContainer, int engineID, bool setupGui) { base.SetupInitialize(myEngineHub, engineContainer, engineID, setupGui); m_Hub = (Hub)myEngineHub; this.m_Log = m_Hub.Log; // set up our logging this.m_ExecutionContainer = (ExecutionContainer)engineContainer; }
// // protected override void SetupInitialize(IEngineHub myEngineHub, IEngineContainer engineContainer, int engineID, bool setupGui) { base.SetupInitialize(myEngineHub, engineContainer, engineID, setupGui); ExecutionContainer execContainer = (ExecutionContainer)engineContainer; execContainer.TryAddEngine(m_Hedger); // add my sub engines to the container. execContainer.TryAddEngine(m_HedgeRuleManager); }
// // ************************************************************* // **** Setup Initialize() **** // ************************************************************* /// <summary> /// Since I depend critically on an OrderBookHub, I will look for them now. /// </summary> /// <param name="myEngineHub"></param> /// <param name="engineContainer"></param> /// <param name="engineID"></param> /// <param name="setupGui"></param> protected override void SetupInitialize(IEngineHub myEngineHub, IEngineContainer engineContainer, int engineID, bool setupGui) { base.SetupInitialize(myEngineHub, engineContainer, engineID, false); EngineGui engineGui = base.SetupGuiTemplates(); engineGui.LowerHudFullName = typeof(OrderEngineHud).FullName; // Collect services that I need. m_Hub = (Hub)myEngineHub; this.Log = m_Hub.Log; m_ExecutionContainer = (ExecutionContainer)engineContainer; }// SetupInitialize()
public void Execution(ExecutionContainer e) { if (!letterMatrix.ignore) { executeCounter++; if (/*executesMadeCounter < executeCounter*/ true) { letterMatrix.currentBlockDone = true; e?.Invoke(); executesMadeCounter++; } } }
// // protected override void SetupInitialize(IEngineHub myEngineHub, IEngineContainer engineContainer, int engineID, bool setupGui) { this.m_EngineName = string.Format("HedgeRuleManager:{0}", m_QuoterLeg.m_PriceLeg.InstrumentName); base.SetupInitialize(myEngineHub, engineContainer, engineID, setupGui); m_Hedger = m_QuoterLeg.m_Hedger; m_Log = ((ExecutionHub)myEngineHub).Log; ExecutionContainer execContainer = (ExecutionContainer)engineContainer; m_HedgeRules.OrderBy(x => x.RuleNumber); // sort our list by the rule number, so they get called in order! foreach (HedgeRule rule in m_HedgeRules) // check that they are all unique, and add them to our container { if (!m_PriorityToRule.ContainsKey(rule.RuleNumber)) { m_PriorityToRule.Add(rule.RuleNumber, rule); execContainer.TryAddEngine((Engine)rule); // add my sub engines to the container. } else { m_Log.NewEntry(LogLevel.Error, "HedgeRuleManager: Failed to find unique hedge rules"); throw new Exception("HedgeRuleManager: Failed to find unique hedge rules"); } } }