예제 #1
0
 public TradeAlert(string stockCode, string strategy, AppTypes.TimeScale timeScale, DateTime onDateTime,
                    double price, double volume, TradePointInfo tradePoint)
 {
     this.StockCode = stockCode;
     this.TimeScale = timeScale;
     this.Strategy = strategy;
     this.OnDateTime = onDateTime;
     this.Price = price;
     this.Volume = volume;
     this.TradePoint = tradePoint;
 }
예제 #2
0
 //[ServiceKnownType(typeof(TradePointInfo[]))]
 public TradePointInfo[] Analysis(string dataKey, string strategyCode)
 {
     try
     {
         TradePointInfo[] tradePointList = new TradePointInfo[0];
         application.AnalysisData data = GetAnalysisData(dataKey);
         if (data == null) return tradePointList;
         application.Strategy.StrategyMeta meta = application.Strategy.StrategyLibs.FindMetaByCode(strategyCode);
         if (meta == null) return tradePointList;
         return application.Strategy.StrategyLibs.ToTradePointInfo(application.Strategy.StrategyLibs.Analysis(data, meta));
     }
     catch (Exception ex)
     {
         WriteSysLogLocal("WS004", ex);
     }
     return null;
 }
예제 #3
0
 private static void CreateTradeAlert(data.baseDS.tradeAlertDataTable tradeAlertTbl,string portfolioCode,
                                      string stockCode, string strategy, AppTypes.TimeScale timeScale, TradePointInfo info, DateTime onTime, string msg)
 {
     data.baseDS.tradeAlertRow row = tradeAlertTbl.NewtradeAlertRow();
     data.AppLibs.InitData(row);
     row.onTime = onTime;
     row.portfolio = portfolioCode;
     row.stockCode = stockCode;
     row.timeScale = timeScale.Code; 
     row.strategy = strategy; 
     row.status = (byte)AppTypes.CommonStatus.New; 
     row.tradeAction = (byte)info.TradeAction;
     row.subject = info.TradeAction.ToString();
     row.msg = msg;
     tradeAlertTbl.AddtradeAlertRow(row);
 }
예제 #4
0
 //[ServiceKnownType(typeof(TradePointInfo[]))]
 public TradePointInfo[] Analysis(string dataKey, string strategyCode)
 {
     TradePointInfo[] tradePointList = new TradePointInfo[0];
     AnalysisData data = GetAnalysisData(dataKey);
     if (data == null) return tradePointList;
     application.Strategy.Meta meta = application.Strategy.Libs.FindMetaByCode(strategyCode);
     if (meta == null) return tradePointList;
     return application.Strategy.Libs.ToTradePointInfo(application.Strategy.Libs.Analysis(data, meta));
 }