NexusFi: Find Your Edge


Home Menu

 





Fourier series curve fitted to ES data


Discussion in Emini and Emicro Index

Updated
      Top Posters
    1. looks_one Fat Tails with 5 posts (3 thanks)
    2. looks_two aquarian1 with 4 posts (0 thanks)
    3. looks_3 BrianBacchus with 3 posts (3 thanks)
    4. looks_4 tantrev with 3 posts (4 thanks)
      Best Posters
    1. looks_one glennts with 3 thanks per post
    2. looks_two tantrev with 1.3 thanks per post
    3. looks_3 BrianBacchus with 1 thanks per post
    4. looks_4 Fat Tails with 0.6 thanks per post
    1. trending_up 12,119 views
    2. thumb_up 14 thanks given
    3. group 10 followers
    1. forum 22 posts
    2. attach_file 2 attachments




 
Search this Thread

Fourier series curve fitted to ES data

  #1 (permalink)
 tantrev 
Salt Lake, Utah
 
Experience: Beginner
Platform: MultiCharts
Posts: 10 since Jul 2010
Thanks Given: 1
Thanks Received: 6

So I made some Matlab code and a GUI that looked at the tick-by-tick ES (e-mini S&P 500) data provided for Elite members here and did some curve fitting using 8 part Fourier Series.

https://img210.imageshack.us/img210/5485/guih.png

Above just shows a look at data from 06/15/2009-06/18/2009. The first box next to the chart shows the 1st derivative of the fitted curve and the second box shows the 2nd derivative.

Any thoughts? Perhaps on-the-fly curve fitting could be implemented in a trade strategy, with a fast enough computer?

UPDATE: Also confidence is just R^2 for those who care. And does anyone else think the data is remarkably harmonic in the last hour?

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
Battlestations: Show us your trading desks!
24 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
The Program
17 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



tantrev View Post
So I made some Matlab code and a GUI that looked at the tick-by-tick ES (e-mini S&P 500) data provided for Elite members here and did some curve fitting using 8 part Fourier Series.

https://img210.imageshack.us/img210/5485/guih.png

Above just shows a look at data from 06/15/2009-06/18/2009. The first box next to the chart shows the 1st derivative of the fitted curve and the second box shows the 2nd derivative.

Any thoughts? Perhaps on-the-fly curve fitting could be implemented in a trade strategy, with a fast enough computer?

UPDATE: Also confidence is just R^2 for those who care. And does anyone else think the data is remarkably harmonic in the last hour?

Fourier Analysis is useful, if you have a reason to believe that there are cyclical components in your time series and if you can identify the frequencies and eliminate the noise.

However, futures and stock prices mostly exhibit a non-linear behaviour, which means there are few such cyclical components to be identified.

If I look at your first chart, it shows a curve retro-fitted to data. At the right border - that is the place, where we want to predict price action and use the prediction for our trading - your curve exhibits a downward slope. If you please check what the market really did: it went up.

Curve fitting is a nice mathematical exercise. If you use a sufficient number of parameters, you can fit your curve to any past price action. But the curve has no predictive value. You can use it for interpolation but not for extrapolation.

Taking that data and drawing a simple trendline and wait until it is broken is more helpful. If you want to apply mathematics to trading, better look at volatility and autocorrelation than analyze supposed, but inexistant cyclical components.

Reply With Quote
  #4 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

There might by cyclical components in things affected by seasons, human-imposed or natural. Human-imposed would be futures rolls. Natural would be seasons.

In both cases that will involve looking at spreads.

Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


MXASJ View Post
There might by cyclical components in things affected by seasons, human-imposed or natural. Human-imposed would be futures rolls. Natural would be seasons.

In both cases that will involve looking at spreads.

Yes, of course there are natural and human cycles that do have an impact:

Day and night (as seen from the exchange where the instrument is traded): Participation (volume) and volatility during the night session is lower.

Weekly cycle: I have incorporated this cycle into my relative volume indicator by measuring the current volume against the average volume of the weekday.

Monthly cycle: Window dressing in the beginning of the month.

Yearly cycle: Seasonal impact for grain, energy. Tax season in May, etc.

If you talk about spreads, you are talking about agriculturals? I do not see many cyclical components in the note over bonds spread (as opposed to mean reversion, which can be assumed).

Reply With Quote
Thanked by:
  #6 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,171
Thanks Received: 6,018


