Can a Retail Trader Succeed at Algorithmic Trading? (Part 6)
Posted by Mark on March 29, 2021 at 07:12 | Last modified: March 9, 2021 09:28Today I will continue with presentation and commentary in an algorithmic trading thread that took place on a popular online forum about 18 months ago.
I believe flippant replies like the following are of little use with their absolute, elitist, and hollow claims:
> The basic fact of the matter: if you love problem solving, the market is just
> an other [sic] puzzle, and you can have as much money as you want.
>
> Its [sic] not in the numbers or indicators, its [sic] the edge around which you
> design the trading system.
>
> Running tests won’t give you the edge, spend time finding your edge [sic:
> comma splice, John Rubadeau].
>
> Thats the core of your system, manual or automated [sic, sic, sic].
I often find such replies to be sorely in need of proofreading, too.
In total contrast, I think the following reply sounds very educated and even brilliant in places:
> So I think it’s possible for pretty much anyone to make money using
> simple systematic trading strategies. Most of this money comes from
> being exposed to diversified sources of risk, so no ‘secret sauce’
> or fancy ML techniques are needed. These strategies will mostly be
> quite slow in nature, so not HFT. They will be based on sources of
> risk premia that decay very slowly, if at all. They will not be high
> Sharpe Ratio, but by diversifying over a large number of uncorrelated
> instruments and a number of different strategies I think an expected
> SR of 1.0 is feasible.
Based on my limited research, I don’t know if I agree with this. I’ve looked at roughly 300 simple strategies on three different markets and none came close to passing the KD criteria although I do believe these criteria to be stringent (probably requiring better than SR of 1.0). Could I trade some of these markets during uncorrelated times (I don’t think it makes as much sense to speak of “uncorrelated markets” because correlation changes) and get an overall SR of 1.0? I would regard this as pretty good because my testing shows SR for the S&P 500 to be around 0.35.
> Does this count as success? A SR of 1.0 achieved over ten years or
> more would be top quartile for nearly every hedge fund category.
> But you will struggle to make a living as a trader with a SR of 1.0,
> if trading is your only source of income, unless you are very
> well-capitalized (equates to lower risk and return target).
This is very interesting and theoretical. I would need to backtest and try and correlate SR with annualized return, drawdown, and then figure out reasonable position sizing to determine whether profits could exceed annual living expenses.
I will conclude next time.
Categories: System Development | Comments (0) | PermalinkCan a Retail Trader Succeed at Algorithmic Trading? (Part 5)
Posted by Mark on March 26, 2021 at 07:00 | Last modified: March 9, 2021 08:54I have been presenting and discussing a thread regarding algorithmic trading that took place in a popular online forum about 18 months ago.
I left off with a reply that concludes:
> We live in a time where funding is not extremely difficult. From instant loans to
> credit cards to friends and family to mortgages — if you have an extremely good
> algo then you’ll get the funds. If you cannot get the funds then you’re probably
> not smart enough to participate in the industry anyway. Consider it a test.
This reply included some really good points until now when some credibility is lost. I think fundraising is extremely difficult. Then again: 1. I have yet to generate an “extremely good algo” and; 2. maybe I am not smart enough (see third paragraph here about nothing unique) to participate in the industry.
> As KD said: fitting a strategy to past data is the biggest “crime” I see developers
> making. But every strategy is dependent on past data at the very least for pattern
> recognition. When we say a strategy doesn’t “work” anymore, what we’re really
> saying is that we can’t wait around 50-100 years for it to work again. Because it
> probably will work again given enough time.
Five stars for this reply, baby! Countless times have I heard/read people say that trading systems break never to be profitable again. One reason for this could be because more and more people trade them, which can kill the edge. As time passes, the number of available strategies approaches infinity faster than the number of traders, which suggests a decreasing likelihood that a particular strategy will be traded live. I therefore believe that strategies no longer in vogue can be profitable again years after their trading frequency diminishes.
Incidentally, this reminds me of the Callan Periodic Table of Investment Returns where we frequently see asset classes that significantly underperform in previous year(s) suddenly start to outperform going forward (the cycle may repeat).
> De Prado’s point is that since all strategies have a shelf life, you need a team to
> build a strategy factory for true long term success. He is also not talking about
> retail but about other’s people money. You can’t take the risk free or index rate
> for 2 years with OPM while you figure out a new winning strategy without going
> out of business. A single retail trader could do exactly that.
This is interesting rationale for a team-based approach to trading strategy development. For this and other reasons, I agree with the approach (also discussed in Part 1).
Use of the term “strategy factory” is notable here, too.
I will continue next time.
Categories: System Development | Comments (0) | PermalinkCan a Retail Trader Succeed at Algorithmic Trading? (Part 4)
Posted by Mark on March 23, 2021 at 06:44 | Last modified: March 8, 2021 13:44Today I continue presentation and commentary on an internet thread (subtitled “KD vs. EC”) regarding algorithmic trading that took place about 18 months ago.
> I think they are both “right” in their own way. If you look at what KD does,
> it’s a little different from EC’s strategies.
KD gets his customers to work for him (see second paragraph here)! I wonder how many are aware of this fact.
> The “trading robots” you see on sites like collective2 aren’t serious edges.
> Only an idiot would sell a serious proven edge to random Internet anons for
> pennies on the dollar, and idiots don’t develop profitable trading algos.
> If you have a proven edge, you raise capital to trade it yourself or sell
> it to a quant fund for serious lump-sum cash and a job.
As I discussed near the end of Part 3, it’s not so easy to just “raise capital to trade it yourself or sell it to a quant fund.” Proving the edge probably means creating an incubator fund (or friends and family fund, if one can be lucky enough to gather a reasonable minimum amount of capital this way) for purposes of trading and auditing. That can cost many thousands of dollars, which singularly establishes a high barrier to entry.
> Both of them are nice guys, and I’ve complimented them for their contributions,
> but neither one of them is really “killing it” in this game. I tend to learn a lot
> more from those with serious (1M+) skin in the game, and I don’t mean OPM.
We don’t know whether either is “killing it,” much less how much “skin in the game” (actual capital deployed) either has (see fourth paragraph here).
> And there lies the bait. Yes, in theory a large account can withstand large
> drawdown if low leverage is used, but most people do not have large accounts,
> and those that do, will pull the plug if drawdown gets to 20 percent or more.
> I have seen clients closing accounts after 10 percent loss.
This max drawdown is consistent with the kind of performance I have come to believe is necessary to have something of institutional quality.
> The algorithms the largest banks and funds use depend on infrastructure or size.
> There’s almost no way an at-home type trader can participate in this. Many
> markets have large capital requirements — 100s on millions just to enter.
> For others you need best co-location or contacts in the industry.
I would imagine these algos are of the HFT variety. I don’t know whether this person knows from experience or is just hypothesizing, but s/he makes some really good logical points. The post continues:
> I’ve been following people who sell signals for a long time. There are very rarely
> profitable systems but they always go private fast because selling something that
> can make millions for thousands is not a business. On top of that you have people
Speaking of someone who has been following signal sellers for a long time, I’d like to hear Mark Hulbert’s take on this.
I will continue next time.
Categories: System Development | Comments (0) | PermalinkCan a Retail Trader Succeed at Algorithmic Trading? (Part 3)
Posted by Mark on March 18, 2021 at 07:51 | Last modified: March 8, 2021 10:58Today I continue presentation and commentary on an algo trading thread that took place about 18 months ago.
> Ok, wait a minute: every time traders are talking about big players and market
> manipulation, everyone seems to agree that algos are running the game. So,
> assuming that this is right – someone stating that 85% of market is driven by
> them – that means the big banks, players, etc. actually have financial
> algorithms that work and are profitable.
>
> If this is true, why is there, after decades of banks using them, no market for
> retail traders to buy them, even if it is not the best/newest version of all?!
This is a very interesting point. Question the premise, though: who is to say that many big firms don’t have profitable algos?
Aside from banks, the “etc.” is probably asset managers and hedge funds. With regard to the former, passage of the Dodd-Frank Wall Street Reform and Consumer Protection Act (July 2010) made it illegal for deposit-taking institutions to engage in prop[rietary] trading. That would include banks and many asset managers. With regard to hedge funds, I studied 2008 – 2016 and found them to underperform (see table here). This may leave some smaller firms that attempt prop trading for a period only to realize they can’t make [enough] money at it and quit. I therefore think it likely that the overall universe for prop trading, where algos are being used to generate the huge Wall Street profits of legend, is significantly diminished.
I’m not convinced that “everyone” (who “seems to agree that algos are running the game”) is all that informed—especially in the face of the kind of reasonable doubt just discussed. People repeat what the financial media writes or broadcasts. Does anyone actually check and scrutinize sources or underlying motives? Not nearly enough, I suspect.
One person responded:
> The reason is only bank and large firms’ algos can work for them such as
> market making and HFT. Hardware barrier of entry is in 10s of millions.
I can’t verify the claim of eight figures, but I do believe in a large and formidable barrier to entry.
> What you are looking for is a strategy can can be deployed on retail
> level. While those exist, no one in their right mind would disclose it.
This would imply the strategies given by KD (see second-to-last paragraph here) are bogus.
> It is not that difficult to raise funds and trade it, as long as it
> indeed has positive expectancy.
>
> You will not find it anywhere in public domain.
I don’t believe it is ever easy to raise funds for investment. This article claims the financial services industry has a 12% success rate. Another article claims 90% of financial advisors will fail within the first three years. Claims like these along with the personal roadblocks I have discovered around the wealth management industry make me believe raising money is anything but “easy”—a word that I as a marathon runner will never take for granted (injuries!).
And once again: forget the public domain. You will have to uncover it yourself.
I will continue next time.
Categories: System Development | Comments (0) | PermalinkCan a Retail Trader Succeed at Algorithmic Trading? (Part 2)
Posted by Mark on March 15, 2021 at 07:00 | Last modified: March 8, 2021 08:23Today I continue presentation and commentary on an internet thread regarding algorithmic trading that took place about 18 months ago.
> …financial machine learning (ML) is virtually impossible to do right because of the
> large amount of data you need, awareness of bar types and binning, and many
> other seemingly trivial but hugely important things. To me, it’s borderline
> worthless to even try… Leave ML to the MMs and big desks.
I took several Datacamp courses on ML but have yet to do any work of my own in this area. That aside, this sounds like an argument with some teeth.
Someone else commented:
> BTW, I am disappointed with KD as he doesn’t seem to contribute to the forum.
I couldn’t disagree more. One of my biggest pet peeves is a vendor who shows up online to defend themselves anytime someone writes something that even hints toward negativity (KK is the worst). Do they think they save face by trying to discredit everyone who doesn’t portray them in a brilliant light? While I am skeptical toward reviews and testimonials (see here and third paragraph here), I would sometimes rather let these speak for vendors than the vendors themselves.
This strikes me as one of the best comments of the entire thread:
• Finding a decision rule with positive expectancy (FDRPE) is… [almost] trivial.
• FDRPE on daily data that goes back 20+ years is (IMO) foolhardy.
• FDRPE on daily data that may be tweaked every 6-9-12 months to continue that
positive outcome… may benefit from [ML] pattern-recognition routines… but…
• ML depends on data stability that is at odds with the very nature of time-series
phenomena…
To me, this argues for just how difficult trading strategy development really is (see fourth paragraph here).
> In my tick-scalping days, I put T/A up that looked good for 20-30 minutes; I relied
> on it for the next minute or two. For trend-exploitation, I put up daily candles
> that go back maybe 6-12 months, and rely upon it for the next week or so.
This is shocking, but consistent with my own studies. As discussed in the last three paragraphs here, I did not succeed in looking at four years IS followed by four years OOS and then testing on a subsequent four years. Maybe I should just test the first few trades of OOS2 to see if any edge exists.
Another post reads:
> You are new here, so I will give you some benefit of the doubt. Get it in your head,
> you cannot find algo with positive expectancy ANYWHERE. The only way to get it is
> to create it yourself.
KD disagrees. In fact, if you purchase his product then he gives you several strategies that he says still work in addition to his entire strategy development methodology (don’t mistake this for an endorsement).
I will continue next time.
Categories: System Development | Comments (0) | PermalinkCan a Retail Trader Succeed at Algorithmic Trading? (Part 1)
Posted by Mark on March 12, 2021 at 07:31 | Last modified: March 8, 2021 13:47I recently stumbled upon a thread on a prominent online forum that is roughly 18 months old. I started reading and realized I have some unique perspectives to share since I am actually ankle-deep in algo trading myself and have taken one of the courses discussed (see second-to-last paragraph here).
The reason I am responding here rather than in the forum itself is because the walls have ears. Internet forums and social media are primary vehicles for communication between retail traders, but vendors often frequent these sites as well. On multiple occasions, I have seen someone subscribed to a trading service get banned by the vendor for posting negative feedback in forums and social media. More details would probably be needed to determine whether this is legal (i.e. do they just get cut off once the subscription runs out? Are they banned immediately with pro rata reimbursement for what subscription remains?), but bottom line is that it happens.
Since I have been a customer—and a customer who does not like to burn bridges—I am keeping personal comments to my unmonetized, low-traffic blog rather than posting in the middle of Grand Central Station.
The thread begins:
> KD, an (apparently) successful algorithmic trader/author claims simple strategy
> works and will always work.
>
> EC, another guru in this field, however, says simple quant strategies don’t work
> anymore and machine learning is a must if you want to succeed in trading. He also
> says that it is impossible to do ML-based system trading on your own; you need a
> team based approach, since it is so [labor] intensive…
Although I only tested ~300 simple strategies the KD way, none came close to working. Yes, he does teach the simpler the better, and the strategies he gives you as part of his course are simple themselves. Because I couldn’t find anything that met his criteria, though, I have to remain skeptical.
I like the EC comment about doing ML-based strategy development with other people. For multiple reasons, I totally believe trading strategy development should be done in groups (see last paragraph here).
The post continues:
> I believe EC has gone on record saying the strategies in his book are old strategies
> that don’t work for him anymore. I wouldn’t be surprised if KD did the same in his
> book. Seems kind of silly to put strategies in your book you are still using. Both…
Right?! The post continues:
> publications… are seminal works in retail algo trading. KD is one of the few people
> with a verifiable record in a trading competition (though we sort of take his word
> he did it algorithmically). I’d listen to what he has to say…
Interesting comments about KD’s credibility. Yes he was probably verifiable at one point. Is he now? We really don’t know. I’ve been writing on this topic going back many years.
I will continue next time.
Categories: System Development | Comments (0) | PermalinkReview of Python Courses (Part 33)
Posted by Mark on March 9, 2021 at 06:54 | Last modified: February 21, 2021 07:26In Part 32, I summarized my Datacamp courses 95-97. Today I will continue with the next three.
As a reminder, I introduced you to my recent work learning Python here.
My course #98 was Practicing Statistics Interview Questions in Python. This is a very comprehensive course that covers the following topics:
- Conditional probabilities
- Central limit theorem (from numpy.random import randint)
- Probability distributions
- Descriptive statistics
- Categorical data (from sklearn import preprocessing)
- Two or more variables
- Confidence intervals (import scipy.stats as st; from sm.stats.proportion import proportion_conf)
- Hypothesis testing (from scipy.stats import sem, t, ttest_ind)
- Power and sample size (from statsmodels.stats.power import zt_ind_solve_power)
- Multiple testing (from statsmodels.sandbox.stats.multicomp import multipletests)
- Regression models (from sklearn.linear_model import LinearRegression, LogisticRegression)
- Evaluating models (from sklearn.metrics import mean_squared_error, confusion_matrix, recall_score)
- Missing data and outliers
- Bias-variance tradeoff
>
My course #99 was Intermediate Spreadsheets for Google Sheets. Topics covered in this course include:
- Data types for data science
- Convert or die!
- Common data transformations
- Rounding numbers
- Generating random numbers
- Logical operations
- Flow control
- Blanks, missing values, and errors
- Cell addresses
- Lookups and matching
- Bringing it all together
>
My course #100 was Practicing Coding Interview Questions in Python. This is probably the most comprehensive and dense course of all. I took a long time getting through this, but the amount of material covered is really incredible. Props to instructor Kirill Smirnov! The course covers:
- What are the main data structures in Python?
- What are common ways to manipulate strings?
- How to write regular expressions in Python?
- What are iterable objects?
- What is a list comprehension?
- What is a zip object?
- What is a generator and how to create one?
- How to pass a variable number of arguments to a function?
- What is a lambda expression?
- What are the functions .map(), .filter(), and .reduce()?
- What is recursion?
- What is the difference between a NumPy array and a list?
- How to use the .apply() method on a dataframe?
- How to use the .groupby() method on a dataframe?
- How to visualize data in Python?
>
I will review more courses next time.
Categories: Python | Comments (0) | PermalinkReview of Python Courses (Part 32)
Posted by Mark on March 4, 2021 at 07:48 | Last modified: February 19, 2021 10:46In Part 31, I summarized my Datacamp courses 92-94. Today I will continue with the next three.
As a reminder, I introduced you to my recent work learning Python here.
My course #95 was Dimensionality Reduction in Python. This course covers:
- Introduction
- Feature selection vs. feature extraction
- t-SNE visualization of high-dimensional data (from sklearn.manifold import TSNE)
- The curse of dimensionality (from sklearn.model_selection import train_test_split; from sklearn.svm import SVC)
- Features with missing values or little variance (from sklearn.feature_selection import VarianceThreshold)
- Pairwise correlation (hide correlation matrix redundancy)
- Removing highly correlated features
- Selecting features for model performance (from sklearn.feature_selection import RFE)
- Tree-based feature selection (from sklearn.ensemble import RandomForestClassifier)
- Regularized linear regression (from sklearn.linear_model import Lasso)
- Combining feature selectors (from sklearn.linear_model import LassoCV)
- Feature extraction
- Principal component analysis (from sklearn.decomposition import PCA)
- PCA applications (from sklearn.pipeline import Pipeline)
- Principal component selection
>
My course #96 was Writing Efficient Python Code. Topics covered in this course include:
- Defining efficient
- Building with built-ins
- The power of NumPy arrays
- Examining runtime (%timeit)
- Code profiling for runtime [pip install line_profiler; %lprun -f foo(args)]
- Code profiling for memory usage (import sys, pip install memory_profiler)
- Efficiently combining, counting, and iterating (from collections import Counter; from itertools import combinations)
- Set theory
- Eliminating loops
- Writing better loops
- Intro to pandas dataframe iteration
- Another iterator method: .itertuples() [faster than .iterrows()]
- Pandas alternative to looping (use .apply() on an entire dataframe)
- Optimal pandas iterating (use .values to get array rather than series)
- Final tips
>
My course #97 was Machine Learning for Finance in Python. This course covers:
- Predict the future (e.g. stock price changes) with machine learning
- Data transforms, features, and targets (import talib)
- Linear modeling with financial data
- Engineering features (from sklearn.model_selection import ParameterGrid)
- Decision trees (from sklearn.tree import DecisionTreeRegressor)
- Random forests (from sklearn.ensemble import RandomForestRegressor)
- Feature importances and gradient boosting [np.argsort(); from sklearn.ensemble import GradientBoostingRegressor]
- Scaling data and KNN regression (from sklearn.preprocessing import scaler)
- Neural networks (from keras.models import Sequential; from keras.layers import Dense)
- Custom loss functions (import tensorflow as tf; import keras.losses)
- Overfitting and ensembling (from keras.layers import Dropout; from sklearn.metrics import r2_score)
- Modern Portfolio Theory (MPT) and efficient frontiers (review this complex code involving covariance)
- Sharpe Ratios, features, and targets
- Machine learning for MPT
>
I will review more courses next time.
Categories: Python | Comments (0) | PermalinkReview of Python Courses (Part 31)
Posted by Mark on March 1, 2021 at 07:37 | Last modified: February 18, 2021 13:43In Part 30, I summarized my Datacamp courses 89-91. Today I will continue with the next three.
As a reminder, I introduced you to my recent work learning Python here.
My course #92 was Market Basket Analysis in Python. This course covers:
- What is market basket analysis (using lambda function for string processing)?
- Identifying association rules
- The simplest metric (from mlxtend.preprocessing import TransactionEncoder)
- Confidence and lift
- Leverage and conviction
- Association and dissociation
- Advanced rules
- Aggregation
- The Apriori algorithm (from mlxtend.frequent_patterns import apriori)
- Basic Apriori results: pruning (from mlxtend.frequent_patterns import association_rules)
- Advanced Apriori results: pruning
- Heatmaps
- Scatterplots
- Parallel coordinates plot (from pandas.plotting import parallel_coordinates)
>
My course #93 was Winning a Kaggle Competition in Python. Topics covered in this course include:
- Competitions overview
- Prepare your first submission (from sklearn.linear_model import LinearRegression)
- Public vs. private leaderboard
- Understand the problem (from sklearn.metrics import roc_auc_score, f1_score, mean_squared_error, log_loss)
- Initial EDA (create/extract hour feature)
- Local validation (from sklearn.model_selection import KFold, StratifiedKFold)
- Validation usage (from sklearn.model_selection import TimeSeriesSplit)
- Feature engineering
- Categorical features (from sklearn.preprocessing import LabelEncoder)
- Target encoding
- Missing data (from sklearn.impute import SimpleImputer)
- Baseline model (import train_test_split; from sklearn.ensemble import GradientBoostingRegressor)
- Hyperparameter tuning (from sklearn.linear_model import Ridge)
- Model ensembling
- Final tips
>
My course #94 was Machine Learning for Time Series in Python. This course covers:
- Kinds of time series and applications
- Machine learning basics [from sklearn.svc import LinearSVC, .reshape()]
- Combining time series data with machine learning (from glob import glob; import librosa as lr)
- Classification and feature engineering (axis = -1)
- Improving the features we use for classification (from sklearn.model_selection import cross_val_score)
- The spectrogram—spectral changes to sound over time (from librosa.core import stft, amplitude_to_db)
- Predicting data over time (from sklearn.metrics import r2_score)
- Cleaning and improving your data (percent_change function, visualizing outlier thresholds)
- Creating features over time (from functools import partial)
- Time-delayed features and auto-regressive models
- Cross-validating time series data (from sklearn.model_selection import ShuffleSplit, TimeSeriesSplit)
- Stationarity and stability (from sklearn.utils import resample)
>
I will review more courses next time.
Categories: Python | Comments (0) | Permalink