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

Changing variable while Strat Analyzer open causes error

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

    Changing variable while Strat Analyzer open causes error

    Hey fellas -

    I wanted to report a bug I found while working in the Strat Analyzer. If you have an input parameter that was one variable type and then you change to another while the Strat Analyzer Optimization is open, the Optimization gets confused. After the error condition happens, it won't correct until you restart Ninjatrader.

    Steps to duplicate:
    1. Create/open a test script.
    2. Create an input parameter (i.e. double). For example:

    [NinjaScriptProperty]
    [Range(1.0, 10.0)]
    [Display(ResourceType = typeof(Custom.Resource), Name="Test1", Description="Test1", Order=1, GroupName="NinjaScriptStrategyParameters")]
    public double Test1
    { get; set; }

    3. Compile.
    4. In Strategy Analyzer, select your script and Backtest type (Optimization).
    5. Put in some valid values and Run.
    6. Go back to your script and change the input parameter to an Int with a range of 1-100 or something.
    7. Compile.
    8. Note the Strat Analyzer field changed to a single field and the drop down is no longer available.
    9. If you change the Backtest type from Standard back to Optimization, it doesn't fix itself. If you close out and restart Strat Analyzer, it doesn't fix itself.

    #2
    Hello PN720,

    Thank you for your note.

    After step 7, the compile, do nothing and the error should come up? I'm having trouble replicating with the script I've attached. I run a optimization, go to the script, uncomment line 73-76 and comment out line 68-71.

    What version of NT8 are you on?

    I look forward to your reply.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hi Alan,

      I noticed that your syntax is slightly different than mine but I'm not sure that matters.

      Anyways, you'll notice that following your steps and your script, you'll see 2 things:

      1. In the Log File, you'll see this error after changing and compile:

      Time Category Message
      8/16/2018 8:39:57 AM Default Error on getting/setting property 'Xx' for NinjaScript 'aaTest/-1': Object of type 'System.Double' cannot be converted to type 'System.Int32'.

      2. The Optimization no longer runs as you get no results.

      Comment


        #4
        Hello PN720,

        I was able to replicate and have submitted this as a bug report.

        Thanks for your report.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Radano, 06-10-2021, 01:40 AM
        19 responses
        606 views
        0 likes
        Last Post Radano
        by Radano
         
        Started by KenneGaray, Today, 03:48 AM
        0 responses
        4 views
        0 likes
        Last Post KenneGaray  
        Started by thanajo, 05-04-2021, 02:11 AM
        4 responses
        470 views
        0 likes
        Last Post tradingnasdaqprueba  
        Started by aa731, Today, 02:54 AM
        0 responses
        5 views
        0 likes
        Last Post aa731
        by aa731
         
        Started by Christopher_R, Today, 12:29 AM
        0 responses
        11 views
        0 likes
        Last Post Christopher_R  
        Working...
        X