NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 11-25-2007, 12:35 PM   #1
sbgtrading
Certified NinjaScript Consultant
 
Join Date: Oct 2007
Location: Northern Illinois
Posts: 256
Thanks: 0
Thanked 3 times in 3 posts
Default FFT...dare I try it?

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
sbgtrading is offline  
Reply With Quote
Old 11-25-2007, 12:42 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

On your NinjaScripts you'll need to add a "using" line calling the library.
Code:
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/H...ndicators.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-25-2007, 03:18 PM   #3
sbgtrading
Certified NinjaScript Consultant
 
Join Date: Oct 2007
Location: Northern Illinois
Posts: 256
Thanks: 0
Thanked 3 times in 3 posts
Default

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
sbgtrading is offline  
Reply With Quote
Old 11-25-2007, 04:51 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Sorry I am unfamiliar with these procedures and cannot provide further support.
NinjaTrader_Josh is offline  
Reply With Quote
Old 11-25-2007, 05:50 PM   #5
sbgtrading
Certified NinjaScript Consultant
 
Join Date: Oct 2007
Location: Northern Illinois
Posts: 256
Thanks: 0
Thanked 3 times in 3 posts
Default

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
sbgtrading is offline  
Reply With Quote
Old 11-26-2007, 04:53 PM   #6
KBJ
Senior Member
 
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
Default

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.
KBJ is offline  
Reply With Quote
Old 11-27-2007, 06:20 AM   #7
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

PrTester,

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

Thanks for your understanding.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 11-27-2007, 07:03 AM   #8
PrTester
Senior Member
 
Join Date: Mar 2007
Posts: 212
Thanks: 0
Thanked 3 times in 3 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
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.
PrTester is offline  
Reply With Quote
Old 11-28-2007, 05:34 PM   #9
zoltran
Senior Member
 
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
Default

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.
zoltran is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:18 AM.