Pylivetrader fails to call `order_target_percent` if there are untradable stocks
See original GitHub issueIf your portfolio has stocks that are stuck/untradable, and you attempt any sort of order_target_percent
action, Pylivetrader crashes when it attempts to lookup the stock price of said-stuck-stock.
It doesn’t matter how large or small the percent is, when the order_target_percent
method is invoked it tries to evaluate the size of the portfolio (ie lookup the existing stocks) and the whole action fails.
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (15 by maintainers)
Top Results From Across the Web
What's an untradeable stock? - Robinhood
Stocks may not be searchable, or may be labeled as untradable for a few reasons: The exchange has paused trading. The stock was...
Read more >Fails-to-Deliver Data - SEC.gov
File Format Size
File: November 2022, second half Format:ZIP Size:1.4 MB
File: November 2022, first half Format:ZIP Size:1.11 MB
File: October 2022, second half Format:ZIP Size:1.35...
Read more >alpacahq/pylivetrader: Python live trade execution ... - GitHub
pylivetrader run starts live trading using your algorithm script. It starts by calling the initialize() function if any, and waits until the market...
Read more >What Is Failure to Deliver, and What Happens With FTDs?
Failure to deliver (FTD) refers to a situation where one party in a transaction does not meet their obligation to either pay for...
Read more >Why are some stocks suddenly unavailable to trade? - Webull
However, if one stock is going through a corporate action, the affected stock may be temporarily unavailable for trading while the changes are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i also have the same problem. [2020-09-15 15:07:06.867731] ERROR: Executor: Cannot order TMF, as it not tradable Traceback (most recent call last): File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/executor/executor.py”, line 67, in wrapper func(*args, **kwargs) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/executor/executor.py”, line 88, in every_bar handle_data(algo, current_data, dt_to_use) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/misc/events.py”, line 218, in handle_data dt, File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/misc/events.py”, line 237, in handle_data self.callback(context, data) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/algorithm.py”, line 236, in handle_data self._handle_data(self, data) File “algo.py”, line 64, in handle_data order_target_percent(tmf_symbol, 0.3) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/misc/api_context.py”, line 62, in wrapped return getattr(algorithm, f.name)(*args, **kwargs) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/algorithm.py”, line 621, in order_target_percent amount = self._calculate_order_target_percent_amount(asset, target) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/algorithm.py”, line 860, in _calculate_order_target_percent_amount target_amount = self._calculate_order_percent_amount(asset, target) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/algorithm.py”, line 850, in _calculate_order_percent_amount return self._calculate_order_value_amount(asset, value) File “/usr/local/anaconda3/envs/trade/lib/python3.6/site-packages/pylivetrader/algorithm.py”, line 825, in _calculate_order_value_amount msg=“Cannot order {0}, as it not tradable”.format(asset.symbol) pylivetrader.errors.CannotOrderDelistedAsset: Cannot order TMF, as it not tradable
closing due to lack of activity. please re-open if still relevant