PDA

View Full Version : FFT...dare I try it?


sbgtrading
11-25-2007, 12:35 PM
Hello,

I've been beating my head against the wall trying to link to a free Fast Fourier Transform DLL (http://fftw.org and http://www.sdss.jhu.edu/~tamas/bytes/fftwcsharp.html) and I haven't been having any success.

I'm relatively new to C# and the .NET framework, so instead of spending hours of trial-and-error in compilers, FAQ's and the like, I thought perhaps the community here might be willing to help. Basically, I need a C#/.NET genius! Anyone available to teach this old VAX Pascal programmer a lesson???

Thank you,
Ben

NinjaTrader_Josh
11-25-2007, 12:42 PM
On your NinjaScripts you'll need to add a "using" line calling the library.
using fftwlib;You will need to first install the library though. Try dropping the dll into your NinjaTrader install folder. If that doesn't work try dropping it into \My Documents\NinjaTrader 6\bin\Custom

You will probably need to do the part here about adding a reference. http://www.ninjatrader-support.com/HelpGuideV6/Embedding3rdPartyIndicators.html

sbgtrading
11-25-2007, 03:18 PM
Thanks for the response, Josh.

I had actually done the recommendations you gave me, but in the end of that, it came up with another, more troublesome error.

Initially, the error was that it couldn't open another DLL (named libfftw3f-3.dll). So I hunted down that DLL, I put it in the correct NT folder and also added its reference on the chart, but upon compilation, it gave:

libfftw3f-3.dll could not be opened -- 'An attempt was made to load a program with an incorrect format. ',CS0009

That's the one I'm stuck at...any suggestions? Does anything need to be done with "lib.exe"??? Some of the FAQ's on the FFTW site mention to use lib.exe to create .def files??? But I'm lost at this point.


Ben

NinjaTrader_Josh
11-25-2007, 04:51 PM
Sorry I am unfamiliar with these procedures and cannot provide further support.

sbgtrading
11-25-2007, 05:50 PM
Thanks for your reply, Josh...

I think what I'm looking for is someone here to download the supplied code and actually try to link to the DLL's and work through the issues.

Anyone else interested? According to the scientific literature I've seen, FFT's are an essential tool if you want to get some idea of the present cyclical tendencies of price action. The thought being, if you know the period of the dominant waveform, you can adjust the period of your moving averages, RSI's and Momentum indicators to help reduce the lag inherent in those indicators. Basically, the period of those laggy indicators should be 1/2 of the period of the dominant wave. (Please correct me if I'm wrong!)

Ben

KBJ
11-26-2007, 04:53 PM
I'm not sure why, but John Ehlers says "This (FFT) unfortunately is not suitable for analysis of market data." See: http://www.mesasoftware.com/cyclestutorial.htm

I found why he's said this ... its because he has a competing, proprietary analysis system he calls MESA, which he compares to fourier here: http://www.mesasoftware.com/fftcomparison.htm

I don't have any experience with it, but Ehlers has been writing trading books for years, and I found his technical papers (same web site) interesting.

NinjaTrader_Dierk
11-27-2007, 06:20 AM
PrTester,

I removed your post since it linked to a competitive product.

Thanks for your understanding.

PrTester
11-27-2007, 07:03 AM
PrTester,

I removed your post since it linked to a competitive product.

Thanks for your understanding.

Dierk sorry, but I think it was an open source not a commercial product.

zoltran
11-28-2007, 05:34 PM
I would agree with him here Dierk

The deleted info was for an open-source TA library for use within Ninja... Not a competitive product.