ahgt_123


Total Posts: 9 
Joined: May 2020 


I am testing some mean reversion strategies on intraday data (1 min  15 min) basically simple time series models (arima ,arima + garch) + some other oscillators as exogenous variables.(my main aim is more to get a decent R2 than making a live strategy).
I read a lot of papers about modelling intraday volatility using fourier transforms and stuff and how it is absolutely required in intraday trading.Theoretically, it also made sense to me and so implemented the model by andersen & bollerslev.It captured the intraday vol curve pretty well on plot.
However ,the performance of the model didn't increase neither in R2 nor profitability and i have tried multiple things.
I wanted to know if this feature is generally used in live trading by real quant traders in any setting (futures/options) or is it merely a theoretical thing and i should focus on other stuff.





gaj


Total Posts: 103 
Joined: Apr 2018 


The most important thing in trading is forecasting expected returns. Forecasting volatility can be useful but it is by no means "absolutely required".
I'm curious about what you have tried. Can you provide more details about the model that you're trying to make? 



ahgt_123


Total Posts: 9 
Joined: May 2020 


The models are general arima models with exogenous variables :
where r is the return ,err error term and x1 ,x2 exogenous variables(oscillators). The intraday adjustment said to write r as:
where s is the seasonality calculated by the fourier regressions.
The paper said to use r_hat for modelling instead of r which i did. The R2 of the model did not improve, neither the profitability of simple trading strategies( short/long when forecasted r greater/lesser than actual ; short/long with thresholds ; short long with volatility(modeled as garch) based thresholds).





gaj


Total Posts: 103 
Joined: Apr 2018 

 

ahgt_123


Total Posts: 9 
Joined: May 2020 


Sorry , i meant the reverse :
forecast > actual ; long forecast < actual ; short 




gaj


Total Posts: 103 
Joined: Apr 2018 


yes that is exactly the gambler's fallacy. 



ahgt_123


Total Posts: 9 
Joined: May 2020 


How to backtest then ?
P.S. I don't understand how this relates to gambler's fallacy.I dont have any practical experience but i guess most models would be backtested in this format only or may be the reverse for momentum based strategies.
Also, anyone has any idea on intraday periodicity modelling ,will it help in improving R2 of the model in any form (transformation etc.) .
I dont have any options data so i cant really backtest trading vol ,but i do have vix data. Will it be equivalent if i fit the model directly on vix index?





gaj


Total Posts: 103 
Joined: Apr 2018 


The wiki's description of the gambler's fallacy is "the erroneous belief that if a particular event occurs more frequently than normal during the past it is less likely to happen in the future".
That's what you're assuming: "actual_t was higher than forecast_t in the past period, therefore actual_{t+1} should go down, so I should go short".
I'm not saying this is necessarily false, but what is the justification for it? 



ahgt_123


Total Posts: 9 
Joined: May 2020 


if you think it in terms of returns :
if forecasted return is positive  you go long. if forecasted return is negative  you go short.
most models (mean  reversion ) works in this setting only.
now if you substitute prices for returns then forecasted prices and actual prices comes in play.





gaj


Total Posts: 103 
Joined: Apr 2018 


Ok, I misunderstood what you meant by "forecast > actual ; long". I thought you were comparing the forecasted return vs actual return in the last period. 



Maggette


Total Posts: 1233 
Joined: Jun 2007 


Nah, screw FFM for return data.
I would suggest using empircal mode decomposition (EMD) for return data and plug the first couple of mode functions as X in a ARIMAX model.
Not that anything fruitful will come out of it though, but since you don't want to trade it, it's an exercise I guess.
I would suggest t simulate a random process with seasonal volatility first and check if and how you could fit your ARIMA model to the surrogate data. 
Ich kam hierher und sah dich und deine Leute lächeln,
und sagte mir: Maggette, scheiss auf den small talk,
lass lieber deine Fäuste sprechen...




doomanx


Total Posts: 77 
Joined: Jul 2018 


I'm not sure why you expect something like this to work (especially after transaction costs). Univariate mean reversion is one of the most well known 'effects' (even technical analysis and such is trying to capture it). Without crosssectional or orderbook data you'll never get enough signal.
You mention you aren't trying to build a profitable trading strategy, just increase r2. I don't get why you'd want to do this at all, but if that gets you full mast grab the biggest fattest neural network you can find and slap that on there. It's still not helpful for anything.
'if forecasted return is positive  you go long. if forecasted return is negative  you go short.'
Ok, but this doesn't have to be mean reversion then. What you're really doing is just trying to find a way to forecast returns. If you really really care about mean reversion, you should start asking questions such as; Is this market actually mean reverting? Will I get blown up before it reverts to wherever it's going? This is a more productive line of thought. 
did you use VWAP or triplereinforced GAN execution?



nikol


Total Posts: 1126 
Joined: Jun 2005 


You read paper and formally trying to use their model to get same results.
This paper should have some section/paragraph listing assumptions. Check them. One of assumptions could be stationarity of underlying process. Therefore, check your residuals.
i.e. this: (r(t)a*r(t1)p1*x1(t)p2(x2(t)))/b = err must be more or less stationary.
Your R2 ~ average(err^2)
Then, after you understood what works (or does not) follow the path outlined by Maggette.
It is all about assumptions.
My PhD professor told me once  "Nik, if you don't see straight line by eye, no smart algorithm can see it either". Do you see seasonality in data? Are you trying to find black cat in the black room? Is it there?






