コード例 #1
0
 public Operation GetOperation(DateTime date, String pair)
 {
     try
     {
         this.loadResult(indicator.getName(), pair);
         DataRow[] rows = this.dtResult.Select("date = '" + date.ToString("dd/MM/yyyy HH:mm:ss") + "' and pair = '" + pair + "' ");
         if (rows.Length > 0)
         {
             lastPriceClose = decimal.Parse(rows[0]["price"].ToString().Replace(".", ","));
             if (rows[0]["operation"].ToString() == "buy")
             {
                 return(Operation.buy);
             }
             if (rows[0]["operation"].ToString() == "sell")
             {
                 return(Operation.sell);
             }
         }
     }
     catch
     {
     }
     return(Operation.nothing);
 }