Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Before moving on to my next idea, I wanted to look at the Williams %R forex system I've posted here, but applying a weekly timeframe. The results were, uh, very surprising. Here is a comparison of the four pairs, same system, no optimization, trading period 2010 through mid-Feb 2022:
The two symbols that I expected to not mean revert well, EUR-USD and JPY-USD, were better than the other two that I expected to mean revert better.
On an account size of about US$12.5k, the annual return comes in at 36.9% (includes spread, slippage, and borrowing costs). This is something that I would add to my portfolio today, if I were able to trade forex. The time in market is about 11%, so borrowing costs are low.
Taking this idea one step further, I will have to try this using RSI instead of the %R. The %R was an experiment, but RSI has worked very well for me with mean-reversion. That is for another day in the future.
I settled on my next idea: forex momentum. I have no idea what to expect, but I want to exploit an idea I have around momentum, since I am not that familiar with momentum systems. I decided to use forex again since the data is fresh and easy for me to work with. I will post my progress here later this week.
As if I did not have enough work to do, I have to let my curiosity get the best of me. The AUD/NZD forex pair was bothering me, mainly because I expected to see better mean-reversion from it, so I decided to look at the hourly resolution. Mean-reversion was better with my %R system at the hourly level (probably better if I used RSI), but I ended up going down a rabbit-hole.
I recall something @kevinkdog mentioned about Andrea Unger, fellow algo trader and World Trading Cup champion: he optimizes daily. I don't recall when, where, or how it came up (correct me if I'm wrong and you're reading this Kevin), but I wanted to know what would happen if I optimized this system on this instrument daily: 1 day in sample/1 day out of sample. During my first attempt, I made a mistake and optimized at the 5 hour (5 bars in/5 bars out) level, so I just let it run to completion. Then I adjusted to 1 day, then 5 day, 6 month, and 1 year, then compared to my base parameters. Here are the results:
(Adjusted Profit Factor is a 'worst case' calculation; I find it to be a good predictor of Monte Carlo simulation outcomes. Adjusted profit factor greater than 1.00 is good).
In Sample is, of course, high, as it should be, but the Out of Sample for the 5 hour was really high compared to the other . The in sample for the 5 hours is not a misprint, but for those not familiar with in-sample portion of walk-forward analysis, this is what would happen if we knew the best parameters in advance. Anyhow, I cannot imagine a 5 hour optimization would be practical and I'm not sure it would work (but who knows?).
Wow, talk about weird. I was just curious what daily optimization would look like and now I know. Optimization every 5 days and greater does not improve the Profit Factor with any level of statistical significance, when compared to the base values.
One final observation before I wrap up this weird little post; total number of trades at each optimization interval:
4351 - 1 year optimization
4202 - 6 month optimization
4017 - 5 day (weekly) optimization
3762 - Daily optimization
1894 - 5 hour optimization
In this case, the more I optimized, the fewer trades were generated. The fewer the trades, the lower the trading costs. Also (not seen here), is that the more frequent the optimization, the greater the profitability per trade, as measured by overall profitability.
These are just interesting observations and I'm not advocating for more frequent optimizations. I personally optimize my systems about once per year, maybe at 6 months depending upon the system. I look forward to digging deeper into this mystery as I progress on my algo trading journey.
If and when I can trade forex again, I would like to try this daily optimization experiment on a small lot size. Maybe I can run this in sim now.... hmmmm.....
Thanks for the clarification and kudos, @kevinkdog. Yeah, I don't know where I heard it, but I will have to dig into my archives to see who said it. I'm thinking it was a guest on Better System Trader.
And speaking of BST, I listened to the episode from December 2021 that you, Laurent, and Scott Welsh were on, this past weekend. Three different traders, personalities, and market approaches, with one thing in common: algorithmic trading. Great stuff and thanks for sharing your time. For anyone else reading this, it's an excellent episode... check it out:
I was doing some research for my next system (Momentum Pinball), but then got sidetracked on a Larry Connors system, Vol Panics, which is designed for the VXX, an ETF that trades VIX futures contracts. (Note: the idea below is not the Vol Panics system. I have ADD... oh look, a squirrel.)
The VXX is designed for short-term trading/speculating/gambling/hedging. Anyhow, I started looking at the last two bars of a 60-minute chart (the 15:30 bar and 16:00 bar) and noticed a pattern. Before I dive deeper, understand that I am looking at regular US Stock sessions, starting at 9:30 and ending at 16:00. Since I am looking at 60 minute charts, not 1 hour, my start time is 9:30. This explains the 30 minute bar at the end of the session.
Was I seeing a pattern or did I have some bias? I dumped the data into Excel and ran the numbers, which confirmed my thinking. Here is what it looks like on a chart:
Looking at the last 3+ years, the last two bars in the same direction for at least 54% of the time (there were a handful that were flat). This is, to me, statistically significant, so you know where I'm going with this: does this give me an edge? I started looking at other instruments, both ETF's and equities, and the ratios is almost always the same: 54-57% the same direction/43-46% different direction. This is simple momentum.
Looking back at the chart, I really want to grab those moves where they move in the same direction. I have a few different ideas around this that I will test:
Buy on open, close at the last minute of trading day
Buy with a limit order, using the Close of the 15:30 for my limit price
Set stops at the low (if going long)/high (if going short) of the 15:30 bar
Use a stop loss, based on ATR or other volatility measure
This idea checks all the boxes:
Volume and liquidity
Price action
Profitability
... and as the great Perry Kaufman would say, it satisfies my need for immediate gratification.
I have been thinking that I do not have any 'pattern' trading systems, of the type where I am using my algo to identify chart patterns (I could argue that any algo is identifying a pattern). I have played around with some of them, such as cup-and-handle, but nothing serious. I also have a set of pattern algos that were given to me a long time ago, but I have not explored or tested them. Anyhow, this is one that I've added to my idea list and is hopefully one that works.
This idea is not new for me, but this is the first time I have figured out something potentially tradable. Maybe it is my weird chart type.
One final thought: I've traded VIX futures (VX), unsuccessfully, though not for lack of trying or having a good system. At the time, I could not, for the life of me, get my orders filled (they only allowed limit orders at the time). It is nice to be able to work with the VIX, even if VXX is derivative product. Let's see what I can build from this.
Trading: Primarily Energy but also a little Equities, Fixed Income, Metals, U308 and Crypto.
Frequency: Many times daily
Duration: Never
Posts: 5,059 since Dec 2013
Thanks Given: 4,410
Thanks Received: 10,226
As you know VXX and other VIX products invest in VIX Futures. Some/all rebalance at the end of the day. So I wonder if what your seeing is the effect of that rebalancing?
Thanks @SMCJB, I did not know the difference between an ETF and ETN, but now I do. It seems to have a beneficial tax treatment, but I have not figured the taxation on it yet.
I was thinking that it might have been due to rebalancing also, but the volume at the minute level is consistent up to the last minute (then you see a spike). I am using 1-minute charts for building the system, for precision. I'm looking to exit 1-2 minutes before close. I cannot imagine many people hold this overnight. I don't think I would sleep.
There are some interesting things that I noticed on Fridays, which is the day the weekly contract expires. The idea is not as profitable that day; it is profitable, but significantly less. Without limit orders, that advantage could evaporate. I will have to look at end of month next.
Just for fun, etf.com rates the liquidity of VXX by this measure:
I'll remember it next time I have one million dollars I can dedicate to a single instrument.
Just to round out the discussion here, this is what the P/L for the 1st day of the month, last day of the month, and all other days look, on average (5k account size; leveraged 2:1):
The sample size is not huge (38 days each for 1st of month, last of month), but I think it's safe to say there is some significance to the first trading day of the month (it's soft). I only tested back to Jan 1, 2019, as the VXX instrument changed in 2018. I will need more data and time with this, of course.
This is a lot of work for a little profit, but it's a fairly consistent profit. I'm thinking that if I am sitting on cash or I have the purchasing power available towards the end of the trading day, this might be something I trade, though I would have to commit to it daily. For me, it is an academic exercise, as I cannot trade this short time frame.
A few thoughts about bias (and data)
I did not plan to post anything this weekend, but I was working on something that highlighted how easily bias can creep into our analysis. I had observed something last night while doing analysis for my upcoming Momentum Pinball system. While looking at a signal that occurs infrequently, I kept seeing something on the chart that I thought was a pattern, one that I could exploit. I kept at it and I kept seeing it, more often than not. I felt like it was happening at least 2/3's of the time.
This morning, I decided to test my bias, to see how often this pattern appeared, using the same data set. Here is story the data told me:
The right column shows the number of occurrences of the 'pattern' I thought I was seeing, out of a sample of 100 signals. My mind was telling me that I was seeing it a lot, but the data revealed that it was happening less than half the time. This was pure confirmation bias, where my mind was discarding what it did not want to see and putting more weight on those patterns that matched what I wanted to see.
And this kids, is reason number 3247 why I develop and trade using a systematic approach.
If you are wondering why I did this by hand, here is my stock answer: I do some analysis by hand or using Excel because it allows me to get a feel for the data and also allows me time to think about what I'm doing. Think of it as an immersion program for trade analysis. This method also identify problems with a system idea that I may not find by just slapping together some code (e.g. what happens to this idea when the price gaps?). It is an invaluable part of my standard process for any new system.