This approach doesn't make any intuitive sense to me. You're scaling the forecasts from an ARIMA model by the volatility forecast, right?
So let's say the general model is that 70% of the price move meanreverts over a 1 minute model. And let's say your seasonal volatility forecasts 200% of baseline vol. So now you expect a 140% mean reversion? That sounds like nonsense. It's hard for me to imagine any sensible reason we'd expect mean version to exceed 100%.
This approach is unnecessarily adding a level of uncalibrated and untested indirection. Why even forecast volatility at all? All you ultimately care about are returns. Why not take those seasonal variables that you're using in the volatility model, and drop them as interactors directly into the return regression?
In general, I'd caution from putting too much stock in the implementation details of academic papers. The academic's incentives are different than the practitioner's. His goal isn't to make money, it's to impress the tenure committee. That's often done by adding a lot of unnecessary mathematical wizardry into published papers. 
Good questions outrank easy answers.
Paul Samuelson 


ahgt_123


Total Posts: 9 
Joined: May 2020 


@Nikol The Ushape in intraday periodicty is a very common phenomenon observed in every tradeable security(stocks ,currencies ,bonds) in markets due to time of day effect(morning ,lunch ,preclose session) and many papers have been written to model them.
Here is the data for an index for 1 year on 1 minute intervals :
Here is what the model captured.
It isn't entirely perfect ,as i have omitted some indicator variables from regression for simplicity, but you get the idea. I thought that such a well documented significant phenomenon must have made its way in practical trading in one form or another. It can also a have significant impact on intraday pricing of volatility.





ahgt_123


Total Posts: 9 
Joined: May 2020 


@EspressoLover
It doesnt concern mean reversion as much as it concerns the normality assumption of returns.
Since the intraday returns are plaqued by significant seasonality of volatility ,without accounting it, the autocorrelations and crosscorrelations metrices may not properly reflect the true process.
So ,the author said that its necessary to model it and adjust the returns accordingly. 




I see where the concern is coming from, but the approach still doesn't make sense. If there's heteroskedasticity in the dataset, then the correct approach is to use weighted regression in inverse proportion to the dependent variable's volatility. (Well, technically the residuals, but R^2 is so small in return forecasting, that it's essentially the same.)
If I'm understanding you correctly, the paper's approach is to simply linearly scale the forecast by the heteroskedasticity. I've never heard of such a thing either in finance or anywhere else. It's hard for me to even imagine a scenario where that *would* work.
In practice, you can probably just ignore the seasonal heteroskedasticity entirely. Trying regressing with both weighted and unweighted OLS and compare the in and outsample forecasts. My guess is the two models are 90%+ correlated. And even if not, do you really want to underweight your model on 3:30 PM, just because prices are more volatile around that time?
It may help from an MLE perspective, but remember trading is ultimately about making money. Arguably it's more, not less, important to get your alpha correct at 3:30 PM, because you're probably trading more than you are at noon. And if noon and 3:30 PM really behave that different, then you should probably fit separate regressions for the two regimes anyway. If you're using 115 minute horizons, there's no shortage of data. 
Good questions outrank easy answers.
Paul Samuelson 



nikol


Total Posts: 1126 
Joined: Jun 2005 


Nice plots:
1) it is better to overlay them. 2) subtract seasonality function and plot this difference > that's the input to your arima+garch process, right? 3) I see that seasonality is shifted w.r.t. observable. That's where you get your R2 blownup. Do you calculate it like this?: seasonality_today(tod) ~ average over previous weeks(tod) "+" today_correction(t < tod), [tod = time of day]




gaj


Total Posts: 103 
Joined: Apr 2018 


I've never really grokked time series models like ARIMA. What problem does it actually solve? How is it better than regressing r_t against r_(t1), r_(t2), r_(t3), ...? 




Maggette


Total Posts: 1233 
Joined: Jun 2007 


Hi, an OLS on lagged variables is identical to an AR model. ARMA/ARIMA also has an "unobserved" AM (moving average) part.

Ich kam hierher und sah dich und deine Leute lächeln,
und sagte mir: Maggette, scheiss auf den small talk,
lass lieber deine Fäuste sprechen...



gaj


Total Posts: 103 
Joined: Apr 2018 


Sure, I understand the mechanics of the model. But what kind of problems would that be useful for? 




nikol


Total Posts: 1126 
Joined: Jun 2005 


@gaj for example risk problems. are you doing backtesting? do you scale your positions by risk?  yes? that's the answer. 



ahgt_123


Total Posts: 9 
Joined: May 2020 


Thank you for all your suggestions about improvements, but i think i am done with this , i did achieved R2 of 78% using only oscillators and past prices.
May try EMD though later ; sounds and looks interesting.
I have never heard or listened 1 good word about practical applications of neural nets in trading ,so i am kind of sceptical about trying it out.
Can anybody get me started on advanced univariate time series analysis. i currently know about basic ones (arma ,arma+ garch,garch variations ,arimax ,kalman filters) and some non linear ones ( bilinear,TAR).
Any recommended articles and books will be appreciated. 




gaj


Total Posts: 103 
Joined: Apr 2018 


@nikol: I'm slow. How do you use ARMA to scale your positions by risk? Second question, why should you use ARMA? 



nikol


Total Posts: 1126 
Joined: Jun 2005 


@gaj
1. I thought you wondered about econometric approach in general. 2. Still in defense of ARMA+GARCH *)  it works pretty well in predicting daily FXreturns distribution (average and sigma) upto 13 months forward. "Pretty well" = AndersonDarling on residuals delivers CL=5%.
*) There is really small addition though...




