Ejemplo n.º 1
0
 public static Trade CreateTrade(Security security, System.DateTime datetime, double price, double volume, string tradeno, SmartCOM3Lib.StOrder_Action action)
 {
     return new Trade()
     {
         ID = tradeno,
         Time = datetime,
         Price = (decimal)price,
         Volume = (decimal)volume,
         Direction = SmartToSide(action).Value,
         Security = security
     };
 }
Ejemplo n.º 2
0
        public static eSide? SmartToSide(SmartCOM3Lib.StOrder_Action action)
        {
            switch (action)
            {
                case SmartCOM3Lib.StOrder_Action.StOrder_Action_Buy :
                    {
                        return eSide.Buy;
                    }
                case SmartCOM3Lib.StOrder_Action.StOrder_Action_Sell :
                    {
                        return eSide.Sell;
                    }
                default:
                    break;
            }

            return null;
        }
Ejemplo n.º 3
0
 private void _smartServer_SetMyTrade(int row, int nrows, string portfolio, string symbol, System.DateTime datetime, double price, double volume, string tradeno, SmartCOM3Lib.StOrder_Action buysell, string orderno)
 {
     //TODO 
 }
Ejemplo n.º 4
0
 private void _smartServer_SetMyOrder(int row, int nrows, string portfolio, string symbol, SmartCOM3Lib.StOrder_State state, SmartCOM3Lib.StOrder_Action action, SmartCOM3Lib.StOrder_Type type, SmartCOM3Lib.StOrder_Validity validity, double price, double amount, double stop, double filled, System.DateTime datetime, string id, string no, int cookie)
 {
     //TODO
 }
Ejemplo n.º 5
0
 private void _smartServer_UpdateOrder(string portfolio, string symbol, SmartCOM3Lib.StOrder_State state, SmartCOM3Lib.StOrder_Action action, SmartCOM3Lib.StOrder_Type type, SmartCOM3Lib.StOrder_Validity validity, double price, double amount, double stop, double filled, System.DateTime datetime, string orderid, string orderno, int status_mask, int cookie)
 {
     //TODO
 }
Ejemplo n.º 6
0
 private void _smartServer_AddTick(string symbol, System.DateTime datetime, double price, double volume, string tradeno, SmartCOM3Lib.StOrder_Action action)
 {
     Trade trade = Helpers.CreateTrade(this.Lookup(symbol, "Symbol"), datetime, price, volume, tradeno, action);
     if (trade != null)
     {
         OnNewTrades(trade);
     }
 }
Ejemplo n.º 7
0
 private void _smartServer_AddPortfolio(int row, int nrows, string portfolioName, string portfolioExch, SmartCOM3Lib.StPortfolioStatus portfolioStatus)
 {
     if (portfolioStatus == StPortfolioStatus.StPortfolioStatus_Broker)
     {
         Portfolios.Add(new Portfolio(portfolioName, portfolioExch));
         _smartServer.ListenPortfolio(portfolioName);
     }
     if (row == nrows) OnNewPortfolios(Portfolios);
 }