public STR_Skel_EnterExitUI(String key, ProcessState_EnterExit parent, InOutType ioType, double indicator) { InitializeComponent(); _key = key; _parent = parent; _ioType = ioType; this._indicator = indicator; SetValue(); ExecuteAutoHotKey(); }
IProcessState_KtbSkel CheckAnd_Enter(double indicator, RawMarketData spotRmd, RawMarketData futureRmd) { long enterNotional = GetTargetNotional_Enter(indicator, spotRmd, futureRmd); if (enterNotional >= 10) { //Enter IInOutPolicy inPolicy = new InPolicy(); ProcessState_EnterExit entering = new ProcessState_EnterExit( indicator, _parent, enterNotional, spotRmd, futureRmd, inPolicy, !_unittestVersion); logger.Info("KtbSkel State from default --> entering."); return entering.Run(indicator, spotRmd, futureRmd); } return this; }
void TestKtbSkelProcess_Exiting_Constructor_Raw(ProcessController_KtbSkel controller) { RawMarketData spotRmd = RmdManager.Ins().KtbSpot.GetData(controller.Parent.SpotCode); RawMarketData futureRmd = RmdManager.Ins().Future.GetData(controller.Parent.FutureCode); spotRmd = spotRmd.Clone() as RawMarketData; futureRmd = futureRmd.Clone() as RawMarketData; spotRmd.BidPrice1 = 8888F; spotRmd.AskPrice1 = 8889F; futureRmd.BidPrice1 = 107.01F; futureRmd.AskPrice1 = 107.02F; IInOutPolicy exitPolicy = new OutPolicy(); ProcessState_EnterExit process = new ProcessState_EnterExit( 1.0F, controller, 10, spotRmd, futureRmd, exitPolicy, false); ProcessState_EnterExit_Accessor acc = new ProcessState_EnterExit_Accessor(new PrivateObject(process)); Assert.AreEqual(acc._enterExitPolicy.GetInOutType(), InOutType.OutType); }