I binge watched every video in this series yesterday because it was exactly what I was looking for. Your design and execution is truly awesome! Thanks!
Hi Alex, it's cool to follow along. Have you explained exactly how to populate the config.ini file? It's a bit confusing from first video, such as 1. what is client id? do you mean "consumer key" from your app 2. is redirect uri simply the callback url? 3. what is json path ?
Yeah, I was horribly inconsistent at the beginning with the naming convention. I'm fairly sure I confused a lot of people with that. If you want a sample on how to populate the config file, I made a sample for everyone on GitHub. Here is the link to the sample: github.com/areed1192/python-trading-robot/blob/master/config/write_config.py Just remember that the client ID is just the Consumer Key that TD provides you, the Redirect URI is the Callback URL, and the JSON path is the file path that you want the library to use when it comes to storing your refresh and access token.
Could you provide a roadmap for python specifically for financial markets/algorithmic trading ,,, or perhaps a video on how to navigate your channel on the first videos to watch to maximise our learning... Thank you in advance
Hello, I love your videos! I had two questions: 1. What is the procedure for interacting with a pre-existing portfolio that won't disappear once the script stops? 2. Using your robot, is there a way to get a list of all stocks that fit a given set of parameters, rather than starting with the stock symbol?
Alex, great job on these videos and this library. I think its going to be super helpful for me developing my trading ideas. Quick question: 1. Is there a history of price with the buy/sell orders? I'm running your golden cross strategy now as a test, and I see the orders.json output file with the orders showing up, but I don't see a price associated. Is there a different P/L history file I should be looking at? Also as a feature suggestion, it would be great to have a graphical library integrated (matplotlib or other) so we can chart out our buys/sells for signal tweaking and idea generation. I know this wouldn't be difficult, but I'm a novice coder so would take me a while to figure out myself. Thanks!
You technically need to make another call to the "orders" endpoint with the Order ID to see what the order was filled at. They don't return that info when you place the order, they just provide the ID. Also, I'm one step ahead of you. :) There is a plan to show how to use Plotly with the data when we host the trading strategy on Azure.
@@SigmaCoding , awesome to hear! Also, as I've been working through the code and setting up my testing scenario, I'm running into an issue pulling different periods for the RSI. Here's my code: # Add 14-period RSI indicator_client.rsi(period=14, method='wilders', column_name='rsi_14') # Add 21-period RSI indicator_client.rsi(period=9, method='wilders', column_name='rsi_21') I'm only getting returned one rsi, and the column label isn't applied (so I'm assuming the 2nd one is overwriting the 1st) Current Stock Frame: open close high low volume rsi symbol datetime QQQ 2020-12-22 00:35:00 309.24 309.32 309.33 309.20 1528 97.710839 2020-12-22 00:40:00 309.34 309.33 309.36 309.33 1633 97.798892 2020-12-22 00:45:00 309.34 309.17 309.34 309.17 2170 96.503595 2020-12-22 00:50:00 309.18 309.06 309.21 309.05 3999 95.417552 2020-12-22 00:55:00 309.05 309.07 309.09 308.99 7887 95.828478 Any idea how to fix this?
Hi Alex, Thanks for your video and the resources. I saw that the definition of wait_till_next_bar uses next_bar_time = last_bar_time + timedelta(seconds=60). So the library is confined to only trading in the minute timeframe? if I change the code I just need to do "pip install -e. "again right? Sorry for asking so many questions. Erik
1. Yes, right now it's constrained to 1-minute bars. 2. If you modify the code, you will not need to do another "pip install -e ." 3. 15-minute delays only happen if you don't have the access token in the headers. did you verify the token is in the headers? also don't worry about the questions :)
@@SigmaCoding yes I have verified it. I contacted TD ameritrade, apparently Hong Kong accounts are not supported for real time quote..... Very wired.... I am thinking if I can combine your IB library with the TD library to achieve Algo trading in TD. Thanks for your informative video!
Hey, I've only watched first 2 episodes of building the robot, and there are a lot of videos still to watch. Also, I haven't watched this video yet, so don't blame me if the answer to my question is in this video. Question: Is there a video where you acctually show the results, what the bot can do, the profit that you made etc.?
It's outside of the scope of the series. The main reason is I don't want to suggest a certain strategy, instead, I want to show how to implement a strategy that someone has already evaluated and determined was successful.
congratulations on the channel and the video, I wanted your contact because I want to configure a grid robot that acts according to the RSI that it would have and that has the drag-up function.
Thank you very very much for the priceless content. Just to clarify, this strategy executes using the Trading Robot which operates on the unofficial API that you've built. Am I getting it right?
Another question I'm struggling to find the answer for. I'm attempting to place equity limit orders outside of normal trading hours (9:30-4:00pm EST). I see there is an argument "SEAMLESS" that should accommodate this, but I can't figure out where to put it in my order flow. Any help would be appreciated!
My basic limit order structure is this currently: def long_open(long_trading_symbol, long_quantity): new_long_open = trading_robot.create_trade( trade_id='long_enter', enter_or_exit='enter', long_or_short='long', order_type='lmt', price = round((mktprice - .20), 2) ) new_long_open.instrument( symbol=long_trading_symbol, quantity=long_quantity, asset_type='EQUITY' ) return new_long_open new_long_open = long_open(long_trading_symbol=long_trading_symbol, long_quantity=long_quantity) trading_robot.execute_orders(new_long_open) This code will create a limit day order, but I can't figure out how to make it a EXT order
Hey guys before I get stuck into this can someone confirm to me whether this actually performs legit trades and if so what kind of account do I need (eg. robinhood)
Seriously great work! Can't wait for the next series!!!
Thanks a ton!
I binge watched every video in this series yesterday because it was exactly what I was looking for. Your design and execution is truly awesome! Thanks!
The whole scope of this project is awesome. It is the exact same wave length that I am on right now. You are adding heaps of value. Much love!
Wait a second, another series!
Oh yes, we have lots to cover.
you are awesome, thank you 🙏🏼
Happy to help!
Exciting!
Tank you for your hard work dear!
I wnat to know if is possible to build an automatic script for binary option from python?
Hi Alex, it's cool to follow along. Have you explained exactly how to populate the config.ini file?
It's a bit confusing from first video, such as
1. what is client id? do you mean "consumer key" from your app
2. is redirect uri simply the callback url?
3. what is json path ?
Yeah, I was horribly inconsistent at the beginning with the naming convention. I'm fairly sure I confused a lot of people with that. If you want a sample on how to populate the config file, I made a sample for everyone on GitHub. Here is the link to the sample: github.com/areed1192/python-trading-robot/blob/master/config/write_config.py
Just remember that the client ID is just the Consumer Key that TD provides you, the Redirect URI is the Callback URL, and the JSON path is the file path that you want the library to use when it comes to storing your refresh and access token.
Could you provide a roadmap for python specifically for financial markets/algorithmic trading ,,, or perhaps a video on how to navigate your channel on the first videos to watch to maximise our learning... Thank you in advance
Hello, I love your videos! I had two questions:
1. What is the procedure for interacting with a pre-existing portfolio that won't disappear once the script stops?
2. Using your robot, is there a way to get a list of all stocks that fit a given set of parameters, rather than starting with the stock symbol?
Alex, great job on these videos and this library. I think its going to be super helpful for me developing my trading ideas. Quick question:
1. Is there a history of price with the buy/sell orders? I'm running your golden cross strategy now as a test, and I see the orders.json output file with the orders showing up, but I don't see a price associated. Is there a different P/L history file I should be looking at?
Also as a feature suggestion, it would be great to have a graphical library integrated (matplotlib or other) so we can chart out our buys/sells for signal tweaking and idea generation. I know this wouldn't be difficult, but I'm a novice coder so would take me a while to figure out myself. Thanks!
You technically need to make another call to the "orders" endpoint with the Order ID to see what the order was filled at. They don't return that info when you place the order, they just provide the ID.
Also, I'm one step ahead of you. :)
There is a plan to show how to use Plotly with the data when we host the trading strategy on Azure.
@@SigmaCoding I think we need a chatroom for these discussions haha.
@@SigmaCoding Thanks for your awesome work. !
@@SigmaCoding , awesome to hear! Also, as I've been working through the code and setting up my testing scenario, I'm running into an issue pulling different periods for the RSI. Here's my code:
# Add 14-period RSI
indicator_client.rsi(period=14, method='wilders', column_name='rsi_14')
# Add 21-period RSI
indicator_client.rsi(period=9, method='wilders', column_name='rsi_21')
I'm only getting returned one rsi, and the column label isn't applied (so I'm assuming the 2nd one is overwriting the 1st)
Current Stock Frame:
open close high low volume rsi
symbol datetime
QQQ 2020-12-22 00:35:00 309.24 309.32 309.33 309.20 1528 97.710839
2020-12-22 00:40:00 309.34 309.33 309.36 309.33 1633 97.798892
2020-12-22 00:45:00 309.34 309.17 309.34 309.17 2170 96.503595
2020-12-22 00:50:00 309.18 309.06 309.21 309.05 3999 95.417552
2020-12-22 00:55:00 309.05 309.07 309.09 308.99 7887 95.828478
Any idea how to fix this?
Hi Alex,
Thanks for your video and the resources.
I saw that the definition of wait_till_next_bar uses next_bar_time = last_bar_time + timedelta(seconds=60).
So the library is confined to only trading in the minute timeframe?
if I change the code I just need to do "pip install -e. "again right?
Sorry for asking so many questions.
Erik
My Data feed following the exact instruction as yours is giving me 15 mins delayed data. Would you mind sharing with us how to solve this issue?
1. Yes, right now it's constrained to 1-minute bars.
2. If you modify the code, you will not need to do another "pip install -e ."
3. 15-minute delays only happen if you don't have the access token in the headers. did you verify the token is in the headers?
also don't worry about the questions :)
@@SigmaCoding yes I have verified it. I contacted TD ameritrade, apparently Hong Kong accounts are not supported for real time quote..... Very wired.... I am thinking if I can combine your IB library with the TD library to achieve Algo trading in TD. Thanks for your informative video!
@@SigmaCoding There seems to be some error with the paper_trading = True. It executed real trade even tho I put paper_trading = True
@@gin-yuitsang4149 I just looked over the library, and if it's set to false it will only store it in the JSON file.
Hey, I've only watched first 2 episodes of building the robot, and there are a lot of videos still to watch. Also, I haven't watched this video yet, so don't blame me if the answer to my question is in this video.
Question:
Is there a video where you acctually show the results, what the bot can do, the profit that you made etc.?
I only show the robot grabbing data, calculating indicators, and placing a trade. But I don't cover strategy performance.
@@SigmaCoding is there a reason why you don't want to show that. Can you tell at least how it's performing with your strategy?
It's outside of the scope of the series. The main reason is I don't want to suggest a certain strategy, instead, I want to show how to implement a strategy that someone has already evaluated and determined was successful.
congratulations on the channel and the video, I wanted your contact because I want to configure a grid robot that acts according to the RSI that it would have and that has the drag-up function.
Thank you very very much for the priceless content.
Just to clarify, this strategy executes using the Trading Robot which operates on the unofficial API that you've built. Am I getting it right?
Yes it leverages the TD Ameritrade Python library I personally built.
@@SigmaCoding Cool thanks for the reply!
tnx for your fantastic videos , how can run this robots on mt platforms?
Another question I'm struggling to find the answer for. I'm attempting to place equity limit orders outside of normal trading hours (9:30-4:00pm EST). I see there is an argument "SEAMLESS" that should accommodate this, but I can't figure out where to put it in my order flow. Any help would be appreciated!
My basic limit order structure is this currently:
def long_open(long_trading_symbol, long_quantity):
new_long_open = trading_robot.create_trade(
trade_id='long_enter',
enter_or_exit='enter',
long_or_short='long',
order_type='lmt',
price = round((mktprice - .20), 2)
)
new_long_open.instrument(
symbol=long_trading_symbol,
quantity=long_quantity,
asset_type='EQUITY'
)
return new_long_open
new_long_open = long_open(long_trading_symbol=long_trading_symbol, long_quantity=long_quantity)
trading_robot.execute_orders(new_long_open)
This code will create a limit day order, but I can't figure out how to make it a EXT order
@@christiancherful The time-in-force should be GTC for "good 'til cancel" instead of DAY. That'll allow you to send it outside of normal market hours.
Is there a way for it to buy options instead of shares
Hey guys before I get stuck into this can someone confirm to me whether this actually performs legit trades and if so what kind of account do I need (eg. robinhood)
Dude ... you should post this things on Hive
Hive.io
Hive.Blog
People will give you more support there than on YT.