• 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.

  • NinjaTrader_AlanP
    replied
    Hello PN720,

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

    Thanks for your report.

    Leave a comment:


  • PN720
    replied
    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.

    Leave a comment:


  • NinjaTrader_AlanP
    replied
    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

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by priceisking, Today, 12:51 PM
1 response
14 views
0 likes
Last Post NinjaTrader_PaulH  
Started by chartish, Today, 10:33 AM
3 responses
20 views
0 likes
Last Post chartish  
Started by casabella, Today, 11:51 AM
1 response
9 views
0 likes
Last Post NinjaTrader_PaulH  
Started by Johnny, Today, 11:42 AM
1 response
15 views
0 likes
Last Post NinjaTrader_Jermaine  
Started by habibalex, Today, 09:03 AM
2 responses
14 views
0 likes
Last Post sledge
by sledge
 
Working...
X