Trading Strategies Based On Digital Filters - page 74

 
SIMBA:
Welcome,

I think that if you don`t split the spectrum into blocks then you are dead..but,ok,np..let`s see in a few months what you think.

I go on holidays for 3 weeks,will try to keep in touch once a week.

Regards

I will miss your very prompt and helpful replies. Happy vacation, come back soon.

I have no argument with splitting the spectrum into blocks for the purpose of allocating only one peak to each part. You say it is useful, and you have much more experience here than I, so I believe. My point was that the computation can be made with a single pass in which EVERY filter has the same ratio of blocklength/period. After all in an earlier post you said

...or,you can build a multifreq,multispan scanner that scans in "blocks" of related "max period vs length of scan"...that will be really original and innovative

That is exactly what _v2 and _v3 do. I am trying to find out if that can help in a trading sense.

I think this may be useful when choosing periods, because it can show which of two or more periods is the most current. But you may have tried and thrown it away.

I have no wish to interfere with your vacation, my argument is long, and no one else seems to be haunting this forum, so I will await your return to post.

Thanks again

MadCow

 
fle__:
Richcap, thank you for sharing your code.

Do you know this other version of MESA, writen for Amibroker ?

AmiBroker - AFL Library

It implements various preprocessing (filtering, detrending) that are not included in your code, and that you could benefit of as it should allow for better results on real data.

Hope it will help you.

Thank you Fle.

As a matter of fact I have implemented a facility for denoising (with whatever filter you may have as an indicator) in post #491.

It works with library posted in #486

Ciao ;-)

 

Interesting approach, dear MadCow.

I like the idea of this thread having his own cycle, swinging high to low and back to high when a new member brings new life and ideas.

MadCow:

The only simple way to investigate this is to look at the spectrum of an M1 signal and an H1 signal over the same (absolute) period, e.g. 200 hours or so. This cannot be done with the R_MESA tools currently available because the length required at M1 exceeds the capability of the algorithm as coded.

You can pick library in #486 and change MAXIMUMDEGREE to the value you want (es. 20000) in order to plot the spectrum and find the peaks in a 200 hour / M1 chart , depending on you PC's horsepower .

You also will need the indicatori in #491 (with eventual denoising filter).

If was to plot the spectrum of a 200 hour M1 chart I would chose the following values for external parameters: degree (=10000?), length(=12000?), max_period(=24000.0?);

It's up to you.

;-)

 
richcap:
Interesting approach, dear MadCow.

I like the idea of this thread having his own cycle, swinging high to low and back to high when a new member brings new life and ideas.

You can pick library in #486 and change MAXIMUMDEGREE to the value you want (es. 20000) in order to plot the spectrum and find the peaks in a 200 hour / M1 chart , depending on you PC's horsepower .

You also will need the indicatori in #491 (with eventual denoising filter).

If was to plot the spectrum of a 200 hour M1 chart I would chose the following values for external parameters: degree (=10000?), length(=12000?), max_period(=24000.0?);

It's up to you.

;-)

RC.. It's great to find that you still haunt this thread. I have been wondering about the application of MESA for many years, and your excellent tools provide the ability and motivation to explore a little.

I have done a spectral estimate using Goertzel_v2 to compare the spectrum at M1 with that at M30. The results are shown in the image attached.

These seem to show that the cyclic components are in the appropriate place. It is pretty simple to do. I will try the MESA code as you suggested, but that will take some time. Degree 10,000?

I have a question for you. One of the problems with Goertzel is the difficulty normalizing amplitudes. The problem arises when e.g. a component at 100 hours lasts for 3 cycles , and an equal amplitude component at 30 hours lasts for 3 cycles, both ending with the current bar. If we calculate the spectrum using the standard Goertzel, or a DFT for that matter, normalized by the block length of the analysis, with the block length selected to see at least 3 cycles of the longer period signal, the shorter period component will have only 1/10 the amplitude, or 1/100 the energy. Yet it will have equal influence on the filtered price of the current bar. I have suggested that a variable length set of Goertzel filters can be used to help with this problem, since each will look at a different window, and can be seperately normalized. (Goertzel_v2 and _v3). This works reasonably well, but still has some flaws.

