• 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

Custom Optimizer

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

    Custom Optimizer

    Hello

    I am trying to develop a custom optimizer and am having some trouble calling and using the function RunIteration().

    Is it possible to get more information about what this function does or the code behind it?

    Can it be called with input arguments?

    Can it be looped? For example:

    RunIteration() with one set of inputs,
    Get results,
    Then RunIteration() with another set of inputs, and
    Get results.

    Is this possible?

    Ideally I would like to run a multi-thread approach and pass multiple arguments to
    RunIteration(). I image this could be done through a GPGPU set up such as CUDAfy.

    As I understand global parameters are stored and then RunIteration() back tests each of these parameters and then ranks the results?

    Is there a way to call the straight back test method through code? And then loop through with different input arguments?

    Thank You

    #2
    Hello,

    Thank you for the question.

    I have put in a note to see if there can be expanded descriptions of the items in this section, currently there is limited documentation on these items.

    Regarding RunIteration(), this method has no overloads so it could not pass a parameter, I am a little confused on this question though. RunIteration() simply calls the next iteration, are you asking how to persist a value from one iteration to the next to allow it to be used in the next iteration?

    As for calling the backtest outside of this type, currently there are no documented ways to do a backtest without using the backtest tool, I will put in a feature request to see if this could be utilized from code.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      Thank you for your help.

      In simple psuedocode this is what I would like to do:

      Strategy:
      Have a parameter in a strategy to optimize e.g. int 1 = 1

      Optimizer:
      Loop through the backtests with different settings for the parameter.

      for i = 0; 1 < 1000; i ++
      run backtest(i) - with parameter set to i
      recordResults[] = resultsBacktest(i)

      But to be able to mult-thread (ideally via GPGPU) and run the back tests with different settings for the optimization parameter simultaneously.

      Can this be achieved via the RunIteration() function and how can the results of each run be captured and recorded?

      Ideally it would be best to be able to call the backtest directly. For example the strategy parameters seem like they are just arguments to the strategy. For example:

      strategy1(parameter 1, parameter 2)

      And the strategy seems like it should just be an argument for the backtest. For example:

      backtest(strategy1(parameter 1, parameter 2)

      If it could be called this way it would be very easy to loop through. For example:

      for i = 0; i < 10; i ++
      for j = 0; j < 10; j++
      backtest(strategy1( i, j ))

      How every there is little information on being able to call the backtest or iteration functions or on how to capture and record the results for them.
      Last edited by Aether; 05-04-2016, 09:10 AM.

      Comment


        #4
        Hello,

        Thank you for the reply.

        I wanted to further clarify this response.

        Based on what you are describing, I believe you are asking how Optimizer types would relate to completing an entire backtest and then utilizing the results of that test to essentially start another. Is this correct?

        The Optimizer type would simply control how the properties are incremented not control the entire backtest. The RunIteration method is simply letting the analyzer know to start the next iteration because the logic in the Optimzer has incremented the properties. The analyzer window would essentially be controlling the test and utilizing the Optimizer to control its increment for optimization.

        What you are asking would not currently be possible because there are no methods to complete a backtest without the actual backtest window, or no NinjaScript way of doing this anyway. I will submit a feature request for this item though.

        Regarding the remainder of the post about putting work off to the GPU, you could certainly try utilizing the GPU but this would be a subject that our support would not really be able to provide any helpful information on due to this being a third party library.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SAILIKITY, 05-22-2019, 05:41 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by rmillar, 01-09-2019, 06:02 PM
        6 responses
        58 views
        1 like
        Last Post eDanny
        by eDanny
         
        Started by mlarocco, Today, 11:39 AM
        4 responses
        18 views
        0 likes
        Last Post mlarocco  
        Started by roblogic, Today, 11:19 AM
        2 responses
        14 views
        0 likes
        Last Post roblogic  
        Started by saeed, Today, 10:17 AM
        8 responses
        39 views
        0 likes
        Last Post NinjaTrader_Kate  
        Working...
        X