Пример #1
0
        public void Init(string symbol)
        {
            m_symbol = symbol;
            java.lang.System.setOut(new PrintStream(new ByteArrayOutputStream()));
            java.util.TimeZone.setDefault(java.util.TimeZone.getTimeZone("GMT"));

            if (string.IsNullOrEmpty(TestParameters.TestName) || TestParameters.TestName == TestParameters.DefaultTestName)
            {
                if (TestParameters2.DBDataConsistent)
                {
                    TestParameters.TestName = "MTTestDb_" + m_symbol;
                }
                else
                {
                    TestParameters.TestName = "MTTest_" + m_symbol;
                }
            }
            AllocConsole();

            bool initAll = true;

            if (initAll)
            {
                //Feng.Data.DbHelper.Instance.ExecuteNonQuery("truncate table [Forex_MT].[dbo].[EURUSD_{0}]");
                //Feng.Data.DbHelper.Instance.ExecuteNonQuery("truncate table [Forex_MT].[dbo].[EURUSD_M1]");
                //Feng.Data.DbHelper.Instance.ExecuteNonQuery("truncate table [Forex_MT].[dbo].[EURUSD_HP]");

                System.IO.File.Delete(string.Format("{0}\\console.txt", TestParameters.BaseDir));

                foreach (string s in System.IO.Directory.GetFiles(TestParameters.BaseDir, "*_ccScores_*.txt"))
                {
                    System.IO.File.Delete(s);
                }
                //foreach (string s in System.IO.Directory.GetFiles(TestParameters.BaseDir, "*_hpdata.txt.full"))
                //{
                //    System.IO.File.Delete(s);
                //}
            }

            TestParameters2.RealTimeMode     = true;
            TestParameters2.DBDataConsistent = false;

            //TestParameters2.InitParameters(symbol, "D1", 4);

            TestParameters2.InitParameters(symbol, "M15", 1);
            if (TestParameters.TpMaxCount != 20)
            {
                throw new AssertException("TpSlMaxCount should be 20.");
            }
            TestParameters2.CandidateParameter.InitTpsls(TestParameters.GetTpSlMinDelta(symbol) * TestParameters2.nTpsl,
                                                         TestParameters.TpMaxCount / TestParameters2.nTpsl,
                                                         TestParameters.SlMaxCount / TestParameters2.nTpsl);

            m_mleaRealTime.Init();

            TestParameters2.OutputParameters();
        }