Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimizer only runs through small portion of available options

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

    Optimizer only runs through small portion of available options

    Like the title says: I optimize a strategy and set it to test 2 variables between 0 and 1 with an increment of 0.1 . So I expect at least 100 different test results (0 with 0.1, with 0.2, with 0.3, ... 0 with 1 and then 0.1 with 0, 0.1 with 0.1 and so on)

    However, the optimizer only displays 4 results (please see screenshot) Why ??

    I tested on 2 different computers, tried after an NT-restart and even after a complete Windows-reboot, all the same

    When I test any of the other variables (there are plenty in my code) everything goes as expected. In the properties-section of the strategy, I define those two variables in a way similar to other variables that do work. Also: I have the 'keep best results' set to 30 or so.
    Attached Files

    #2
    Hello Spinn, and thank you for your query.

    So that we can narrow down what is happening, could I ask you to repeat this with the attached strategy? Please use the following settings on your first run, then adjust both the strategy and the settings until you are able to reproduce what you are seeing :

    • Instrument : GC 12-16 (or current expiry)
    • MyInput0 : 27;30;0.1
    • Keep best # results : 10

    You should have exactly 10 results from doing this on your first run. Please let us know whether or not this is the case, as either answer will give us more information and help us narrow in on what is occurring.

    If you are able to reproduce this, please attach a modified copy of the strategy I sent you to your reply, along with instructions we can use to reproduce this on our end.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for trying to help me out Jessica !

      One small problem immediately rises though: I am a forex-trader so I run NT on an FXCM account that does NOT provide a data feed for futures

      Can I use another instrument instead ?? Perhaps even my favourite, the GBPJPY ??

      Comment


        #4
        Yes, you may select an instrument of your choosing, the strategy will work the same way. I add instructions like that only to make it clear which instrument I used when I tested on my end. I look forward to assisting further.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          I did what you asked: optimizer returns zero results. I used GBPGPY over a period of 5 days in february 2016 (I have data for that period)

          Normally I test on Renkobars, but I believe the 'last, minute, 1' setting should also work.

          Please see attached screenhot
          Attached Files

          Comment


            #6
            Thank you for this information. I am including a related forums post.



            Other users who have experienced this have resolved this with the following method :

            • Shut down NinjaTrader 7
            • Delete your (My) Documents\NinjaTrader 7\workspaces\_Workspace.xml file
            • Open NinjaTrader
            • Attempt to run the strategy analyzer again

            Please let us know if this is not the case for you so we can proceed further.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Running the optimizer after deleting that file worked for that 'buy.cs'strategy you sent.

              I did not work however for my own strategy: I retried with a test of 2 variables, each going from 0 to 1 by steps of 0.1

              Again, I only got 4 results

              See screen
              Attached Files

              Comment


                #8
                Thank you for this additional information. Could you review your logs tab in the Control Center and let us know if there are any messages from your strategy there? If there are, could you send a copy of today's logs from (My) Documents\NinjaTrader 7\logs to platformsupport[at]ninjatrader[dot]com , referencing attn:ninjatrader_jessicap and 1596392 in the subject line of your e-mail? We will be happy to assist further.
                Jessica P.NinjaTrader Customer Service

                Comment


                  #9
                  Thank you NinjaTrader_JessicaP for taking the time to sort this out

                  I did look at the log and discovered that a certain StopLoss for a sell position was placed above the close of the previous bar. This happened during a short period of high volatility (during a fast drop of the price) This order was then skipped and the strategy ended itself.

                  I then inspected my code and changed this:

                  initialStopSRA = Math.Max (execution.Order.AvgFillPrice + stopLossSRA * TickSize, Close[0]+TickSize);

                  into this:

                  initialStopSRA = Math.Max (execution.Order.AvgFillPrice + stopLossSRA * TickSize, Closes[1][0]+TickSize);

                  (note: my secondary timeframe is 2 seconds, so this line of code reacts very fast)

                  Code runs smoothly now and I'm optimising in full force
                  Case closed for me. Thanks again for thath gentle push in the right direction !!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by rdtdale, Today, 01:02 PM
                  1 response
                  3 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Started by alifarahani, Today, 09:40 AM
                  3 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by RookieTrader, Today, 09:37 AM
                  4 responses
                  18 views
                  0 likes
                  Last Post RookieTrader  
                  Started by PaulMohn, Today, 12:36 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post PaulMohn  
                  Started by love2code2trade, 04-17-2024, 01:45 PM
                  4 responses
                  41 views
                  0 likes
                  Last Post love2code2trade  
                  Working...
                  X