• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimizing strategy with machine learning

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

    Optimizing strategy with machine learning

    In order to optimize my strategies using machine learning algorithms, I need to acquire data of all wining and losing trades during backtesting, in a first step. Is there an infrastructure to log this data in csv-file?
    In a second step, I would like to recalculate the models at certain intervals during strategy runtime. Are there libraries available to calculate and use Random Forests, Support Vector Machines, etc.?

    #2
    Hello rafe0304,

    Thank you for your post.

    I am not aware of any libraries but there are several resources available when researching online.

    You can export any grid report by right clicking in it and selecting Grid. The options available will export in different ways. For information on Grids please visit the following link: http://ninjatrader.com/support/helpG...data_grids.htm
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hi Patrick,

      Thank you for your answer.

      In my strategy , I want to train and retrain a random forest (or any other suitable machine learning library) during session breaks, such that I can base my trading decisions in the subsequent session on the trained model. To do that, I need two things:

      1. data about all my historic trades executed in the strategy
      2. Inclusion of 3rd party .net machine learning libraries

      Now I can see, how I would accomplish the 1. point. But how can I include third party libraries in my strategy script?

      Comment


        #4
        Hello rafe0304,

        Thank you for your response.

        When calling a library you would need to refer the .dll file by right clicking in your NinjaScript Editor (in any file) and then selecting References > Add > locate the file > Open.
        Then in your NinjaScript object that needs to call the library add a 'using' statement at the top where the region 'Using declarations' is located with the other using statements.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Seeing this one a bit late. Implementing a RF or SVM module isn't too hard really. You need to collect the data internally in your indicator/strategy into a separate time series and then pass that to the DLL that encapsulates all those functions. I take it you know how to add a 3rd party lb into NinjaTrader by now.

          Originally posted by rafe0304 View Post
          Hi Patrick,

          Thank you for your answer.

          In my strategy , I want to train and retrain a random forest (or any other suitable machine learning library) during session breaks, such that I can base my trading decisions in the subsequent session on the trained model. To do that, I need two things:

          1. data about all my historic trades executed in the strategy
          2. Inclusion of 3rd party .net machine learning libraries

          Now I can see, how I would accomplish the 1. point. But how can I include third party libraries in my strategy script?

          Comment


            #6
            Do you have machine learning example script?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by FMtrader, 03-15-2019, 02:30 AM
            6 responses
            31 views
            0 likes
            Last Post James108  
            Started by timko, Today, 08:18 AM
            0 responses
            1 view
            0 likes
            Last Post timko
            by timko
             
            Started by victorsmith, Today, 06:00 AM
            0 responses
            4 views
            0 likes
            Last Post victorsmith  
            Started by sohailashraf, Yesterday, 10:18 PM
            0 responses
            6 views
            0 likes
            Last Post sohailashraf  
            Started by jjnc2006, Yesterday, 07:36 PM
            0 responses
            16 views
            0 likes
            Last Post jjnc2006  
            Working...
            X