Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new <see cref="IBrokerageModel"/> for the specified <see cref="BrokerageName"/>
        /// </summary>
        /// <param name="brokerage">The name of the brokerage</param>
        /// <param name="accountType">The account type</param>
        /// <returns>The model for the specified brokerage</returns>
        public static IBrokerageModel Create(BrokerageName brokerage, AccountType accountType)
        {
            switch (brokerage)
            {
            case BrokerageName.Default:
                return(new DefaultBrokerageModel(accountType));

            case BrokerageName.InteractiveBrokersBrokerage:
                return(new InteractiveBrokersBrokerageModel(accountType));

            case BrokerageName.TradierBrokerage:
                return(new TradierBrokerageModel(accountType));

            case BrokerageName.OandaBrokerage:
                return(new OandaBrokerageModel(accountType));

            case BrokerageName.FxcmBrokerage:
                return(new FxcmBrokerageModel(accountType));

            case BrokerageName.Bitfinex:
                return(new BitfinexBrokerageModel(accountType));

            case BrokerageName.GDAX:
                return(new GDAXBrokerageModel(accountType));

            case BrokerageName.Alpaca:
                return(new AlpacaBrokerageModel(accountType));

            case BrokerageName.AlphaStreams:
                return(new AlphaStreamsBrokerageModel(accountType));

            default:
                throw new ArgumentOutOfRangeException(nameof(brokerage), brokerage, null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new <see cref="IBrokerageModel"/> for the specified <see cref="BrokerageName"/>
        /// </summary>
        /// <param name="brokerage">The name of the brokerage</param>
        /// <param name="accountType">The account type</param>
        /// <returns>The model for the specified brokerage</returns>
        public static IBrokerageModel Create(BrokerageName brokerage, AccountType accountType)
        {
            switch (brokerage)
            {
            case BrokerageName.Default:
                return(new DefaultBrokerageModel(accountType));

            case BrokerageName.InteractiveBrokersBrokerage:
                return(new InteractiveBrokersBrokerageModel(accountType));

            case BrokerageName.TradierBrokerage:
                return(new TradierBrokerageModel(accountType));

            case BrokerageName.OandaBrokerage:
                return(new OandaBrokerageModel(accountType));

            case BrokerageName.FxcmBrokerage:
                return(new FxcmBrokerageModel(accountType));

            case BrokerageName.TEB:
                return(new TEBBrokerageModel(accountType));

            default:
                throw new ArgumentOutOfRangeException("brokerage", brokerage, null);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new <see cref="IBrokerageModel"/> for the specified <see cref="BrokerageName"/>
        /// </summary>
        /// <param name="orderProvider">The order provider</param>
        /// <param name="brokerage">The name of the brokerage</param>
        /// <param name="accountType">The account type</param>
        /// <returns>The model for the specified brokerage</returns>
        public static IBrokerageModel Create(IOrderProvider orderProvider, BrokerageName brokerage, AccountType accountType)
        {
            switch (brokerage)
            {
            case BrokerageName.Default:
                return(new DefaultBrokerageModel(accountType));

            case BrokerageName.InteractiveBrokersBrokerage:
                return(new InteractiveBrokersBrokerageModel(accountType));

            case BrokerageName.TradierBrokerage:
                return(new TradierBrokerageModel(accountType));

            case BrokerageName.OandaBrokerage:
                return(new OandaBrokerageModel(accountType));

            case BrokerageName.FxcmBrokerage:
                return(new FxcmBrokerageModel(accountType));

            case BrokerageName.Bitfinex:
                return(new BitfinexBrokerageModel(accountType));

            case BrokerageName.Binance:
                return(new BinanceBrokerageModel(accountType));

            case BrokerageName.GDAX:
                return(new GDAXBrokerageModel(accountType));

            case BrokerageName.AlphaStreams:
                return(new AlphaStreamsBrokerageModel(accountType));

            case BrokerageName.Zerodha:
                return(new ZerodhaBrokerageModel(accountType));

            case BrokerageName.Atreyu:
                return(new AtreyuBrokerageModel(accountType));

            case BrokerageName.TradingTechnologies:
                return(new TradingTechnologiesBrokerageModel(accountType));

            case BrokerageName.Samco:
                return(new SamcoBrokerageModel(accountType));

            case BrokerageName.Kraken:
                return(new KrakenBrokerageModel(accountType));

            case BrokerageName.Exante:
                return(new ExanteBrokerageModel(accountType));

            case BrokerageName.FTX:
                return(new FTXBrokerageModel(accountType));

            case BrokerageName.FTXUS:
                return(new FTXUSBrokerageModel(accountType));

            default:
                throw new ArgumentOutOfRangeException(nameof(brokerage), brokerage, null);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Sets the brokerage to emulate in backtesting or paper trading.
        /// This can be used for brokerages that have been implemented in LEAN
        /// </summary>
        /// <param name="brokerage">The brokerage to emulate</param>
        public void SetBrokerageModel(BrokerageName brokerage)
        {
            switch (brokerage)
            {
            case BrokerageName.Default:
                BrokerageModel = new DefaultBrokerageModel();
                break;

            case BrokerageName.InteractiveBrokersBrokerage:
                BrokerageModel = new InteractiveBrokersBrokerageModel();
                break;

            case BrokerageName.TradierBrokerage:
                BrokerageModel = new TradierBrokerageModel();
                break;

            default:
                throw new ArgumentOutOfRangeException("brokerage", brokerage, null);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Creates a new <see cref="IBrokerageModel"/> for the specified <see cref="BrokerageName"/>
        /// </summary>
        /// <param name="brokerage">The name of the brokerage</param>
        /// <param name="accountType">The account type</param>
        /// <returns>The model for the specified brokerage</returns>
        public static IBrokerageModel Create(BrokerageName brokerage, AccountType accountType)
        {
            switch (brokerage)
            {
                case BrokerageName.Default:
                    return new DefaultBrokerageModel(accountType);

                case BrokerageName.InteractiveBrokersBrokerage:
                    return new InteractiveBrokersBrokerageModel(accountType);

                case BrokerageName.TradierBrokerage:
                    return new TradierBrokerageModel(accountType);
                    
                case BrokerageName.OandaBrokerage:
                    return new OandaBrokerageModel(accountType);
                    
                case BrokerageName.FxcmBrokerage:
                    return new FxcmBrokerageModel(accountType);
                    
                default:
                    throw new ArgumentOutOfRangeException("brokerage", brokerage, null);
            }
        }