My question: does the MESA method suffer from the same problem, i.e., it has a fixed block length, so if the longer signal is in the whole analysis window, and the shorter signal is only in the last 1/10 th of the window, will the amplitude of the peaks found by MESA have the 1/10 ratio?

A second question: The variable length G filter set will not react to components that are no longer in the analysis window of the filter. On the other hand,fixed length G filters will respond with roughly the same amplitude to short components independently of where they occur in the window. So the VLG filters help find CURRENT components.. who wants to find stuff that's gone away? My question: does the MESA respond no matter where the component is in the window? I know that the MESA window can be relatively short. Can it be short enough to respond to a range of 10:1 duration signals? Does the amplitude estimated using MESA accurately represent the amplitude of the components, when they are of different duration?

Files:
 
MadCow:

My question: does the MESA method suffer from the same problem, i.e., it has a fixed block length, so if the longer signal is in the whole analysis window, and the shorter signal is only in the last 1/10 th of the window, will the amplitude of the peaks found by MESA have the 1/10 ratio?

Both Goertzel and MESA are "average" spectral estimator, meaning that they render the spectral power "averaged" in the window of observation.

Even if they are very different spectral power density estimators, they both suffer the same averaging issues.

So it's definitely a good idea to measure spectral power within different timeseries window lenghts.

Anyway, I think that you have to decide what is your timeframe first and then what you want to trade:

do you want to trade "average", steady, cycles by means of price action or other low lag indicators? Or do you want to use the spectral analysis output as the trigger?

In the latter case maybe that a stack of bandpass filters (as you proposed) is the best way. In the former case you can stick with goertzel or MESA (or join them , as I have done recently for the "Goertzel Group" ;-) )

 
richcap:
Both Goertzel and MESA are "average" spectral estimator, meaning that they render the spectral power "averaged" in the window of observation.

Even if they are very different spectral power density estimators, they both suffer the same averaging issues.

So it's definitely a good idea to measure spectral power within different timeseries window lenghts.

Anyway, I think that you have to decide what is your timeframe first and then what you want to trade:

do you want to trade "average", steady, cycles by means of price action or other low lag indicators? Or do you want to use the spectral analysis output as the trigger?

In the latter case maybe that a stack of bandpass filters (as you proposed) is the best way. In the former case you can stick with goertzel or MESA (or join them , as I have done recently for the "Goertzel Group" ;-) )

I agree that the trading TF must come first, and trading style second. Only then the spectral analysis.

BTW have you ever looked at the spectrum generated by a random walk series? Such a series can generate sequences that are periodic for short terms, hence the spectrum looks pretty much like the spectrum of a price series, no matter how you analyze it. Occam's razor suggests that the random walk model may be a better choice than one that requires resonant structures with unreasonable feedback delay. Even 10 hours is a long time nowadays, though Simba seems to have some explanation for very long periods, and Hurst claims to see structure that must depend on the phase of the moon. Still, some have done well using cyclic structure to trade, and I have no experience with that.

 

Hurst and the Moon

MadCow:
I agree that the trading TF must come first, and trading style second. Only then the spectral analysis. BTW have you ever looked at the spectrum generated by a random walk series? Such a series can generate sequences that are periodic for short terms, hence the spectrum looks pretty much like the spectrum of a price series, no matter how you analyze it. Occam's razor suggests that the random walk model may be a better choice than one that requires resonant structures with unreasonable feedback delay. Even 10 hours is a long time nowadays, though Simba seems to have some explanation for very long periods, and Hurst claims to see structure that must depend on the phase of the moon. Still, some have done well using cyclic structure to trade, and I have no experience with that.

MCow,

I don`t know about Simba long periods...I am probably wrong or you didn`t get my meaning,since you "duplicated" my results about same cycles all timeframes,ok,in your case m1 and m30,but I already showed that for several concurrent tfs(M5.M15,M30,H1)..SO NOW,DO WE AGREE THAT THERE ARE CYCLES THAT CAN BE FOUND AT ANY TF?...Good that you took your time to tst my findings ....BTW...If Hurst claimed to have found structure Moon Phase dependent...Study it my friend,like your life depended on it,Please send me the article,book,newsletter,..Nothing,absolutely nothing that Hurst said was wrong...Did you bother to check my posts at the General discussion-astro-thread in this forum?...They will,probably,expand your model of the world.

