Exemple #1
0
        public static StrategyFile getInstance()
        {
            if (strategyInstance == null)
            {
                strategyInstance = new StrategyFile();
            }

            return(strategyInstance);
        }
Exemple #2
0
        public static StrategyFile getInstance()
        {

            if (strategyInstance == null)
            {
                strategyInstance = new StrategyFile();
            }

            return strategyInstance;
        }
Exemple #3
0
        public void prepareFirst()
        {
            if (now.Day <= 9)
            {
                nowDay = Convert.ToString("0" + now.Day);
            }
            else
            {
                nowDay = Convert.ToString(now.Day);
            }

            if (now.Month <= 9)
            {
                nowMonth = Convert.ToString("0" + now.Month);
            }
            else
            {
                nowMonth = Convert.ToString(now.Month);
            }


            lotArray = lots.Split(',');

            string appDir = System.Windows.Forms.Application.StartupPath;

            loseLine = new Dictionary<int, int>();

            winLine = new Dictionary<int, int>();

            reverseLine = new Dictionary<int, double>();

            strategyFile = StrategyFile.getInstance();

            strategyFile.dealStrategyRule(appDir);

            this.winLine = strategyFile.getWinLine();

            this.loseLine = strategyFile.getLoseLine();

            this.reverseLine = strategyFile.getReverseLine();

            isPrevWin = false;//上一次交易是否獲利

            //stopTradeTime = new DateTime(now.Year, now.Month, now.Day, 13, 44, 0);


            fileName = appDir + "\\" + Output_Dir + "\\" + "NEW_Daily_" + now.Year + "_" + now.Month + "_" + nowDay + ".rpt";

            allTradeOutputFile = new TradeFile(fileName);

            allTradeOutputFile.prepareWriter();

            tradeRecordFileName = appDir + "\\" + Output_Dir + "\\" + "TradeRecord_" + now.Year + "_" + now.Month + "_" + nowDay + ".rpt";

            tradeRecordFile = new TradeFile(tradeRecordFileName);

            tradeRecordFile.prepareWriter();

            recordList = new List<OriginalRecord>();

            befofeRecord = new OriginalRecord();

            RecordScanner.setRecordList(recordList);

            debugMsg(now + "------<<開始交易>>");

            showParameters();

            prepareOrderAPI();



        }