If python a good software for doing back-testing? Anyone tried it? How does it compare with using specialised software like Ninja, Metastock, Amibroker?
They are basically all the same : C++, C#, Python, JAVA, Perl, you name it. Python is more user friendly in my opinion. In any case you still need to spend months learning this stuff, computer programming is NOT that easy, believe me. And then you have to code your own trading system, and this part is even more difficult, depending on the complexity of your strategy!
Python is a general purpose programming language. Any general programming language (such as Python, Java, C++, ...) will be worse for non-programmer than specialize one created specifically for describing strategies testing scenarios. AmiBroker created "AFL" language with the intention of making describing strategies code easier. RealTest has its' own language too. A fancy term for those are - domain specific languages. That is an advantage and also a weakness. As soon as you're staying within typical stuff author of the domain specific language (DSL) designed it for (AFL or RealTest) - your code will be nice, clean and compact. Certainly way easier to write, maintain and understand than general programming ones. Once you stray into the domain of - your own flavour of indicator, of some weird portfolio rebalancing with a lot of rules, of some super complex position sizing depending on 10 things, then you hit either the limit of the DSL and you literally need to use another tool or your code will become complicated because you will effectively fall back to using general programming constructs like "loops". In case of AmiBroker, its' general weakness is testing multiple strategies together, also, using there is no easy way to do ranking in your backtests. Many people don't need that, so they will be fine. RealTest has awesome support of ranking and modelling portfolios of strategies + being inspired by AmiBroker - even nicer syntax, but it doesn't support "loops" so as some point you will hit a limit of what what you can do there. There is also not support of intraday data at this point. Someone recently mentioned to me Trading Blox. Check it out. I never used it myself, it seems like they try to create more of a "Drag&Drop" approach to strategy testing. I am somewhat skeptical of that though.
I would agree with others who pointed out - backtesting manually is a good start. Literally going bar by bar and trying to apply your rules systematically. Figuring out if your rules are complete and precise enough, or too naive. Taking notes, wiring down your observations. That will give you an insight like nothing else without any extra complexity. Once you get to the point when you know exactly what you want to do, but you wish there would be some way to do the same thing for 20k other tradable instruments (especially applicable to stocks), or you figured out it took you a day to go over only 1 year of data and you want to cover 50 yeas - then you do need a specialized backtesting tool to automate all of that. If you try to skip doing at least few hundred of those manual tests, the chances are - backtesting tool will be just a waste of your time. You will step on a path of endless learning about backtesting, tools, data, programming, all for nothing, if you didn't know what you really wanted to automate in the first place and why. Val
Bad idea, the college kid could simply copy his profitable trading system and post it on Facebook or some other social media platform, just to brag. And next thing you know 50,000 people are now trading the system at the same time, almost overnight! Traders should backtest their own system and keep the trading rules secret.
Thanks all. I think I may need to teach myself Python. I realize this will take time. Thoughts welcome on how to get started. I see some decent books on Amazon but assume there are also online classes that may be better. Thanks.
While I think you should start with ninjatrader, or at least something similar, that's not your question here. Start with a popular youtuber teaching python for beginners. If/When that youtuber confuses you, after much effort on your part to understand, find another. Eventually, you'll know enough to find the best teachers via free videos. Take advantage. Next, look into paid videos (udemy first, then lynda). You'll know enough to judge whether or not they'd be helpful to you, before you buy. Next, look into the best book. Few are worthy. Do research, as you should now know enough to discern the good from the bad. Also, google individual questions you may have. Stack Overflow is your friend.