コード例 #1
0
ファイル: StrategyFile.cs プロジェクト: ifzz/AutoTrade
        public static StrategyFile getInstance()
        {
            if (strategyInstance == null)
            {
                strategyInstance = new StrategyFile();
            }

            return(strategyInstance);
        }
コード例 #2
0
ファイル: StrategyFile.cs プロジェクト: ifzz/AutoTrade
        public static StrategyFile getInstance()
        {

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

            return strategyInstance;
        }
コード例 #3
0
ファイル: TradeMaster.cs プロジェクト: ifzz/AutoTrade
        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();



        }