Giter VIP home page Giter VIP logo

lean.brokerages.tdameritrade's People

Contributors

borseno avatar jaredbroad avatar jhonabreul avatar martin-molinero avatar rjra2611 avatar romazes avatar sodamnfoolish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lean.brokerages.tdameritrade's Issues

Add Support to All Order Types Available in Lean

Expected Behavior

All order types available in both Lean and TD Ameritrade are supported.
https://developer.tdameritrade.com/account-access/apis/post/accounts/%7BaccountId%7D/orders-0

Actual Behavior

master supports MarketOrder, LimitOrder, StopMarketOrder, StopLimitOrder
while Lean and TD Ameritrade supports also support MarketOnOpen (MOO), MarketOnClose (MOC) and ExerciseOption.

Potential Solution

Implement MOC and MOO orders.

  • ExerciseOption will come with Option support.

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

TD Ameritrade now owned by Schwab

Does this takeover affect this integration? Should the integration be phased-out or renamed?

Per tdameritrade.com

In most cases, it makes sense to open a new account at Schwab, since the best of TD Ameritrade is now available at Schwab, and more. Now you get access to thinkorswim trading platforms and robust trading education at Schwab, along with Schwab's great service, commitment to low costs, and a wide range of wealth management and investing solutions.

However, if you're interested in trading futures and forex products, or using portfolio margin, we recommend that you open a TD Ameritrade account for the best experience.

Futures trading, forex trading and portfolio margin will be available at Schwab in early 2024. Once available, we will move your account to Schwab.

Please note that futures trading, forex trading, and portfolio margin in a TD Ameritrade account is subject to approval. Futures and forex trading services are provided by Charles Schwab Futures and Forex LLC.

Unhandled Argument Out Of Range Exception in ConvertOrder Method

Expected Behavior

Unhandled exceptions should be avoided.

Actual Behavior

The code is trying to access the index of an empty collection:

var symbol = order.OrderLegCollections[0].Instrument.Symbol;

Runtime error:

2023-04-21T18:47:22.5256253Z ERROR:: BrokerageSetupHandler.LoadExistingHoldingsAndOrders():  System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at QuantConnect.Brokerages.TDAmeritrade.Utils.Extensions.ConvertOrder(OrderModel order) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean.Brokerages.TDAmeritrade/QuantConnect.TDAmeritrade/Utils/Extensions.cs:line 198
   at QuantConnect.Brokerages.TDAmeritrade.TDAmeritradeBrokerage.GetOpenOrders() in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean.Brokerages.TDAmeritrade/QuantConnect.TDAmeritrade/TDAmeritradeBrokerage.cs:line 248
   at QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler.GetOpenOrders(IAlgorithm algorithm, IResultHandler resultHandler, ITransactionHandler transactionHandler, IBrokerage brokerage, HashSet`1 supportedSecurityTypes) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/Setup/BrokerageSetupHandler.cs:line 524
   at QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler.LoadExistingHoldingsAndOrders(IBrokerage brokerage, IAlgorithm algorithm, SetupHandlerParameters parameters) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/Lean/Engine/Setup/BrokerageSetupHandler.cs:line 399

Potential Solution

N/A

Reproducing the Problem

Live algorithm fetching open order.

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.