Fat Tails View Post
Fourier Analysis is useful, if you have a reason to believe that there are cyclical components in your time series and if you can identify the frequencies and eliminate the noise.

However, futures and stock prices mostly exhibit a non-linear behaviour, which means there are few such cyclical components to be identified.

If I look at your first chart, it shows a curve retro-fitted to data. At the right border - that is the place, where we want to predict price action and use the prediction for our trading - your curve exhibits a downward slope. If you please check what the market really did: it went up.

Curve fitting is a nice mathematical exercise. If you use a sufficient number of parameters, you can fit your curve to any past price action. But the curve has no predictive value. You can use it for interpolation but not for extrapolation.

Taking that data and drawing a simple trendline and wait until it is broken is more helpful. If you want to apply mathematics to trading, better look at volatility and autocorrelation than analyze supposed, but inexistant cyclical components.

Fat i have a knowledge who uses this type of analysis (Fourier Analysis) to fine tune the parameters of his indicators and according to him this is the cream of the cream. For example, finding the optimal range per bar to use as interval for the ES or TF to name one. So to fine-tune our indicators would you consider it or do you think it's a lost of time ?

Reply With Quote
  #7 (permalink)
 tantrev 
Salt Lake, Utah
 
Experience: Beginner
Platform: MultiCharts
Posts: 10 since Jul 2010
Thanks Given: 1
Thanks Received: 6


Fat Tails View Post
Fourier Analysis is useful, if you have a reason to believe that there are cyclical components in your time series and if you can identify the frequencies and eliminate the noise.

However, futures and stock prices mostly exhibit a non-linear behaviour, which means there are few such cyclical components to be identified.

If I look at your first chart, it shows a curve retro-fitted to data. At the right border - that is the place, where we want to predict price action and use the prediction for our trading - your curve exhibits a downward slope. If you please check what the market really did: it went up.

Curve fitting is a nice mathematical exercise. If you use a sufficient number of parameters, you can fit your curve to any past price action. But the curve has no predictive value. You can use it for interpolation but not for extrapolation.

Taking that data and drawing a simple trendline and wait until it is broken is more helpful. If you want to apply mathematics to trading, better look at volatility and autocorrelation than analyze supposed, but inexistant cyclical components.

I agree with you when looking at big time periods but would you agree that on short time periods (~1 hr) there appears to be use for the fourier regressions?

Started this thread Reply With Quote
  #8 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


tantrev View Post
I agree with you when looking at big time periods but would you agree that on short time periods (~1 hr) there appears to be use for the fourier regressions?

Not sure that a naked DFT will reveil much of a cycle. You could have a look at the Corona Indicators developped by John F. Ehlers. He detrends the time series before analyzing for cycles. I have put the indicators on a 3 min chart for ES for last Friday.

If you look at the cyclical component, there was a dominant cycle with a period of around 28 in the beginning of the session. The lows were tradeable because of the trend that developped later in the day, the highs predicted were not impressive. The problem here is that the cycle amplitude was too small compared to the noise. The signal-to-noise stayed below 4DB during the first two hours, with a large corona, which means that the cyclical signal was week and the noise dominant.

Also to note that the cyclical component, which can barely be identified within price action, changed its period during noon - increased period - and then again prior to the close of the session. if I take into account the daily volatility smile, it is possible that the cycle analysis works better on range charts than time based charts. This is what the shorter cycle in the beginning and the end and the longer cycle in the middle suggest.

But this is just one day of observation. I do not think that cycle analysis is an easy route to success. But it is the sexiest indicator I have ever seen.



Indicators courtesy of @ sefstrat can be downloaded here. They work with both NT 6.5. and NT 7.0

View Download Details - Big Mike's Trading Forum

Reply With Quote
  #9 (permalink)
 cpi65 
UK
 
Experience: None
Platform: -
Posts: 154 since Aug 2010
Thanks Given: 12
Thanks Received: 75

I will bet my balls that there is no edge in this.

Reply With Quote
  #10 (permalink)
 
DavidHP's Avatar
 DavidHP 
Isla Mujeres, MX
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Ninjatrader / Optimus Futures / AmpFutures
Trading: ES / 6E / 6B / CL
Frequency: Every few days
Duration: Minutes
Posts: 1,609 since Aug 2009
Thanks Given: 11,327
Thanks Received: 2,743



cpi65 View Post
I will bet my balls that there is no edge in this.

That's ok...
you probably don't need them anyway.


Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
Follow me on Twitter Reply With Quote




Last Updated on May 19, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts