Python is very powerful and concise for data manipulation and there are tons of libraries available for financial analysis and trading. [recycled from the same question in another thread] Try working through Algorithmic Trading with Python: Quantitative Methods and Strategy Development. Personally I learned “Python for trading” by just deciding I wanted to build some code for a project and just start hacking away. I’ve found that Python is such a powerful language it’s actually pretty easy to learn. Every time I get stuck I find there is a built-in function or library that does exactly what I need.
Being honest with yourself is great. Not being able to build anything profitable is much better than tricking yourself into believing you make "profitable" algos on backtest, only to see them all fail in real life.
DO NOT trade forex. FX is super hard to trade: poor data, fragmented markets, most efficient asset class. Finding alpha in FX is 10x harder than in equities/commodities spot/futures.
Unless you are super comfortable with basic stuff DO NOT go to ML, especially deep learning. Simple stuff like momentum, mean-reversion first, then interpretable models, then ensembles of models, then DL. Otherwise you will never learn, nor make any progress at all.
This book is the bible: https://www.amazon.com/Elements-Statistical-Learning-Prediction-Statistics/dp/0387848576/ Read it 100x times and code as much examples yourself as possible.
Watch the videos here https://www.udacity.com/course/machine-learning-for-trading--ud501
Do the assignments here https://quantsoftware.gatech.edu/CS7646_Spring_2018
Oops, this assumes you were interested in machine learning as well, but by the end you do implement a rule based trader and a back tester.
Try working through Algorithmic Trading with Python: Quantitative Methods and Strategy Development. Personally I learned “Python for trading” by just deciding I wanted to build some code for a project and just start hacking away. I’ve found that Python is such a powerful language it’s actually pretty easy to learn. Every time I get stuck I find there is a built-in function or library that does exactly what I need.
The best textbook I've read about the basics is Trading and Exchanges by Harris. It addresses why markets exists, how they function, who the participants are and their respective goals. Furthermore it does a fantastic job explaining market microstructure which is a necessity for developing a profitable, execution sensitive algorithmic trading system.
If you are interested in derivatives, Hull's Options, Futures, and Other Derivatives is an excellent mathematically rigorous guide to those products.
The Udacity AI for Trading Nanodegree does a great job introducing and explaining the math (and code) used in an end-to-end quantitative approach to trading. Ironically, the AI portion is probably the weakest part of the program, but I got it on sale a while ago and I'm pleasantly surprised with how well they present the concept and math involved in quantitative trading.
It might not necessarily be the worth the price (try to find a coupon or something), but you might be able to find the material for free (I think they offer a lot of the material for free).
Amazon Link to Ernie's book for those interested
It would be helpful to be familiar with some basic financial concepts such as: The Black Scholes equation, Sharpe ratio, portfolio optimisation, CAPM, time series analysis, PDEs, convex optimisation, securities markets 101, pairs trading strategies, trend following and mean reversion strategies, market microstructure, & Monte Carlo methods.
Mark Joshi's simple guide to becoming a Quant is free to download and - "Statistical Arbitrage" section in particular. Mark's website is quite informative in general.
If you would like to explore further, the first 3-4 chapters of the textbook Active Portfolio Managmement by Grinold & Kahn is a good starting point:
Grinold and Kahn, Active Portfolio Management : A quantitative approach for producing superior returns and selecting superior money managers http://www.amazon.co.uk/dp/0070248826
I'd generally advise - once you have a grounding in the theory - maybe thinking about an example trading strategy and what kinds of data could be interesting to develop this.
Market Microstructure in Practice
Great book on price formation/discovery, liquidity, and talks about statistical modeling of slippage/market impact; useful if you want to arbitrage/exploit the microstucture!
Pls get started with statistics and probability theory, then python. Practice python to make sure you understand statistics correctly, on simple examples with known solutions/answers.
Otherwise you'll be another "algo trader" asking what's wrong with his "16 trades per 10 years backtest that yields 1000%" with tripple leverage.
There's a great book "Algorithms to Live By" (https://www.amazon.com/Algorithms-Live-Computer-Science-Decisions-ebook/dp/B015CKNWJI/), ideally you'll need to apply similar level of problem solving approach to anything you develop
TA-Lib is sort of the defacto base library for technical analysis.
I've never used the .net version and a lot of the links on the site are dead. Nuget has this:
https://www.nuget.org/packages/TA-Lib/
If you google for "ta-lib" you'll probably find some related stuff that you might find you like better.
Hey, my requirements are pretty similar to yours.
If their engineers have experience with docker and AWS ECS or AWS EC2, that is preferred. I would ask for the following applications containerized through docker:
A container for a jupyter server (the server running your notebooks)
A container which starts a variety of timed cron jobs, and other data retrieval jobs. I recommend celery for retrieval of data, internal processing of data, and in general scheduled tasks. It could even replace cron (but they both can be used together if that's desired)
A mongodb server (AWS provides their own mongodb cloudformation, however we went with our own container running mongodb)
Documentation of how to run a backup of mongodb, your jupyter server, as well as the git repo.
Documentation of how to deploy updates. Generally I would recommend as follows for your workflow:
As for how much this would cost? A bare minimum setup would cost you at least a few thousand dollars. Tough to estimate without more details. Then you'll need continued support, which will cost more. Of course, this is fairly basic stuff, so a competent IT staff team should probably be able to set you up with this if it is made a priority.
Trade Your Way to Financial Freedom - Van K. Tharp - Amazon
It gives you a very good guidelines as to what you need to create a system. And not an algo-system: you can do it with pen and paper if you wish. The important thing is the basics he sets.
Position sizing being a lot more important than entry setup. See this post by myself which loosely models some of the ideas of the book: turning a losing strategy into a winning one by adopting a different position sizing approach.
Start slowly! Most of the algotrading advice that people give and people seek is how to get a 300% profit within the next 5 minutes.
My recommendation is to read this book: Trade Your Way To Financial Freedom - Van K. Tharp Amazon Link
Although the title seems to address individuals (Your) it delivers general concepts and looks into all kinds of systems. Beware: the book does not attempt to tell you how to run your algotrading setup, but how you need to approach setting things up.
The setup will be made by the people you get on board to create your platform.
> How could these financial resources be used most effectively?
Hire good people. See below.
> For example, I am interested in your opinion on hiring different people (most likely freelance consultants) to speed up the development process (for the actual trading systems or the strategies).
IMHO: you are going to need full time people (even if you can rely on freelancers now and then). I have seen such a setup and at least 2 positions were full-time: the devops and the algorithm creator. The office relied on 2 external consultants now and them.
In my opinion the best approach is suggested in Systematic Trading by Robert Carver (https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.amazon.com/Systematic-Trading-designing-trading-investing/dp/0857194453&ved=2ahUKEwiGsam3z9PwAhWSQUEAHXkBC7QQFjALegQIHhAC&usg=AOvVaw097vxYengkxVdkWh-F7Vkw). It uses a lot of statistics to manage the equal risk parity per open position. Yet, the final approach is not so complicated, as it could be even automated with Excel spreadsheet.
yahoo finance
you can get daily weekly or monthly data of this type pretty easily from them and it's free, you don't even need to sign up for anything
you can use YQL or access the CSV endpoints, all you need to do is make an HTTP request with PHP which you can do with
http://php.net/manual/en/httprequest.send.php
or use a prefab library like:
https://github.com/scheb/yahoo-finance-api (first result on google)
EDIT: suggestion to consider using something other than PHP because reasons
When backtesting, for every symbol of interest, scrape this: http://finance.yahoo.com/q/it?s=KO+Insider+Transactions
Then when going live you can just pull from this every day: http://finviz.com/insidertrading.ashx
You didn't mention which financial market you're interested in... Stocks? Forex? What country? Digital Currencies?
I use the FXCM API (forexconnect) for Forex data and it's pretty good: https://www.fxcm.com/au/trading-services/api-trading/forex-api/
For Digital Currencies, I use the Poloniex API: https://poloniex.com/support/api/
For stocks... if you're using minute bars, you're probably doing it wrong. Stocks are really not very compatible with intraday strategies because of the very limited time they trade per day -- closed markets really screw with the short-term behavior. Stocks are a long-term game.
Use DigitalOcean - $5 a month, SSD, super fast. I have referral code here with $10 free credit for you https://www.digitalocean.com/?refcode=8583b9a09750 Shoot me a message if you have any q's. I use them the majority of the time and EC2 every now and again.
Mine is basically the same but I use MariaDB since Oracle owns MySQL and they suck ass.
MariaDB is maintained by the original MySQL developers who hate it being sold off to Oracle so they forked the code.
It sounds like you just need to learn how to code in general. You can do coding bootcamps in both of those languages that can last anywhere from 2+ weeks with the end goal of teaching you how to get familiar with syntax and generally how to write a program that accomplishes a task. FreeCodeCamp is good because it is free software that can teach you the basics. If you really want the learning process to be effective then you could go with a paid boot camp software that will teach you any niche you need to know about a language. After you learn about the languages and how to code in them, you can then wire an app up to connect to robinhood web sockets and web api endpoints to collect and / or send all necessary data to your bot.
But then you just scratched the surface on how to make $ with a bot. That is when it gets fun
Probably idealists. Read this book. Also open source allows for synergy with others. That being said I’m sure there’s companies and others keeping what they’re doing on the DL. https://www.amazon.com/Cathedral-Bazaar-Musings-Accidental-Revolutionary-ebook/dp/B0026OR3LM/ref=sr_1_1?crid=2QN0XUDW1VJEM&dchild=1&keywords=cathedral+and+the+bazaar&qid=1620351007&sprefix=Cathedral+and+%2Caps%2C166&sr=8-1
depending on how much time you want to spend on it: https://textbookbasics.com/product/options-futures-and-other-derivatives-9th-edition-2014-by-john-c-hull/?utm_source=Google%20Shopping&utm_campaign=Textbookbasics&utm_medium=cpc&utm_term=2560&gclid=Cj0KCQiA9P__BRC0ARIsAEZ6irg7mZAYl...
it's difficult af and you have to be able to follow along ito integrals and shit. But it'll give you a fundamental understanding.
If you don't want to go through that slog, you can get a much more practical view with https://www.amazon.com/Option-Volatility-Pricing-Strategies-Techniques/dp/0071818774
I started my journey almost a year ago. I read many books but I found Trading Systems to be the best beginners book. In terms of algo trading, its a different beast on its own. Your biggest challenge is getting the data.
Technical analysis on its own is literally astrology. There is no feedback loop to tell you if you're right, or lucky, even if you don't lose money.
Not to say that technicals are inherently bad. It's just that the good indicators were absorbed into the quantitative school of thought some time ago, while the random shapes were largely discarded.
3rd, how you size your bets in relation to how certain you are about direction isn't really covered by technical analysis.
4th) the key insight to fundamental analysis; that a dollar is still worth a dollar regardless of whether you pay 40c, 50c, or w/e, doesn't apply to trading, because timing matters greatly. This is why you'll want to look into standardizing your volatilities.
Actually writing a short paper on EMH right now, the short answer to your question is it depends on how strict you are on the semi-strong form. There are 3 forms; weak, semi, & strong the main difference is what information is considered, as in historical, public, or public and private. If you stick very strictly to the definition then no technically we don't have an efficient market, but we have a mostly efficient market relative to the size and depth.
There are numerous academic papers on this dating back to the 70's when the theory was first developed. You can go to ssrn and search for efficient market to find quite a few if you want to read them. A Random Walk Down Wall Street is a popular counter EMH piece that basically says the market isn't efficient because prices are random and not based purely on information. (been a while since I read that, so I may be off slightly)
Edit: I was off on some of my points, but others have answered better so check the other comments. Leaving mine how I wrote it originally so the child comments make sense.
Don't force them or they'll hate it.
I started when I was 12 (now mid 40s) - I could probably say I started much earlier but typing in B.A.S.I.C language scripts from the Commodore 64 manual doesn't really count - I had no idea what I was doing :)
For your kid I suggest something like MIT's Scratch -> https://scratch.mit.edu/
In general, I'd think you'd see a muted form of something like what happened with ES. It's more attractive to smaller investors (and whatever sort of dynamic that engenders), and allows more granularity in things like hedging. For more on the spu, https://www.researchgate.net/publication/228317367_When_Size_Matters_The_Case_of_Equity_Index_Futures (which is pretty much what you'd expect).
You can use the poliniex API for price history. You can find documentation here. I personally just trained my program with the data I got from a call like this:
/u/john_legend_ i believe this is because the API's engine is not quoting Ripple (XRP) in USD (fiat). You're looking for something that does not exist.
What does work is quotations in Bitcoin (BTC). Example of https://www.cryptocompare.com/api/data/coinsnapshot/?fsym=XRP&tsym=BTC
> "{"Response":"Success","Message":"This api will soon move to mi-api path.","Data":{"Algorithm":null,"ProofType":null,"BlockNumber":0,"NetHashesPerSecond":0.0,"TotalCoinsMined":38305873865.0,"BlockReward":0.0,"AggregatedData":{"TYPE":"5","MARKET":"CCCAGG","FROMSYMBOL":"XRP","TOSYMBOL":"BTC","FLAGS":"4","PRICE":"0.00001667","LASTUPDATE":"1512857351","LASTVOLUM.....
From what I remember, Ameritrade’s API does not like localhost. I was able to create a couple using localhost but the app does not show up (site redirects to error). Their example shows localhost, but it does not work. One solution (in terms of free solutions) was to make a static page on github, then use that as the redirect.
AWS spot instances can be pretty cheap and reliable.
https://aws.amazon.com/ec2/spot/bid-advisor/
If you find an instance type and region that doesn't often have large price spikes, then you can keep a relatively cheap instance running long term without it being out bid.
have you done lit search like momentum investing books by Grey/Vogel (who rrun Alpha Architect ETF's), Clenow, and maybe the people that run Avantis funds?
Also Dogs of the Dow (highest div yield) strategy
https://www.amazon.com/Quantitative-Momentum-Practitioners-Momentum-Based-Selection/dp/111923719X
Well, I have read the book below and a few other resources.
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems. https://www.amazon.com/Hands-Machine-Learning-Scikit-Learn-TensorFlow/dp/1492032646/ref=sr_1_6?crid=1CIL9ZC0E0J3G&dchild=1&keywords=introduction+machine+learning&qid=1622981241&sprefix=introduction+machine+%2Caps%2C199&sr=8-6
The issue is that Prado has a very mathematical approach, and unless you have developed the intuition going through simpler examples, it will not make much intuitive sense. For instance, in section 5.4, he is applying the backshift operator to a matrix of features and then proceeds to relate that to the binomial expansion. Even for someone familiar with both concepts, it is hard to grasp the intuition behind that. There are several such examples.
I'd recommend you https://www.amazon.com/Advances-Financial-Machine-Learning-Marcos/dp/1119482089
This book covers some pitfalls of using ML in algorithmic trading.
That's not how Sharpe works. If anything, a massive SL would lead to large unrealized drawdowns ( MAE ) and a lower Sharpe.
Also, there is no "best" approach or timeframe. Intra-day strategies work, as do swing trade strategies.
Chatting in forums and asking questions is all well and good but, going from your comments above, I recommend taking the time to deep dive into learning foundational performance metrics. Learn,: Sharpe ratio, Sortino Ratio, Monte carlo Simulations, System Parameter Permutations, Walk forward analysis
Check out Robert Pardo's book
Maybe I misunderstood your question. Do you mean what is a good number of trades in a backtesting to determine if your results are statistical significant? Well, there are tests you can do for that, like t-test on your distribution of returns. This book covers this topic and it has also sample code (in Matlab) :
https://www.amazon.com/dp/B00CY5HC0U/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1
While the math behind a trading algo doesn't have to be extremely sophisticated a very good understanding of stats is necessary to characterize your algo.
I do a ton of work to understand the stat properties of my algo. I use all the classical performance measures like Sharpe, Sortino and so on. But also I try to fit the P&L to distributions, do Monte Carlo, measure performance on a continuous basis. I characterize the frequency and duration of the drawdowns and so on.
Another magnificent source is Sournette. Read everything from that man.
https://www.amazon.com/dp/B01M34NBM2/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1
> was wondering which one is the most user friendly for a coding amateur like me.
As the author of backtrader I would always nominate my own, but my personal recommendation is that you really focus on learning to code (you will obviously do that in Python)
This is the same recommendation I sometimes give to people posting in the community, where something like this will show up now and then: "how can I keep a reference to value inside a class?"
You need to spend more time in the details of your strategy than in the details pertaining to the language/framework you are using. It's like driving: it takes a while to abstract from clutch/shifting/accelerating/braking to actually achieve real driving.
Whilst learning programming I would recommend to read this book: Amazon - Trade Your Way To Financial Freedom - Van K. Tharp
No, it's not going to give you a winning system nor the math/statistics many will say you need. It gives you the building blocks of how to approach algorithmic trading.
I think one issue was that Lewis didn't actually speak to or cite any high-frequency traders in the book, and in fact some of the schemes he describes are no longer (or never were) feasible or possible. Actually there was an entire book written in response:
https://www.amazon.com/Flash-Boys-Insiders-Perspective-High-Frequency-ebook/dp/B00P0QI2M2/
I don't trade on that scale but from what I understand the whole "the market is rigged" theme did a disservice to HFTs by ignoring their positive contributions to price discovery and market liquidity. Arbitrage does not equate to nefarious activity. Again any details I try to elaborate on here could probably be shot with holes by a real HFT trader!
> A Random Walk Down Wall Street
The premise (stocks essentially behave as random-walk entities) has been pretty thoroughly disproven over the years, for varying types of "random walk" models (log, dynamic, trending, nonlinear random distribution, etc).
EDIT: I don't disagree with your conclusions; just pointing out that mid-70s groundbreaker has been studied to death... and put to rest.
I recently started learning C++ (and R) coming from Python and I've been using Prata's C++ Primer Plus. Although this book isn't geared towards financial engineers I think it's probably the best introductory programming book I've used and will be a great reference as well. Beware, the book is around 1200 pages.
Also, the book The Art of R Programming has a small (very small) section in it that discusses using R and C++ (and even Python) together. Probably not worth buying but like ultraspeedz said, there are some nasty pirates that have put the text out there.
Yahoo should suffice, you can download the file at the bottom of the page. You could write a code or script to automatically pull them just by messing around the url.
Got it. In theory just about every system should be able to access level 2 data these days. Most can pull in market by price data, and a few can even go as granular as market by order.
What you probably need to do is research the API of the software and understand how to access level 2 data. For example in NinjaTrader level 2 data is under a different subroutine than level 1.
Robbinhood has level 2 data as well: https://robinhood.com/us/en/support/articles/level-ii-market-data/#:~:text=Level%20II%20Market%20Data%20shows,stock%20at%20a%20certain%20price.&text=Level%20II%20Data%20is%20unique,best%20ask%20on%20the%20market.
Not trading off of news, but I used to work at a venture capital firm. I built a pipeline that gets sentiment over times of different companies, based off of news articles, which the investors/analysts then used to help in their decisions.
If you're interested in historical news data the data set i used is "news crawl", which is a subset of commoncrawl. Pretty nice because you can get a ton of data and it's relatively simple to access.
If you're trying to browse through academic pieces, apart from actual profit, you could use Scinapse.io, use the filters on the right either Fields of Study or Journals to confine the results to your own interest. (investment doesn't always mean financial investments)
Let us not forget that derivatives are only avaliable if your your function is continuous at every point in it's domain. We know that price data it's modeled as continuous but cannot be differentiated, so any linear combination of price data can't be differentiated (such as Bollinger bands and others indicators).
In my opinion, it's best to use a spline function because it will interpolate your Bollinger band points as a polynomial, and polynomials are differentiated because they are continuous functions. Here how to calculate a polynomial derivative given it's order:
>In finance, the Beta (β) of a stock or portfolio is a number describing the correlated volatility of an asset in relation to the volatility of the benchmark that said asset is being compared to. This benchmark is generally the overall financial market and is often estimated via the use of representative indices, such as the S&P 500 [Levinson, Mark . Guide to Financial Markets. London: The Economist (Profile Books). pp. 145–6 (2006). ISBN 1-86197-956-8.].
I am taking the coursera course that was mentioned on this subreddit, and this point was made in one of the lectures. I take no quarrel with your use of the words beta and correlation.
There's always a subjective decision that needs to be made. Should you rush through and get something up and running? Or should you focus on building robust, highly reliable systems that consists of individual components that can each be scaled and developed individually?
My style is placing a violent amount of action towards getting a prototype out. To prove whatever idea you have and I'm greatly believe in the power of momentum. Inspiration is short lived so when it appears, act on it. That being said, what I do before writing a single line of code is architecting both prototype and the robust version of the system. That means diagrams, researching dependencies, infrastructure needed, understanding tradeoffs etc. Then I have a clear project plan and begin coding.
If your prototype works, you can begin architecting v2 of the system where you follow best practices, building components individually, separate responsibilities etc.
btw you also need a monitoring system. Check out https://grafana.com/.
For sure, you can download a local copy of Mongo and run it on your computer or server. https://www.mongodb.com/download-center
An easier alternative would be to use an online hosted version of Mongo, such as mLab
This way you don’t have to download/install anything and it’s easier to visually interface with your data.
The tradeoff is that Mlab costs money, whereas running a local instance is free
Building Winning Algorithmic Trading Systems, + Website: A Trader's Journey From Data Mining to Monte Carlo Simulation to Live Trading (Wiley Trading) https://www.amazon.com/dp/1118778987/ref=cm_sw_r_cp_api_glt_fabc_1401ZY31B8XWPAC45BRJ
I recommend people read Guru Investor first, he analyzes Ben Graham and other major investors (John Neff; David Dreman; Warren Buffett; Peter Lynch; Ken Fisher; Martin Zweig; James O'Shaughnessy; Joel Greenblatt; and Joseph Piotroski. ) and tries to make a quantitative and algorithmic approach for all the major investors surveyed, he also brings biographical info on why they approach the market a certain way.
The author is similar to OP, he started as a good programmer (computer scientist and was at MIT CSAIL) and only later got interested in finance and trading.
Gotcha, misread your statement.
From the other comments; selecting the lucky winner from multiple backtests is usually overfitting (even if you didn't use ML to overfit, you may have unconsciously overfit by "manually" fine-tuning parameters by hand, like "1.25 ATRs is better than 1.5" etc).
Algorithmic Trading by Ernest Chan has a good, approachable example (1.1) of hypothesis testing, where you run a Monte Carlo of sorts to understand how your strategy would have performed under different random samplings of market conditions, ordering of the trades, different returns, etc so as to see if the strategy is actually significant and can handle "what could have happened" or just "got lucky". Works best if your strategy has sufficiently high # of trades, ideally fixed or similar holding times (so triple barrier model is great), and better yet consistent entry criteria like buy on open, sell on close.
That might be something to look into.
> I'm interested in the approach as much as the result.
The approach is to take the parameters as a minimal part of your complete system. I like very much the approach presented by Van K. Tharp in his Trading Your Way To Financial Freedom - Amazon Link.
The setup is not, by far, the most important part of the system, up to the point that a system based on a random entry (coin toss) is presented. After that managing the position is a lot more important. He has some other books with a more detailed insight on his ideas on position management (similar approaches are of course presented by other authors which may happen to be your own cup of tea)
To check these ideas and give my own platform a run for the money I have made a quick strategy based in the book and:
Run it on 3 assets for a 10 year period ... not that good
Run it again with cash allocation changed ... improved the winners, worsened the losers
Run it again adding with the changed cash allocation and a wider stop for position management ... 3 winners ... (1 of the winners worse than in the 2nd run though ... )
The MACD parameters used are 12, 26, 9 ... 100% standard by all means and play no role into turning the strategy in a winner for the 3 assets. The SharpeRatio says that given the volatility of the systems you may prefer a 1% risk free rate each an every year ... but that's a matter of taste ...
See the runs, charts and output of the analyzers at: http://www.backtrader.com/posts/2016-07-30-macd-settings/macd-settings/
BinaryTree3 beat me to recommending de Prado. He also just came out with another book, Machine Learning for Asset Managers. Looking at the table of contents, he has a chapter called "Optimal Clustering," so maybe you'd find some use in it. I'd start with checking out his papers (ssrn) and talks he's given (youtube).
Btw I googled that book you mentioned and found a pdf of it. Skimmed through it and it doesn't look useful at all to me.
So for ideas I can try to come up with things myself, but it is hard, slow, and I’m not very good at it really. I’ve never used fundamentals.
What I do usually is directly copy and paste code an entry from the Kindle version of this book:
https://www.amazon.com/Entry-Exit-Confessions-Champion-Trader-ebook/dp/B07R8LZ4Z2/ref=nodl_
I first find an entry that is symmetrical, meaning it can stand alone as a strategy without an exit. I then try to create as many variations of the entry as possible. So:
Stoplosses: no stop, atr stop, dollar amount stop
Volatility filter: only trade when low volatility, only trade during high volatility, no volatility filter
Trend filter: require close>average(close,xbars), require close<average(close,xbars), no trend filter
I test all these combinations on about 20 symbols of my choosing.
Then you can do the reverse of the entry where you change buy to sellshort and sellshort to buy. Doing this doubles the amount of unique strategy combinations.
With just 1 entry that’s a lot of combinations, not even including combining exits. Each combination is a unique strategy.
This explains the concept much better: https://kjtradingsystems.com/bull-bear-regime-trading.html
You’ll find that you have so many strategies to test, you won’t need to come up with as many ideas.
Optimal f in your example is *0.4. So initoal amount of money not matters. Just mutiply *0.4 your full account and you have your optimal f.
In single event with only 2 fixed outcomes vinves optimal f =kelly criterion. But when the oucome it is not binary kelly criterion it is not acurate, the you can use vince s optimalf.
By the way this vince s book is way better for understanding key concepts https://www.amazon.com/-/es/Ralph-Vince/dp/0471757683
I use vinces optimal f In all my strategies, and it is the key factor of my succes.
Looking at Consumer grade hardware, I recommend checking out a Netgear ReadyNAS. It'll transfer at about 1gbs over your network assuming you're wired in. If on WiFi, use the 5ghz network to transfer at higher speeds
When you purchase a backup solution, put some Desktop SSD drives into it. Desktop SSD drives will be good enough because you'll be spending most of your time reading the data rather than writing it
On your laptop, you'll be able to mount a directory straight on your filesystem and have it available as a folder in your programs or scripts.
I have about 24tb of free space in one of my ReadyNAS devices. Works pretty will for what I need
https://www.amazon.com/NETGEAR-ReadyNAS-Attached-Business-RN31400-100NAS/dp/B00BO0MG02
Certifications come up all the time. I am personally certified in C#. What I've learned about certifications is that it helps you in the language details and intentions. It doesn't make you program any better. The only way to improve your programming is to do it. I personally think that learning certification material can be useful AFTER you know the language. Others may disagree, but I think it's good to get the programming experience and know get some coding in before learning about the details of the language.
As for books, I highly recommend reading Effective Java. Just look it up on Amazon and read it. It provides an extremely understandable way of knowing the little details of the language without being overwhelmed. But again, the only way to get better is to actually program. I'd recommend starting off a small Java project and applying some of the material in the book.
I read The Man Who Solved The Markets, and it talks about both his use of HMM and his development of Chern-Simons. It does make them seem correlated in regards to his application of math towards finance, but as I said I am not entirely sure how this level of math works and can most certainly be wrong.
not sure what URL that is but here's the course link directly:
first link from my google search
relevant: backtesting a lot of strategies the authors found on quantopian
>Freecodecamp
Are you referring to this?
Sure. https://www.amazon.com/Linear-Nonlinear-Programming-David-Luenberger/dp/0201157942
https://www.amazon.de/Optimierung-Statische-dynamische-stochastische-Verfahren/dp/3662469359
Both books are available at a shadow library of your choice
I believe they're referring to someone mention in this book:
https://www.amazon.com/Market-Wizards-Interviews-Top-Traders-ebook/dp/B006X50OPW/
I recommend it. It's a good read!
This book brings some interesting concepts together and is easy to understand
https://www.amazon.com/gp/product/B095Y2NHWY/ref=dbs_a_def_rwt_hsch_vapi_tkin_p1_i1
Testing and tuning market data systems by Masters is highly recommended!
It's not a finance specialized book, but I like numerical analysis by Sauer. Used it in college and still useful now. It goes through basics of numerical analysis and does mention a bit of finance aspects such as black-sholes.
Here is the Amazon link
Not very many. I think a large part of the problem is that people post ideas, but they are not thoroughly tested. I have learned over the years to be a rigorous tester.
An example of this was a YouTube channel who had tested numerous algo traders (Metatrader) and presented a strategy. I copied his rules and created an automated system which I backtested. I was very careful to get the specifics correct.
I had the same results he showed on the video. Then I went further back in history to test, obviously, you want to find leaks. Sure enough, I did. I scratched that trader and moved on.
As a side note, I would recommend fxdreema for building traders. It is very simple to use, since it is a drag and drop method (no coding). You can build simple models for free, more complex models require a subscription which is very affordable. You can build models in minutes once experienced. I built hundreds of models.
Probably the best advice is:
1/ Money/Risk Management
2/ Trade in the direction of the prevailing trend (no counter trading)
3/ Buy this book https://www.amazon.com/Trader-Vic-Methods-Street-Master/dp/0471304972
Spoiler: He ditched all the complex things for simple trendlines. I don't think he used support/resistance, just trend lines. I am pretty sure, he was more successful in longer term trading than daytrading. I remember he trading the SP500 and some other major players. Anyhow, one the best books I bought.
I have these too books: https://www.amazon.com/Machine-Learning-Algorithmic-Trading-alternative/dp/1839217715/ref=mp_s_a_1_3?crid=E12EQYON84BV&keywords=yves+python+ai&qid=1654874261&sprefix=yves+python+ai%2Caps%2C374&sr=8-3 https://www.amazon.com/Artificial-Intelligence-Finance-Python-Based-Guide/dp/1492055433/ref=mp_s_a_1_1?crid=E12EQYON84BV&keywords=yves+python+ai&qid=1654874392&sprefix=yves+python+ai%2Caps%2C374&sr=8-1 I found them very interesting and useful, as it ties the concepts with practical ways of implementing them without being too basic or too advanced. Disclaimer: I'm just studying the topic right now. No real project completed in the field.
Hey!
Absolutely. We're working on portfolio customization. I'm going to post a link to our roadmap here:
There is knowing the physics that makes a car drive and there is knowing how to drive a car. I have a masters degree in predictive analytics. This book is more useful.
Machine Learning and Data Science Blueprints for Finance: From Building Trading Strategies to Robo-Advisors Using Python https://www.amazon.com/dp/1492073059/ref=cm_sw_r_apan_i_FEX0SZSN4XGRBK46FM9E
If you're interested in the maths then here are some good books: "An Introduction to Generalized Linear Models" for an introduction, and assuming that you have probability and linear algebra knowledge, a more advanced book is "Generalized Linear Models with Examples in R". In my opinion the best and most detailed book for this topic.
It's a book, here you go: https://www.amazon.com.au/Hands-Machine-Learning-Scikit-Learn-TensorFlow/dp/1492032646
Highly recommend it to get started with ML in Python.
Truth. I’m a year in, and have probably spent 20 hours per week or more on the project. The time spent has been monumental like you said, but in a way it’s been such a natural way to spend my time - almost like the ideas and concepts flow and the platform has built itself. Sounds kooky but I have this endless flow of ideas and things to try that haven bubbling up for a year now.
For the first six months I was focused on making a usable platform. I had a sweet interface, screening tools and all that. But rapidly I realized I was building this for myself, and performance and precision was most important. I let myself be ok with rough edges and shifted my focus to things that mattered like live data speed, parallel processing, and brutal backtesting and analysis.
I read a lot of algo trading books for ideas, even the ones in other languages like python (which I should learn some day!) I like Kevin Davey
Algo trading Isn't that difficult, I'm doing this for over a year with 10k and I'm seeing an average of 2.5% monthly return. My method is using Cryptohopper trading bot + Binance exchange for the discount in fees., working wonders
This was an audio book I listened to on Dark Pools and some of the internal structure of the market.
So, it seems to be allowable to use the proceeds of a sale at T0 to buy a new stock on T0 or T1, as long as that stock is not sold before T2. I don't have a securities license, so I'm not sure if this is just my broker giving me a bit of margin or whether that's a regulatory thing (broker is Schwab in this case). If you violate this rule, Schwab will restrict your trading to only settled funds for a period of time and then it's exactly as you say, you couldn't buy anything until the T0 funds settled on T2. That particular rule that Schwab calls "good faith" might just be for Schwab, but others that they document seem to be regulatory in nature (e.g., SEC or FINRA rules). Here's Schwab's page on this: https://www.schwab.com/resource-center/insights/content/stock-settlement-why-you-need-to-understand-t2-timeline
Not a textbook, but I thought Tucker Balch's course was pretty good. (Not sure how much of it you will have seen before)
It teaches you the basics of how to apply ML to actual financial data, do stuff like portfolio optimization, use different regressors to predict returns, reinforcement learning, etc. I think it does a good job at laying things out such that you'll know where to start with experimenting on your own. (Although IMO the course ends too soon!)
python + the pandas/numpy libraries are a good place to start. Udacity as a good intro course on machine learning for trading for stocks that could easily be applied to crypto: https://www.udacity.com/course/machine-learning-for-trading--ud501
https://www.udacity.com/course/machine-learning-for-trading--ud501
Most of this course I just did manually in python but honestly this covers the fundamentals and you can pick whatever framework you want.
When talking about algo-trading, are you talking about this course: https://www.udacity.com/course/machine-learning-for-trading--ud501?
I mean kinda but not really. It’s the same as the DAX and the FTSE (or other similar indices). They look roughly the same and often will match the mood of the other but over a long enough period of time they aren’t that correlated.
XRP shares a 0.62 correlation with BTC compared to ETH’s 0.91, for instance. https://cryptowat.ch/correlations
That's what I originally thought... until I looked at this chart https://cryptowat.ch/charts/OKCOIN:BTC-USD-FUTURE-QUARTERLY and saw spikes of 20,000+ BTC traded within 1 minute that only moved the price $20???
If you tried to sell 20,000 BTC on binance spot (the next most liquid market behind bitmex and okex) that would tank the price down to $0 or pretty close to it.
Using data from both okex quarterly futures and binance spot market together... basically makes binance spot market data points entire worthless in terms of volume.
As any typical minute of trade on binance spot only sees maybe 50 BTC traded total.
Just curious if you can account for that/normalize quantities where massive leverage is possible.
EDIT: Wait a minute... cryptowat.ch is wrong about https://cryptowat.ch/charts/OKCOIN:BTC-USD-FUTURE-QUARTERLY aren't they??? Those aren't 20,000 BTC traded every minute... those are 20,000 contracts traded... each of which is only 0.01 BTC... so it's more like 200 BTC traded per minute, not 20,000 BTC, right???
https://www.kraken.com/features/fee-schedule
I think they start at 0.16%. If you look at the link and select Kraken April from the drop-down menu. The staffels are smaller than for Binance though. So if you plan on making a lot of trades it may be in your favor.
If you trade at least 500k a month then you are favored on Kraken when using maker orders. The first tier on Binance requires 10000 dollar worth of BNB in your account I believe.
Thanks for your input.
To answer your questions:
I took a look at your post history and noticed that you develop the Backtrader backtester. My choice to work with Zipline at the moment is not a dig against your software. Thanks for contributing to the community.
US and German interest rates are certainly correlated, even if they have diverged recently with Europe starting QE and America ending it. http://www.marketwatch.com/story/is-the-spread-between-the-treasury-and-the-bund-unsustainable-2015-05-29
What time frame do you have in mind as "short term"? You may just want to get your hands on some ZN/FGBL data and try out your hypothesis. Might also want to consider how exchange rate fluctuations will affect your trade.
Looks like there's a few of us in the same boat. It is indeed a fun project. I've been coding bits and pieces to search for inefficiencies. Then I've been trying out smaller manual trades to see how it works out.
My strategy is to build up from a kind of expert advisor to something that I will eventually let loose unattended. I'm almost ... there but still working on scaling things up. A lot of unexpected stuff can happen, slippage, flash crashes, de-leveraging ...
I can vouch for the advice from mementix. Just getting into backtrader and ccxt, wish I knew about them earlier. Just hope when the big boys from CME come in, they don't mess up all our strategies :)
PS. I got started with this course which bridged some of the initial finance gaps for me. Although you might already know what you need.
Good luck!
depending on how much work you're doing, I might even look into amazon lambda. lambda was designed around event-driven computing. something would generate a signal (price change, etc.) and it would execute a block of your code for every event, without renting a server or reserving any compute power.
having said this, you will always lose out in latency vs. other players on the cloud. assume you add an extra 100-250ms to your operations
>You will find limited uses for R in the industry
I have mostly read that hedge funds or other quantitative funds mostly use MATLAB or R. Even here in this Quant Intern description of Allston Trading (don't know if they are popular or good), they are asking for proficiency in R: https://www.linkedin.com/jobs2/view/66572464?trk=jserp_job_details_text
Maybe I am wrong or read very old threads. But yeah, I am starting to agree that Python is superior based on what I've read. Thanks for the info!
I saw you post in r/options also, but I'll respond here too. This is exactly the type of solution we've built Harvested Financial for. We're an options focused investment advisor. We build custom strategies alongside you and help execute the trades systematically. Strategy Execution as a Service.
The difference between having an advisor vs. a broker means that you can setup strategies without picking the specific strikes or trades - e.g. "Sell me the 10% OTM calls every week in TSLA" or "buy SPX three months out and delta hedge with put spreads". We have both strategy suggestions and templates, as well as execute completely bespoke strategies for individuals and managers.
There's no programming, and no trade management required. All trades are commission free and we charge a management fee that's less than most options based ETFs and competitive with other robo-advisors.
Please feel free to DM me, or schedule some time to talk.
Very cool.
I took a class in college where we used a specialized machine (at the time) I don't remember what it was called but basically it had a 60 core coprocessor. I'm trying to find what it was called, but these computers had something like this in them. Intel made them to study heterogeneous parallel processing. The coprocessor is basically something in between a conventional CPU and GPU. It was for loads where you might want to scale up CPU multiprocessing / multithreading without using a GPU for whatever reason.
When you say this cluster was faster than your gaming PC, were you running your compute code on the GPU or the CPU? If you were mostly compute bound wouldn't running CUDA on the GPU be faster (assuming you have a resonably high bandwidth GPU)? My guess is as input size grows GPU parallelization would exceed the performance boost of CPU multiprocessing and/or vectorization. Of course it would depend on how your computes are strutured, but my guess is for financial calculations GPU optimized code would be best.
We are going to be keeping all of the history so not relying on them for that.
I just tried this code https://pastebin.com/dMX7mZE0 and it is silent. But, there's this, and it's to the second. https://poloniex.com/public?command=returnTradeHistory&currencyPair=BTC_ETH
As far as I can tell from here:
And here
https://support.bitfinex.com/hc/en-us/articles/213919589-What-fees-do-you-charge-
There are no such fees. The only fee that should be applicable in my situation is the 0.001% market maker fee for orders executed, which is accounted for both in the logs and in the scripts I parse them with.
Depends what pair you want to trade. For btcusd the biggest exchanges are Coinbase Pro, Bitfinex than Bitstamp and Kraken. Binance is bigger but for btcusdt (tether).
All the info is available here: https://cryptowat.ch/assets/btc
An easy way, one example is cryptowat.ch you will need to obtain API keys from each exchange, this platform has a orderbook that can be easily paired and a Time and Sales. These exchanges and platforms are way behind mainstream platforms and exchanges when it comes to obtaining trade data easily like Through CQG for example But some OHLC and volume can be extract in excel through yahoo finance.
Haha I assume coming from a prop trading environment you mean a squawk box, no there is not.
Not sure what you mean by this.
…………….
​
I would just use their APi directly, REST and websockets are pretty easy technologies to learn, and the kraken documentation is prob better than a random custom lib. Use requests/orjson for REST and aiohttp for websockets. https://www.kraken.com/en-us/features/api
Others have mentioned Digital Ocean as a starting point, which is an excellent option.
I would also highly recommend Linode. They've been in the business nearly 20 years and may be even a tad simpler UI than DO.
Smallest instance server costs $5, which you can scale up and down on demand. There are faster CPU and GPU options.
1TB of S3-like Object Storage costs $20/month and can scale up to 50TB
It doesn't have all of the bells and whistles that AWS and DO have, but that's why I like it. You login, create a server, and it just works.
They currently have a free $100 credit. https://www.linode.com
Who knows but if you want to risk the 89 euros to find out, just buy it for a month and then cancel the subscription after a month. Put it on a privacy.com credit card so that it'll just destroy itself after 1 month.
> is it to inventorize the list?
Yes. When the client calls
LRUCache.get(key)
on an existing key, the position of that cache entry should be known immediately so it can get “touched” and moved to the front/back. This can be done with a dictionary lookup of: key -> list reference
Here’s an example in C++ specifically but the idea with the same data structures should be language agnostic:
https://leetcode.com/problems/lru-cache/discuss/680889/C++-Clean-simple-implementation-with-comments