My dear Sir,I opened your eyes to the world cyclic realities,yes,believe it or not,I broke your belief model...or not ?...you probably need glasses if you haven`t realized that both richcap and myself were trying to help you out of an appreciation sentiment for those seekers that walk the same road we walked months ago

Occam razor`s suggestion means you should forget about trading with a positive expectation,if you believe it ....so what the fag are you doing posting here ?...10 hours is a long time if you are wrong...and a short time if you are right...10 hours is NOTHING...Because this level of time is irrelevant,noise makes sure of this...

No positive expectation,no results...so,put Occam`s razor where it should be put ...In your pocket...Stop questioning everything,everything Richcap and myself told you so far has been right...or not ?

Regards

S

 
SIMBA:
MCow,

I don`t know about Simba long periods...I am probably wrong or you didn`t get my meaning,since you "duplicated" my results about same cycles all timeframes,ok,in your case m1 and m30,but I already showed that for several concurrent tfs(M5.M15,M30,H1)..SO NOW,DO WE AGREE THAT THERE ARE CYCLES THAT CAN BE FOUND AT ANY TF?...Good that you took your time to tst my findings ....BTW...If Hurst claimed to have found structure Moon Phase dependent...Study it my friend,like your life depended on it,Please send me the article,book,newsletter,..Nothing,absolutely nothing that Hurst said was wrong...Did you bother to check my posts at the General discussion-astro-thread in this forum?...They will,probably,expand your model of the world.

My dear Sir,I opened your eyes to the world cyclic realities,yes,believe it or not,I broke your belief model...or not ?...you probably need glasses if you haven`t realized that both richcap and myself were trying to help you out of an appreciation sentiment for those seekers that walk the same road we walked months ago

Occam razor`s suggestion means you should forget about trading with a positive expectation,if you believe it ....so what the fag are you doing posting here ?...10 hours is a long time if you are wrong...and a short time if you are right...10 hours is NOTHING...Because this level of time is irrelevant,noise makes sure of this...

No positive expectation,no results...so,put Occam`s razor where it should be put ...In your pocket...Stop questioning everything,everything Richcap and myself told you so far has been right...or not ?

Regards

S

Simba..

I am glad that you responded, I thought that reference to a random walk would arouse a response from someone. I hope that I did not rouse your ire. Perhaps others will chime in with their arguments, I will only learn from them.

A month or so ago, I took your advice and read Hurst's book. I seem to remember his reference to the moon, but a quick rescan did not find it. Perhaps it was just my unconscious thought process as I read. I will read your other posts as time permits.

I am here to learn. A long time ago I learned that one cannot accept the word of authority without testing it. My skepticism has helped me avoid many pitfalls over the years, and has helped me to learn from the basics, not just on the surface. I do not say that the random walk model is correct. I just say that it can explain all the observed spectra that I have seen on this thread, or calculated myself using FX series. If you and RichCap are having success trading with the cyclic model, then that is evidence that the random walk model is not a sufficient explanation, or possibly evidence that you have a traders experience/intuition. I will continue to test the cyclic model using your suggestions.

Just to show why I am skeptical, let me show several images. First a random walk series, and the same series with a sinewave at period 160.

Now the spectrum of the random walk alone, using block length = 3*maxPer = 900, Standard Goertzel with fixed block length and end point flattening.

Finally the spectrum of the signal with the noise.

I find it hard to distinguish one from the other. How do you know when a signal is present?

Files:
 

Noise

MadCow:
Simba..

I am glad that you responded, I thought that reference to a random walk would arouse a response from someone. I hope that I did not rouse your ire. Perhaps others will chime in with their arguments, I will only learn from them.

A month or so ago, I took your advice and read Hurst's book. I seem to remember his reference to the moon, but a quick rescan did not find it. Perhaps it was just my unconscious thought process as I read. I will read your other posts as time permits.

I am here to learn. A long time ago I learned that one cannot accept the word of authority without testing it. My skepticism has helped me avoid many pitfalls over the years, and has helped me to learn from the basics, not just on the surface. I do not say that the random walk model is correct. I just say that it can explain all the observed spectra that I have seen on this thread, or calculated myself using FX series. If you and RichCap are having success trading with the cyclic model, then that is evidence that the random walk model is not a sufficient explanation, or possibly evidence that you have a traders experience/intuition. I will continue to test the cyclic model using your suggestions.

