• 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

Exported DLL and Strategy Analyzer

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

    Exported DLL and Strategy Analyzer

    I brought up this issue during B2 and was told that it was fixed in B3, but I'm still experiencing the same issue... I'll try to explain using a simple example...

    I've duplicated the default SMA indicator without any modifications and renamed it SMADLL.. I've exported it as a compiled assembly without any type of confuscation or protection.. The export produces SMADLL.dll and SMADLL.cs.. I've then copy'd and modified the default SampleMACrossOver strategy to use the new SMADLL indicator instead of the default SMA, and exported it as a normal cs file named SampleSMADLLCrossOver.cs .. I've also thrown in a couple print statements in the strat so that you can see what if any errors are happening..

    All this was done under B3... Now on a Virtual Machine for testing purposes, with B3 installed as well.. I've imported both the above indicator and strat, as well as added the SMADLL into the references.. Now I open a new strategy analyzer and do a standard backtest using the SampleSMADLLCrossOver on a CL 08-15 1min chart, all default settings, while connected to Kinetick.. So far everything works fine..

    Now, I change the BackTest type from Standard to Optimization, modify the Fast parameter to 10:20:1 and try to run it again.. At this point it does run the first backtest for Fast 10, but on all subsequent test 11-20 I get this printed in the output window..

    ------------------
    System.NullReferenceException: Object reference not set to an instance of an object.
    at NinjaTrader.NinjaScript.Indicators.Indicator.SMADL L(ISeries`1 input, Int32 period)
    at NinjaTrader.NinjaScript.Strategies.SampleSMADLLCro ssOver.OnStateChange()
    Object reference not set to an instance of an object.
    ------------------

    Running this same strat the exact same way on the machine that has the SMADLL as a cs file works just fine.. It's only the machine that is using the dll that has the problem..

    I've combined and included all the code in an importable zip file below. Import it into NT8 B3 as you would any script.. By importing this, it will add the SampleSMADLLCrossOver strategy to the strategies folder, the SMADLL dll and cs file to the custom folder, and will also automatically add the SMADLL as a reference without needing to do so thru the NSEditor...

    Again, Please be Aware by importing this file, It does contain a will install a non protected DLL file and will add a reference to it!


    Please Advise!


    Attached Files
    -=Edge=-
    NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

    #2
    Hello Edge,

    Thank you for your update on this matter.

    I had tested this previously and did not see the issue. I will test with your uploaded documents, and thank you for adding the disclaimer on the protected .dll file.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PatrickH View Post
      Hello Edge,

      Thank you for your update on this matter.

      I had tested this previously and did not see the issue. I will test with your uploaded documents, and thank you for adding the disclaimer on the protected .dll file.
      Thanks Patrick, it's actually the exact same code we looked at before, I just re-exported it again in B3 thinking that maybe it had something to do with the previous Ninjascript generated code from B2.. but same errors when running either..

      The dll is not protected or obfuscated in any way, and is nothing more than an exact copy of the SMA indicator renamed and exported as a non protected compiled assembly.. Just in case you wanted to try duplicating the export..


      -=Edge=-
      NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

      Comment


        #4
        Originally posted by NinjaTrader_PatrickH View Post
        I will test with your uploaded documents
        Just wanted to check back to see if you were able to duplicate what I am experiencing?


        -=Edge=-
        NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

        Comment


          #5
          Originally posted by -=Edge=- View Post
          Just wanted to check back to see if you were able to duplicate what I am experiencing?
          My Bad, I'm not sure what I was thinking, or why I didn't think about applying the same code that resolved a different issue with an unrelated strat.. But adding this line of code to the strategy in the State.Default does seem to fix this issue.. Sorry for the confusion..

          Code:
          IsInstantiatedOnEachOptimizationIteration = true;
          Last edited by -=Edge=-; 07-23-2015, 02:03 PM.
          -=Edge=-
          NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

          Comment


            #6
            Hello -=Edge=-,

            Thank you for your updates on this matter.

            We are looking into this on our end. I can confirm I see the same issue.
            Patrick H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by claxxical, Today, 10:00 PM
            0 responses
            2 views
            0 likes
            Last Post claxxical  
            Started by ct, Today, 08:13 PM
            0 responses
            5 views
            0 likes
            Last Post ct
            by ct
             
            Started by Lumbeezl, Today, 05:17 PM
            0 responses
            6 views
            0 likes
            Last Post Lumbeezl  
            Started by wishing, Today, 03:33 PM
            0 responses
            10 views
            0 likes
            Last Post wishing
            by wishing
             
            Started by ATMtrader0001, Today, 01:48 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Working...
            X