Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Optomization Failure...

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

    Optomization Failure...

    Good Morning,

    I'm coming back to using NT 7 after a considerable time period so I may be missing something....

    I am using NT 8 and attempting to optimize a custom strategy with the Genetic optimizer. The optimizer seems to run only a couple of iterations and then just stops. I have the NinjaScript Log viewer up and no error is displayed.

    I do get a couple of: "Strategy 'EncogLowHigh/-1': An Enter() method to submit an entry order at '##############has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation." messages....

    I have 'Minimum performance' set to 0.

    Is there some other reason that this could be happening?

    Thank You,

    Roger
    Last edited by barbacue82; 12-12-2017, 05:03 AM.

    #2
    Hello,

    Thank you for the question.

    I wanted to check, are you able to see the SampleMACrossOver complete successfully or provide more results without stopping?

    Also are you able to pull up the data for the period being tested on a chart and view the bars for all instruments the strategy uses?

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

    Comment


      #3
      Thank you for the response!

      Yes, Simple MA Crossover runs as expected.

      I also have these lines in my code to make sure the data is loaded:

      if (BarsInProgress != 0) return;
      if (CurrentBars[0] < BarsRequiredToTrade) return;
      if (CurrentBars[1] < BarsRequiredToTrade) return;
      if (CurrentBars[2] < BarsRequiredToTrade) return;
      The code for the strategy runs as expected, however, when using Genetic Optimizer the optimizer code fails.

      Comment


        #4
        Thought...this code for the custom strategy reads information from a saved file on disk....

        Could this be causing an access violation and not making any report of the error, but instead just fail?

        Comment


          #5
          Not sure if this is the correct way but....for testing I surrender the file access code with lock(lockObjt) {} looking at a generic private object as the lockObj and this did not seem to make a difference.

          Comment


            #6
            Hello,

            Thank you for testing that and providing the additional details.

            In the case where simple logic works, but your custom logic does not this is likely some combination of syntax being used.

            You noted that you are reading from the file, so that is certainly a concern in an Optimization specifically as multiple instances of the script will be executed in short timeframes. This could cause an access violation as you noted. so long as you are not using try/catch statements which are recommended to be avoided, the platform should catch any exceptions in the log/trace files for you to review.

            Are you seeing any errors in the control center log tab? if so can you provide them?

            If you are not seeing errors, likely the best solution will be to reduce the logic in your strategy and find the syntax that is causing the problem.

            I generally suggest starting by commenting out all logic so the strategy places no trades and does nothing other than runs. Then slowly uncomment logic and retest making sure the test completes each time. Once you run into the code that has a problem, the testing should fail and you can locate the specific syntax required for that.

            If it is not apparent why that combination is creating a problem, I would ask for a sample so I too can test the situation.

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

            Comment


              #7
              So I'm not sure if this helps me at all...I commented out all the logic and it still would fail. I uncommented all the logic and it worked!....I then restarted NinjaTrader and it would not work again. I tried to re-create this with no success...

              I am able to run a Default optimizer against the strategy, just not the genetic....issue is that there are too many possibilities for the Default to be of use....

              Comment


                #8
                Jesse,

                Thank you for help!

                It seems i'm going to have to dive pretty deep into debug to figure this one out. I had just been reaching out to make sure there isn't something increadibly dumb that I was missing.

                One last thing you might be able to help with....My current broker does not support NT. I opened an account and with Forex.com and funded it with some small amount of test money to test with NT. When I connect to the (Funded) Forex.com account in NT under the account tab it shows it as a SIM account...is there something I have to change to get it to connect to the funded account? I did not select 'demo' in the connection settings....

                Thank you again!

                Roger

                Comment


                  #9
                  Hello,

                  Thank you for the reply.

                  Yes, in this case, you would likely need to further debug the script, you may also need to comment out the public properties in case one has an error.

                  Regarding your account, is it showing as Sim101 only? You generally will see the Sim101 in addition to a live account. Also, have you entered your live license key or do you currently have the @SIM key? You can locate this in the help -> License key menu.

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

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by yertle, Today, 08:38 AM
                  6 responses
                  25 views
                  0 likes
                  Last Post ryjoga
                  by ryjoga
                   
                  Started by algospoke, Yesterday, 06:40 PM
                  2 responses
                  24 views
                  0 likes
                  Last Post algospoke  
                  Started by ghoul, Today, 06:02 PM
                  3 responses
                  16 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by jeronymite, 04-12-2024, 04:26 PM
                  3 responses
                  46 views
                  0 likes
                  Last Post jeronymite  
                  Started by Barry Milan, Yesterday, 10:35 PM
                  7 responses
                  23 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Working...
                  X