Ejemplo n.º 1
0
        /// <summary>
        /// Create a new trade with a given name.
        /// Returns the created trade.
        /// </summary>
        protected Trade CreateTrade(string name)
        {
            var trade = new Trade()
            {
                Name = name, Open = true, Tags = new List <Tag>()
            };

            TradesRepository.Add(trade);
            OpenTrades.Add(trade);

            Logger.Log(LogLevel.Info, "User script {0} created trade {1}", this.GetType().Name, trade);

            return(trade);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a new trade
 /// </summary>
 /// <param name="newTrade">Trade object</param>
 /// <returns></returns>
 public async Task Add(int portfolioId, Trade newTrade)
 {
     await _tradesRepository.Add(portfolioId, newTrade);
 }