Just to show why I am skeptical, let me show several images. First a random walk series, and the same series with a sinewave at period 160.

Now the spectrum of the random walk alone, using block length = 3*maxPer = 900, Standard Goertzel with fixed block length and end point flattening.

Finally the spectrum of the signal with the noise.

I find it hard to distinguish one from the other. How do you know when a signal is present?

1-How do you know when noise is present?If you know ,you can then extract the signal.

2-SSA,HPf,TMAs,JMAs...etc...Even centered smas denoising will filter out noise.

P.S:My ire is on vacation too,I like good discussions,but please be clear from the beginning an do not play "convince me".

S

 

Prove it $

MadCow:
Simba..

I am glad that you responded, I thought that reference to a random walk would arouse a response from someone. I hope that I did not rouse your ire. Perhaps others will chime in with their arguments, I will only learn from them.

A month or so ago, I took your advice and read Hurst's book. I seem to remember his reference to the moon, but a quick rescan did not find it. Perhaps it was just my unconscious thought process as I read. I will read your other posts as time permits.

I am here to learn. A long time ago I learned that one cannot accept the word of authority without testing it. My skepticism has helped me avoid many pitfalls over the years, and has helped me to learn from the basics, not just on the surface. I do not say that the random walk model is correct. I just say that it can explain all the observed spectra that I have seen on this thread, or calculated myself using FX series. If you and RichCap are having success trading with the cyclic model, then that is evidence that the random walk model is not a sufficient explanation, or possibly evidence that you have a traders experience/intuition. I will continue to test the cyclic model using your suggestions.

Just to show why I am skeptical, let me show several images. First a random walk series, and the same series with a sinewave at period 160.

Now the spectrum of the random walk alone, using block length = 3*maxPer = 900, Standard Goertzel with fixed block length and end point flattening.

Finally the spectrum of the signal with the noise.

I find it hard to distinguish one from the other. How do you know when a signal is present?

MadCow,

So,I have to prove to you that cycles exist? ...As I told you before,if you don`t believe in them ,just trade another method,I have no problem with that,my intention is not to persuade anyone about any trading method...Mainly,If you just happen to believe that they may work,you may find interesting material here or in other related threads,if you don`t...do not waste your time,I am not(richcap neither ...and he is a very good friend,I know him very well)into the religious business,so,I have no intention whatsoever of convincing you.

I told you that cycles were the same no matter what tf you looked at them...you did your analysis ,with richcap tools and advice ,and you reached the same conclusion (M30,M1 cycles for 200 m30 bars,etc,etc)...When you check every one of my other assertions,you will realize I was right from the beginning,I told you before,I have been there,done that,got the medal ....and the scars to prove it.

The random walk model has never been proved(But I have to prove you that cycles exist? ).Benoit Mandelbrott proved the opposite...that sometimes you have windows of predictability ...sometimes you don`t...Lyapunov exponent can help you measure for how long "predictable" a market can be...Cycles can help you nail the direction.

You can attach as many random walks as you want,fastjk did the same,in an extremely professional manner,so,I won`t repeat,if you want,just read the previous posts of the thread,and ,when you do it,see if it was clear that randomness was not the problem,the problem were our cyclic tools capabilities to finetune into the ryhtm of the market.

MadCow,if you are skeptical,please be so kind to post your argument in full,then we will either rebate it or just let agree with you while we keep trading as usual...as I told you before,we don`t have any interest in convincing anybody about the beauty of cycles...just the opposite ....but we like people that walk the same road we walked.

You know,people coming into a digital filter`s thread that end up revealing they don`t believe in digital filters,are welcome,but ,please show your hand at the beginning,neither richcap nor myself are going to play "convince me"..we don`t care(and I know richcap very well,as he hinted to you a few posts ago we have been working together for nearly a year )....but if your arguments are interesting,you may convince us to contrast them with ours...or not

If you want to convince us of randomness...post the Hurst exponent of the market,take the major markets(sp500,eurusd,udjpy,gold,silver,tnotes,tbonds),for the last 15 years...No randomness there....none at all,and lots of correlation.

Frankly,I don`t know what you want to get from this thread(you already got the knowledge that cycles exist and are the same if you measure them at different timeframes,or at least you got a hint of it,and the tools to decide if this is so or not.)

S

Reason: