@Override
    public void excute() throws RserveException, REXPMismatchException, ParseException, Exception{
        //執行這項前須已執行過setTestStockSymbol,setTestEndDate, setTestStartDate,setBestK,setBestN
        try{    
            REXP x;
            String checkUrl = c.eval("plotUrl").asString();
            String checkBestn = c.eval("Bestn").asString();
            String checkBestk = c.eval("Bestk").asString();
            String checkTestData = c.eval("exists('TestData')").asString();
            
//            c.eval("filterTest <- filterTesting(\"http://ichart.finance.yahoo.com/table.csv?s=1537.TW&a=0&b=1&c=2013&d=11&e=1&f=2013&g=d\", 20, 0.1, 'C:/Users/Leon/Documents/NetBeansProjects/OTTZ_ver4/web/Rimage/Filter/20140407231228.png')"); 
            c.eval("filterTest <- filterTesting(TestData, Bestn, Bestk, plotUrl)");
            
            
            //檢查是否有交易點,有可能有一筆買點無賣點 故檢查賣點日期[1,3]是否為NA, NA是R的null值
            String check1 = c.eval("filterTest$buysell[1,3]").asString();
            boolean checkBuysell = "NA".equals(c.eval("filterTest$buysell[1,3]").asString());            
            
            int nRow;
            int ncol;
            if(checkBuysell){
                this.hasTrade = false;
                this.revenueTrade = "0";
            }
            else{
                //-----------紀錄此測試交易平均收益參數
                this.revenueTrade = c.eval("filterTest$revenue").asString();
            
                nRow = c.eval("nrow(filterTest$buysell)").asInteger();
                ncol = c.eval("ncol(filterTest$buysell)").asInteger();
                
                //R的基本單位是vector, 故此處一次取一條vector放入二維陣列 再迴圈輸入arrayList
                String[][] arrayTrade = new String[nRow][ncol];
                for(int i =1; i <= nRow; i++)
                {
                    x = c.eval("as.character(filterTest$buysell[" + i + ",])"); //此處取得的是R的vector(單維陣列)
                    arrayTrade[i-1] = x.asStrings();
                }
                
                listTrade = new ArrayList<TradeRecord>();
                TradeRecord tr;
                for(String[] s: arrayTrade){
                    tr = new TradeRecord();
                    tr.setBuyDate(s[0]);
                    tr.setBuyPrice(s[1]);
                    tr.setSellDate(s[2]);
                    tr.setSellPrice(s[3]);
                    listTrade.add(tr);
                }
                
            }
            //產生testingCode
            this.testingCode = setTestingCode(testFullDate_start, testFullDate_end, testStockSymbol, bestN, bestK);

        }catch(RserveException e){
            throw new Exception("發生Rserve Exception: " + e);
        }
        
    }