• 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

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 Vincere, Today, 03:08 AM
        0 responses
        2 views
        0 likes
        Last Post Vincere
        by Vincere
         
        Started by curious, Today, 02:17 AM
        2 responses
        10 views
        0 likes
        Last Post curious
        by curious
         
        Started by pmmkm, Yesterday, 11:13 PM
        0 responses
        3 views
        0 likes
        Last Post pmmkm
        by pmmkm
         
        Started by pulpiwapi, 03-04-2019, 11:18 PM
        11 responses
        150 views
        0 likes
        Last Post music_p13  
        Started by indy73, 06-25-2019, 10:52 PM
        3 responses
        22 views
        0 likes
        Last Post sledge
        by sledge
         
        Working...
        X