Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Neural Networks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Anything we can help with?

    I use Fann with Ninja, but would be interested in your matlab bridge.

    I do a bit of matlab stuff at uni.

    Comment


      #17
      Hey decus, can you elaborate on what Fann is?

      Also, if any help is needed with the Neural Net programming, let me know.

      Thanks
      mrlogik
      NinjaTrader Ecosystem Vendor - Purelogik Trading

      Comment


        #18
        FANN = Fast Artificial Neural Network Library



        It's fairly straight forward to get working with Ninja. I've got some other opensource NN library's working as well, but I like FANN the most.

        Now I just have to work out a good strategy that uses it....

        Comment


          #19
          How would someone go about developing a Neural Net that predicts the probability to an upward market move, say 60% and a probability of a downward move, say 20% and sideways (20%) and incorporating that into an entry/exit signal? I have done a little research on Neural Networks in trading but have not found anything that really goes much beyond theory and actually into development. Thanks for the insight!

          GT

          Comment


            #20
            This is unfortunately not so easy. First you have to think about which input variables you want to use (e.g. price, RSI, MACD, ... or whatever you can think of that would have an influence on whether prices might rise or fall). Then you need to decide how to preprocess this data. And then you need to select data samples to train the network with.

            Have a look at http://citeseer.comp.nus.edu.sg/rd/0...traArticle.pdf

            This article explains the different factors that influence a NN. And keep in mind that NNs cannot predict the future either, they only do some sort of pattern recognition.

            Comment


              #21
              Thanks for the article, it has a lot of good information. I have ready a number of other books and articles on the same subject. I have also used another program in the past but was not able to customize it and I like using NT so when I found this post I was very interested. A couple of maybe obvious questions for you: how do you get the data from NT to stream into FANN and how do you get the output value back into NT to use in your strategy? Thank you very much for you information!

              GT

              Comment


                #22
                I don't know how FANN works but I can tell you how my MATLAB interface works: A NinjaTrader indicator accesses an external DLL which in turn accesses MATLAB (via its COM interface). So the whole data transfer thing is transparent and automated.

                As I said, I can't tell when I'll have time to finally finish it but I'll post it here once I do.

                Comment


                  #23
                  Originally posted by terenyi View Post
                  I don't know how FANN works but I can tell you how my MATLAB interface works: A NinjaTrader indicator accesses an external DLL which in turn accesses MATLAB (via its COM interface). So the whole data transfer thing is transparent and automated.

                  As I said, I can't tell when I'll have time to finally finish it but I'll post it here once I do.
                  Ahh that is fantastic terenyi, what holds me back from getting more into matlab is not being able to play around with real data in real time without DDE..A small request if when your done you could post the simplest example of a ninja indicator that simply throws bar data into a matlab vector without requireing any additional toolboxes?
                  I also think the Ninja guys should think about this in an official context...
                  Ninja as a data pipe to matlab would be a KO punch to the competition. There is certainly opportunity there as the data feed toolbox from mathworks is simply not aimed at the retail level and there doesn't seem to be a solution for using the datafeeds that most who would be interested in this kind of thing actually use(ie. the ones Ninja already supports .

                  Comment


                    #24
                    My library encapsulates all communication with MATLAB so you're never directly accessing it.

                    But if you want to do so you could use:

                    Matlab.PutWorkspaceData(name, "base", variable);
                    Matlab.GetWorkspaceData(name, "base", out value);

                    Where "name" is a string (the name of the variable) and "variable" contains the data of the variable. Its type can be double, double[], double[,] or string depending on what you want to store (numeric variable, vector, matrix or text variable).

                    Of course first you need to get a reference to the MATLAB app:

                    MLApp.MLAppClass Matlab = new MLApp.MLAppClass();

                    For this to work you'll need to reference Interop.MLApp.dll.

                    Oh and commands can be executed with:

                    Matlab.Execute(command);

                    "command" is a string which contains your MATLAB command.

                    An example:

                    MLApp.MLAppClass Matlab = new MLApp.MLAppClass();

                    double x = 2;
                    double y = 3;
                    double z;

                    Matlab.PutWorkspaceData("x", "base", x);
                    Matlab.PutWorkspaceData("y", "base", y);

                    Matlab.Execute("z = x+y;");

                    object temp;
                    Matlab.GetWorkspaceData("z", "base", out temp);

                    z = (double) temp;

                    // z should now contain 5

                    My version of MATLAB (7.0.0.19920) comes with the bug that the interop libraries are not registered properly during the installation so you'll need to merge the following with your registry:

                    Windows Registry Editor Version 5.00
                    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{669 CEC93-6E22-11CF-A4D6-00A024583C19}]
                    @="DIMLApp"
                    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{669 CEC93-6E22-11CF-A4D6-00A024583C19}\NumMethods]
                    @="21"
                    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{669 CEC93-6E22-11CF-A4D6-00A024583C19}\ProxyStubClsid32]
                    @="{00020420-0000-0000-C000-000000000046}"
                    [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Interface\{669 CEC93-6E22-11CF-A4D6-00A024583C19}\TypeLib]
                    @="{C36E46AB-6A81-457B-9F91-A7719A06287F}"
                    "Version"="1.0"

                    And if you want everything to work from within NinjaTrader then you first need to add Interop.MLApp.dll to the GAC (using gacutil for example) and then you also need to add a reference to this DLL in the NinjaScript editor.

                    Comment


                      #25
                      Originally posted by terenyi View Post
                      My library encapsulates all communication with MATLAB so you're never directly accessing it.

                      But if you want to do so you could use:

                      Matlab.PutWorkspaceData(name, "base", variable);
                      Matlab.GetWorkspaceData(name, "base", out value);

                      have you shared your library anywhere yet?

                      Comment


                        #26
                        Originally posted by terenyi View Post
                        I'm currently working on an interface that links NT to Matlab (with the Neural Network Toolkit) and which provides a C# API for using feed-forward networks and self organizing maps. I should have my first version ready in a day or two and I could post this here if other people are interested in this too.

                        PS: Whoever made the design decision to use C# instead of a proprietary language in NT: Very good idea!

                        Great

                        Is it possible to connet and add the capacity of

                        http://www.tradingsolutions.com/ '

                        Comment


                          #27
                          i stumbled on this thread and think its fantastic. is this project still active?

                          Comment


                            #28
                            Originally posted by tortexal View Post
                            i stumbled on this thread and think its fantastic. is this project still active?
                            yeah, it's definitely active. actually, the whole thing (the matlab interface as well as other things) turned into a bigger project (about 2 years of work going into it). so now i'm working on turning all of this into a commercial product to compensate at least a bit for all the work i put into this. i think i'll be able to offer quite some exciting new things for ninjatrader (matlab interface, neural networks, many advanced indicators, a complete strategy framework with features like simulated orders, elaborate statistical analysis using excel etc.). my plan is to go online at the beginning of fall.

                            Comment


                              #29
                              sweet i'll buy it

                              Comment


                                #30
                                Originally posted by terenyi View Post
                                yeah, it's definitely active. actually, the whole thing (the matlab interface as well as other things) turned into a bigger project (about 2 years of work going into it). so now i'm working on turning all of this into a commercial product to compensate at least a bit for all the work i put into this. i think i'll be able to offer quite some exciting new things for ninjatrader (matlab interface, neural networks, many advanced indicators, a complete strategy framework with features like simulated orders, elaborate statistical analysis using excel etc.). my plan is to go online at the beginning of fall.
                                terenyi,

                                Is this work primarily geared towards an NT - matlab/excel/NN/etc connectivity / utility package or is it a bunch of indicators/strategies that can make use of the above? The areas you mentioned above are so vast and complex so I am looking forward to see what you have garthered together. Good luck with your efforts!

                                astra

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                602 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                347 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                103 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                559 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                558 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X