You are great and so supportive that you take care of all your subscriber like us from india , providing us knowledge that we are not able to get after spending our thousand of rupees. i m very thankful to you to take us our comment and suggestion in your consideration and providing us knowldge that is very very useful to in our journey of algo trading. Pls keep it going
I tried building a system from scratch with real time capabilities to place order. I missed out on the strategies and hence had to stop the trading. I had a postgres based DB and Java based multi-threaded implementation which can listen to ticks and decide. I did historical back testing and faced 50:50 win rates. I should accept that all my attempts to find the strategy with parameters did not go well across scripts. now learning ML to implement deep learning on the data, system i have.
Thanks for making this video. I tried doing this kind of thing on my own long ago but instead I was trying to implement IBD's relative strength ranking with entire stock exchange's universe, and get 1-100 ranks. But eventually gave up as python was very new to me and I didn't have a lot of time to spend on it But this video has given me hope. I'll try once again. Thanks once again!
Just to be clear, the returns for 1 month holding period is what they say - They are for 1 month only. You need to multiply them by 12 to get annualized return. similarly, multiply 3 months return by 4, and 6 months return by 2. Then they can be compared.
I'm not sure how that NAN work around is working. Very cool though! I think trying to use this on an imbalanced panel would be a great thing to think about.
take the best is a good strat…instead of take the worst…if you would do that for the momentum top 10 or top 5 of the most capitalized 200 stocks in the Nasdaq, you would have a killer strat… 6 month ranking time and 3 Month holding time…no skipping month…if you backtest such a strat since 1997 you will get a 55% annual return in such a KillerStrat…if you forbid to buy when the NasdaqIndex is under the sma200, then you make it perfect for the gods of wallstreet…. god bless you bro…thx for the code…i will try….
@@Algovibes i m sure, you will get a lot of new abonnements with that…but it should be possible to choose the number of stocks to buy…5 min until about max 20…short ist not so useful… then you should have a exponential regression, annualized for sorting…and maybe multiplied with the correlation of determination R2, to sort down the stocks with gaps and to much volatility…if you then will calculate the max drawdown and finally calculate the annualized Performances, then you will have the ultimative app for the next generation of success… if any holded stock falls under the sma100 it should be sold thx…bro…im impressed of your programming speed…i will donate you, if you have it ready…ericpauldion@gmail.com
Great one! Some additional tweak ideas. It would be great to see, what are the on each portfolio. Also, I think this structure would be good for the 52 week high strategy. In that strategy the problem might be that there are multiple stocks that are on 52 week high and one needs to randomly pick one or even better hold the stock if it is on the following ranking on top too
Thanks a lot for watching, your kind comment and your valuable suggestions! :-) I am sorry but I am honestly not getting the very first suggestion. What do you want to see? Regarding the 52 week high: I will definitely taking this into consideration, it in fact is an interesting thing to code but have some other things in the pipeline before. Thanks a lot for reminding me!
@@Algovibes Sorry, if my comment was imprecise. I meant, it would be nice to have the names of the stocks of every portfolio and may the result too. Example: 3month portfolio From january-march and the names. Then portfolio april-june and the names of the stocks. This information would be nice to be in easy to read format.
Hey, Thank you for this content. Could you also make a strategy video (for eg: HeikenAshi, EMA Crossover etc) for Intraday trading on Nifty/Sensex based on top performers of a particular sector? Thanks in advance. Great content. Loving it. Already subscribed and keep up the great work.
Thank you very much for watching, your appreciative comment and subscribing. Also thanks for your suggestion! I cannot promise anything but I noted that. Be kindly invited to check out my other trading strategy videos. You will surely find something interesting for you and there will be more stuff on trading in the future :-)
As I am personally interested in the Indian market there will be some more stuff. Maybe not India only but I might include Sensex components in other strategies in the future. Thanks for your suggestion :-)
Thank you so much for this video. Can you make a strategy of long only where we check weekly performance. And of the universe of Nifty 500. We will check the momentum performance weekly and rebalance accordingly. We keep the performers and get rid of losers. Thank you in advance liked your video and you got a happy subscriber.
Thank you very much for watching and your comment! I noted your suggestion, but have some more topics in the pipeline beforehand. Thanks for your patience. Also thanks a bunch for your subscription - really appreciate it :-)
Bruh, he gave you all this information. At least try it by yourself first. He has shown you everything in this video, you can literally make any kind of momentum strategy if you google other indicators and combine it with this. I'm trying Nifty 500, Smallcap 250 along with some more of my own criterias
BSE stock exchange has lost its sheen in last 2 decades, it only handles less than 20% of total trading in india. NSE is the stock exchange which handles 80% trades of Indian market. Please design things around nse as it has emerged has largest options exchange in the world in recent years.
Hi buddy, thanks a lot :-) Just as an alternative solution: Why wouldn't you calculate the technical indicators instead? I have a lot of content on that. E.g. ruclips.net/video/rYfe9Bg2GcY/видео.html or ruclips.net/video/r8pU-8l1KPU/видео.html
As answered below your other comment, please check this vid (cryptos tho): ruclips.net/video/HB1CLz0Z1NY/видео.html You need a good data source for 1m data on the Indian market. If you have one, let me know. Happy to cover something on Indian stocks soon again.
Hi, thanks for sharing it but are you calculating 11 months return here instead of 12 month return?There are just 11 months between begin (28.02.10) and end date (31.01.11) in this code. What am I missing? Regards
Thanks for watching mate. Yes that's intented. It's accounting for the short term reversal effect. Covered here: ruclips.net/video/xpP048vfNrg/видео.html
Thanks for your comment! :-) Prerequisites in general is a solid numpy or pandas knowledge and intermediate Python skills. Also you should have a basic knowledge on how financial markets are working. You can click through my Python for finance playlist, I think that would be helpful. Let me know if you need any more resources or tell me where you are struggling.
Thanks for creating this wonderful videos. I am new to Python and getting no output for "line 35, tome 23:54 using the code "winnerret = mtlprices.loc[formation+MonthEnd(1),winners.index]/(mtlprices.loc[formation, winners.index]) - 1" what is wrong here. Also not getting any error. Can you please help?
Thanks for watching and your kind comment :-) Well there could be a couple of reasons for that. Did you use exactly my syntax or did you deviate at some point?
@@Algovibes I have followed the same syntax. No error and no result. I find it strange. Can you please email me the code to my email stockssan@gmail.com
@@Algovibes i have the same problem , its the formation variable datatype, when you do formation+Monthend becomes a timestamp instead of a datetime. thats the problem, the only way i could work around it is to use formation as formation+MonthEnd(0) for this line to work.
Algovibes, one doubt on the formation day how many stocks we should buy ? Normally we can only buy stocks initially on the first month and we cannot short sell right as we are buying stocks for first time
Using these datetime objects assumes your index will map appropriately to the index. Be careful with this in other strategies. Observe the error below: df_mom = yf.download(tickers, start = '2010-01-01')['Adj Close'] # this will work on a momentum for an imbalanced panael as zeros converge to the middle df_mom = df_mom.fillna(0) Example formation = dt.datetime(2011, 2, 28) begin_measurement = formation - MonthEnd(12) end_measurement = formation - MonthEnd(1) price_end = df_mom.loc[end_measurement] price_end # output works to map this appropriately to the dataframe that contains the necessary values. price_12mbefore = df_mom.loc[begin_measurement] price_12mbefore KeyError: Timestamp('2010-02-28 00:00:00') This is a result because the datetime index does not exist in the dataframe that was ingested via Yf. Just be careful here as you may have gotten lucky that your Indian index contained the appropriate indexes.
You are great and so supportive that you take care of all your subscriber like us from india , providing us knowledge that we are not able to get after spending our thousand of rupees. i m very thankful to you to take us our comment and suggestion in your consideration and providing us knowldge that is very very useful to in our journey of algo trading. Pls keep it going
Thanks a lot for your kind comment. Very happy my videos are adding value for you. Really appreciate it :-)
I tried building a system from scratch with real time capabilities to place order. I missed out on the strategies and hence had to stop the trading. I had a postgres based DB and Java based multi-threaded implementation which can listen to ticks and decide. I did historical back testing and faced 50:50 win rates. I should accept that all my attempts to find the strategy with parameters did not go well across scripts. now learning ML to implement deep learning on the data, system i have.
Thanks for making this video.
I tried doing this kind of thing on my own long ago but instead I was trying to implement IBD's relative strength ranking with entire stock exchange's universe, and get 1-100 ranks. But eventually gave up as python was very new to me and I didn't have a lot of time to spend on it
But this video has given me hope. I'll try once again. Thanks once again!
Hey buddy, thanks for your comment :-)
Sounds interesting! Let me know about the insights you got once you build it.
Don't give up :-)
There are people here who are charging thousands of dollars to teach these things, you are doing a great service
Thank you buddy for your positive words, really appreciate it :-)
My man, you got me bro
Happy that I got you! :D Thanks for watching and your comment mate :-)
Thanks a lot. I’m pretty new to python. I just followed what you said. I’m getting proper output.
Awesome. Thanks a lot for your feedback!
We will tried our best to aware other about your chennal where they can also benefit of your knowledge.
That would be such a huge help. Thanks a lot for your support! :-)
Just to be clear, the returns for 1 month holding period is what they say - They are for 1 month only. You need to multiply them by 12 to get annualized return. similarly, multiply 3 months return by 4, and 6 months return by 2. Then they can be compared.
I LOVE PYTHON AND TRADING
This channel have both...❤️
Haha, me too ❤️ Thanks for commenting mate. Appreciate it!
Thanks for this wonderful video, simple and easy to understand. Good work.
Thank you :-) Glad to hear that!
Top content! You are The Man!
Thanks a lot for your support :-) It is an incredible help for me.
Thanks for sharing this vedio... 🙏🙏🙏...
Most welcome! Thanks for watching :-)
Great video, very helpful. Subscribed.
Thanks a lot for watching, your comment and your subscription. That's a huge support for me! Appreciate it :-)
I'm not sure how that NAN work around is working. Very cool though! I think trying to use this on an imbalanced panel would be a great thing to think about.
Happy Deepawali @Algovibes
Thank you buddy! For you as well ❤️
Nice!
Thanks for watching mate.
Very nice content
Thanks a lot for your support. Appreciate it and really helps me out! :-)
take the best is a good strat…instead of take the worst…if you would do that for the momentum top 10 or top 5 of the most capitalized 200 stocks in the Nasdaq, you would have a killer strat…
6 month ranking time and 3 Month holding time…no skipping month…if you backtest such a strat since 1997 you will get a 55% annual return in such a
KillerStrat…if you forbid to buy when the NasdaqIndex is under the sma200, then you make it perfect for the gods of wallstreet….
god bless you bro…thx for the code…i will try….
Hey mate, thanks for your kind comment, really appreciate it :-) And thanks for your input regarding the Nasdaq!
@@Algovibes i m sure, you will get a lot of new abonnements with that…but it should be possible to choose the number of stocks to buy…5 min until about max 20…short ist not so useful…
then you should have a exponential regression, annualized for sorting…and maybe multiplied with the correlation of determination R2, to sort down the stocks with gaps and to much volatility…if you then will calculate the max drawdown and finally calculate the annualized Performances, then you will have the ultimative app for the next generation of success…
if any holded stock falls under the sma100 it should be sold
thx…bro…im impressed of your programming speed…i will donate you, if you have it ready…ericpauldion@gmail.com
Im subscribing this guy 🙏
Means a lot to me. Thanks a bunch :-)
Great one! Some additional tweak ideas. It would be great to see, what are the on each portfolio. Also, I think this structure would be good for the 52 week high strategy. In that strategy the problem might be that there are multiple stocks that are on 52 week high and one needs to randomly pick one or even better hold the stock if it is on the following ranking on top too
Thanks a lot for watching, your kind comment and your valuable suggestions! :-)
I am sorry but I am honestly not getting the very first suggestion. What do you want to see?
Regarding the 52 week high: I will definitely taking this into consideration, it in fact is an interesting thing to code but have some other things in the pipeline before. Thanks a lot for reminding me!
@@Algovibes Sorry, if my comment was imprecise. I meant, it would be nice to have the names of the stocks of every portfolio and may the result too. Example: 3month portfolio From january-march and the names. Then portfolio april-june and the names of the stocks. This information would be nice to be in easy to read format.
Hey, Thank you for this content. Could you also make a strategy video (for eg: HeikenAshi, EMA Crossover etc) for Intraday trading on Nifty/Sensex based on top performers of a particular sector? Thanks in advance. Great content. Loving it. Already subscribed and keep up the great work.
Thank you very much for watching, your appreciative comment and subscribing. Also thanks for your suggestion! I cannot promise anything but I noted that. Be kindly invited to check out my other trading strategy videos. You will surely find something interesting for you and there will be more stuff on trading in the future :-)
Hey great video but the data has inconsistencies and duplicate data also which can affect our results how to tackle that any idea?
Can you elaborate (in the best case with timestamps)? Thx!
Check for duplicates in dataframe after downloading the data with period ="max"
Df.duplicates()
Can you bring more content for Indian markets ?
As I am personally interested in the Indian market there will be some more stuff. Maybe not India only but I might include Sensex components in other strategies in the future. Thanks for your suggestion :-)
Thank you so much for this video.
Can you make a strategy of long only where we check weekly performance. And of the universe of Nifty 500. We will check the momentum performance weekly and rebalance accordingly. We keep the performers and get rid of losers.
Thank you in advance liked your video and you got a happy subscriber.
Thank you very much for watching and your comment! I noted your suggestion, but have some more topics in the pipeline beforehand. Thanks for your patience. Also thanks a bunch for your subscription - really appreciate it :-)
Bruh, he gave you all this information. At least try it by yourself first.
He has shown you everything in this video, you can literally make any kind of momentum strategy if you google other indicators and combine it with this.
I'm trying Nifty 500, Smallcap 250 along with some more of my own criterias
I m finding error like MonthEnd is not defined can you guide me
You gotta import it in the very beginning of your script.
Hi , i need the python code for pulling the stocks below 10 /- from bse, nse on specified date. Please help me if you have any
Hi mate, could you elaborate?
BSE stock exchange has lost its sheen in last 2 decades, it only handles less than 20% of total trading in india. NSE is the stock exchange which handles 80% trades of Indian market. Please design things around nse as it has emerged has largest options exchange in the world in recent years.
Good to know, thanks a lot for sharing that!
Hello sir.. good job
can I get technical data..from NSE Web site live market
like RSI MACD ..etc
Hi buddy,
thanks a lot :-)
Just as an alternative solution: Why wouldn't you calculate the technical indicators instead?
I have a lot of content on that.
E.g.
ruclips.net/video/rYfe9Bg2GcY/видео.html
or
ruclips.net/video/r8pU-8l1KPU/видео.html
What if I want Niftybank 1 min data and Run strategy on it for backtesting??
As answered below your other comment, please check this vid (cryptos tho):
ruclips.net/video/HB1CLz0Z1NY/видео.html
You need a good data source for 1m data on the Indian market. If you have one, let me know. Happy to cover something on Indian stocks soon again.
@@Algovibes How do I get data for 1min of data for Banknifty Indices Symbol:^NSEBANK??
im not into codin and tech stuff what app do you use for coding bro?
Using Jupyter Notebook here :-)
If you wanna start out you are invited to check out my Python Introduction playlist.
Great content bro.
Can you please share the code so that we can do R&D
Thank you! I didn't plan on publishing the code yet. Sorry!
Hi, thanks for sharing it but are you calculating 11 months return here instead of 12 month return?There are just 11 months between begin (28.02.10) and end date (31.01.11) in this code. What am I missing?
Regards
Thanks for watching mate. Yes that's intented. It's accounting for the short term reversal effect. Covered here:
ruclips.net/video/xpP048vfNrg/видео.html
What are the prerequisites for this video
Thanks for your comment! :-)
Prerequisites in general is a solid numpy or pandas knowledge and intermediate Python skills. Also you should have a basic knowledge on how financial markets are working. You can click through my Python for finance playlist, I think that would be helpful.
Let me know if you need any more resources or tell me where you are struggling.
Thanks for creating this wonderful videos. I am new to Python and getting no output for "line 35, tome 23:54 using the code "winnerret = mtlprices.loc[formation+MonthEnd(1),winners.index]/(mtlprices.loc[formation, winners.index]) - 1" what is wrong here. Also not getting any error. Can you please help?
Thanks for watching and your kind comment :-)
Well there could be a couple of reasons for that.
Did you use exactly my syntax or did you deviate at some point?
@@Algovibes I have followed the same syntax. No error and no result. I find it strange. Can you please email me the code to my email stockssan@gmail.com
@@Algovibes i have the same problem , its the formation variable datatype, when you do formation+Monthend becomes a timestamp instead of a datetime.
thats the problem, the only way i could work around it is to use formation as formation+MonthEnd(0) for this line to work.
Algovibes, one doubt on the formation day how many stocks we should buy ? Normally we can only buy stocks initially on the first month and we cannot short sell right as we are buying stocks for first time
Hi buddy,
can you elaborate on your problem?
I don't really get it. Sorry and thanks in advance!
Bro, don't you have a github repo? Just asking! 😉
Unfortunately I haven't.
When trying this code. yf.download(tickersSensex[0]) returns a JSON decode error. Any suggestions on how to fix that? Does this API stil work?
Note: I updated yfinance to 0.1.62 that got rid of the error but now I get the stocks as delisted. :(
Last update: the date I was using was probably a holiday. Latest attempt after removing date range seems to work fine.
Yea, I had some problems with the previous version as well (check my latest community post). Thank you very much for sharing your problem solving! :-)
Using these datetime objects assumes your index will map appropriately to the index. Be careful with this in other strategies. Observe the error below:
df_mom = yf.download(tickers, start = '2010-01-01')['Adj Close']
# this will work on a momentum for an imbalanced panael as zeros converge to the middle
df_mom = df_mom.fillna(0)
Example
formation = dt.datetime(2011, 2, 28)
begin_measurement = formation - MonthEnd(12)
end_measurement = formation - MonthEnd(1)
price_end = df_mom.loc[end_measurement]
price_end # output works to map this appropriately to the dataframe that contains the necessary values.
price_12mbefore = df_mom.loc[begin_measurement]
price_12mbefore
KeyError: Timestamp('2010-02-28 00:00:00')
This is a result because the datetime index does not exist in the dataframe that was ingested via Yf. Just be careful here as you may have gotten lucky that your Indian index contained the appropriate indexes.